You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
1.7 MiB

/**
* plotly.js (mapbox - minified) v1.58.4
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return i(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),i={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":212}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":325}],3:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":191}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":333}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox")]),e.exports=n},{"./choroplethmapbox":2,"./core":3,"./densitymapbox":4,"./scattermapbox":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":375}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta");function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e,r,n,i,a,s,l=0,u=t.length;if(u>2){for(s=0;s<u;s++)s===u-2?(n=u-2,i=u-1,a=0):s===u-1?(n=u-1,i=0,a=1):(n=s,i=s+1,a=s+2),e=t[n],r=t[i],l+=(o(t[a][0])-o(e[0]))*Math.sin(o(r[1]));l=6378137*l*6378137/2}return l}function o(t){return t*Math.PI/180}r.default=function(t){return n.geomReduce(t,(function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=i(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}},{"@turf/meta":11}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta");r.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}},{"@turf/meta":11}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),i=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=0,a=0,o=0;return n.coordEach(t,(function(t){r+=t[0],a+=t[1],o++})),i.point([r/o,a/o],e.properties)}},{"@turf/helpers":10,"@turf/meta":11}],10:[function(t,e,r){"use strict";function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function i(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function a(t,e,r){void 0===r&&(r={});for(var i=0,a=t;i<a.length;i++){var o=a[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function p(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t*n}function h(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t/n}function f(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return i(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return a(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return c(e).geometry;default:throw new Error(t+" is invalid")}},r.point=i,r.points=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return i(t,e)})),r)},r.polygon=a,r.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return a(t,e)})),r)},r.lineString=o,r.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map((function(t){return o(t,e)})),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=u,r.multiPolygon=c,r.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},r.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!d(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;v<y;v++){l=(p=!!(c=m?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var x=0,b=0;if(null!==(s=p?c.geometries[_]:c)){u=s.coordinates;var w=s.type;switch(h=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,f,v,x,b))return!1;f++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],f,v,x,b))return!1;f++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(a=0;a<u[n].length-h;a++){if(!1===e(u[n][a],f,v,x,b))return!1;f++}"MultiLineString"===w&&x++,"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(b=0,a=0;a<u[n].length;a++){for(o=0;o<u[n][a].length-h;o++){if(!1===e(u[n][a][o],f,v,x,b))return!1;f++}b++}x++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===i(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function a(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function o(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,i,a,o,s,l,u,c,p,h=0,f="FeatureCollection"===t.type,d="Feature"===t.type,m=f?t.features.length:1;for(r=0;r<m;r++){for(s=f?t.features[r].geometry:d?t.geometry:t,u=f?t.features[r].properties:d?t.properties:{},c=f?t.features[r].bbox:d?t.bbox:void 0,p=f?t.features[r].id:d?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(a,h,u,c,p))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],h,u,c,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,h,u,c,p))return!1;h++}}function l(t,e){s(t,(function(t,r,i,a,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(n.feature(t,i,{bbox:a,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:s,coordinates:t.coordinates[u]};if(!1===e(n.feature(c,i),r,u))return!1}}))}function u(t,e){l(t,(function(t,r,a){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,u=0,c=0,p=0;return!1!==i(t,(function(i,s,h,f,d){if(void 0===l||r>u||f>c||d>p)return l=i,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(n.lineString(o[s],t.properties),r,i,s))return!1}}}))}r.coordEach=i,r.coordReduce=function(t,e,r,n){var a=r;return i(t,(function(t,n,i,o,s){a=0===n&&void 0===r?t:e(a,t,n,i,o,s)}),n),a},r.propEach=a,r.propReduce=function(t,e,r){var n=r;return a(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},r.featureEach=o,r.featureReduce=function(t,e,r){var n=r;return o(t,(function(t,i){n=0===i&&void 0===r?t:e(n,t,i)})),n},r.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},r.geomEach=s,r.geomReduce=function(t,e,r){var n=r;return s(t,(function(t,i,a,o,s){n=0===i&&void 0===r?t:e(n,t,i,a,o,s)})),n},r.flattenEach=l,r.flattenReduce=function(t,e,r){var n=r;return l(t,(function(t,i,a){n=0===i&&0===a&&void 0===r?t:e(n,t,i,a)})),n},r.segmentEach=u,r.segmentReduce=function(t,e,r){var n=r,i=!1;return u(t,(function(t,a,o,s,l){n=!1===i&&void 0===r?t:e(n,t,a,o,s,l),i=!0})),n},r.lineEach=c,r.lineReduce=function(t,e,r){var n=r;return c(t,(function(t,i,a,o){n=0===i&&void 0===r?t:e(n,t,i,a,o)})),n},r.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),n.lineString([u[s],u[s+1]],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),n.lineString([u[o][s],u[o][s+1]],l,e);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s-1),n.lineString([u[a][s],u[a][s+1]],l,e);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s-1),n.lineString([u[a][o][s],u[a][o][s+1]],l,e)}throw new Error("geojson is invalid")},r.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":return n.point(u,l,e);case"MultiPoint":return a<0&&(a=u.length+a),n.point(u[a],l,e);case"LineString":return s<0&&(s=u.length+s),n.point(u[s],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),n.point(u[o][s],l,e);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s),n.point(u[a][s],l,e);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s),n.point(u[a][o][s],l,e)}throw new Error("geojson is invalid")}},{"@turf/helpers":10}],12:[function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(r,n){function i(){void 0!==a&&t.removeListener("error",a),r([].slice.call(arguments))}var a;"error"!==e&&(a=function(r){t.removeListener(e,i),n(r)},t.once("error",a)),t.once(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function p(t,e,r,n){var i,a,o,s;if(u(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):g(i,i.length)}function m(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)a(l,this,e);else{var u=l.length,c=g(l,u);for(r=0;r<u;++r)a(c[r],this,e)}return!0},s.prototype.addListener=function(t,e){return p(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return p(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,i,a,o;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],13:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],14:[function(t,e,r){!function(n,i){"object"==typeof r&&"undefined"!=typeof e?i(r,t("d3-time")):i((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,p=t.shortDays,h=t.months,vt=t.shortMonths,_t=f(u),xt=d(u),bt=f(c),wt=d(c),Tt=f(p),kt=d(p),At=f(h),Mt=d(h),St=f(vt),Ct=d(vt),Lt={a:function(t){return p[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return h[t.getMonth()]},c:null,d:O,e:O,f:U,H:R,I:F,j:B,L:N,m:j,M:V,p:function(t){return u[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:Z,V:G,w:X,W:W,x:null,X:null,y:Y,Y:K,Z:J,"%":mt},Et={a:function(t){return p[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return h[t.getUTCMonth()]},c:null,d:Q,e:Q,f:nt,H:$,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ut,w:ct,W:pt,x:null,X:null,y:ht,Y:ft,Z:dt,"%":mt},It={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Ct[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:A,e:A,f:I,H:S,I:S,j:M,L:E,m:k,M:C,p:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:P,s:D,S:L,u:g,U:y,V:v,w:m,W:_,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:b,Y:x,Z:w,"%":z};function zt(t,e){return function(r){var n,i,a,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l<c;)37===t.charCodeAt(l)&&(o.push(t.slice(u,l)),null!=(i=s[n=t.charAt(++l)])?n=t.charAt(++l):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),o.push(n),u=l+1);return o.push(t.slice(u,l)),o.join("")}}function Pt(t,a){return function(o){var s,l,u=i(1900,void 0,1);if(Dt(u,t,o+="",0)!=o.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(1e3*u.s+("L"in u?u.L:0));if(a&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+12*u.p),void 0===u.m&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(i(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(i(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(i(u.y,0,1)).getUTCDay():r(i(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,u=r.length;o<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=It[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Lt.x=zt(o,Lt),Lt.X=zt(l,Lt),Lt.c=zt(a,Lt),Et.x=zt(o,Et),Et.X=zt(l,Et),Et.c=zt(a,Et),{format:function(t){var e=zt(t+="",Lt);return e.toString=function(){return t},e},parse:function(t){var e=Pt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=zt(t+="",Et);return e.toString=function(){return t},e},utcParse:function(t){var e=Pt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function p(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function h(t){return t.replace(c,"\\$&")}function f(t){return new RegExp("^(?:"+t.map(h).join("|")+")","i")}function d(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function m(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function g(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function y(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function v(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function _(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function x(t,e,r){var n=l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function b(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function z(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function P(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return p(t.getDate(),e,2)}function R(t,e){return p(t.getHours(),e,2)}function F(t,e){return p(t.getHours()%12||12,e,2)}function B(t,r){return p(1+e.timeDay.count(e.timeYear(t),t),r,3)}function N(t,e){return p(t.getMilliseconds(),e,3)}function U(t,e){return N(t,e)+"000"}function j(t,e){return p(t.getMonth()+1,e,2)}function V(t,e){return p(t.getMinutes(),e,2)}function q(t,e){return p(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function Z(t,r){return p(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function G(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),p(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function X(t){return t.getDay()}function W(t,r){return p(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Y(t,e){return p(t.getFullYear()%100,e,2)}function K(t,e){return p(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+p(e/60|0,"0",2)+p(e%60,"0",2)}function Q(t,e){return p(t.getUTCDate(),e,2)}function $(t,e){return p(t.getUTCHours(),e,2)}function tt(t,e){return p(t.getUTCHours()%12||12,e,2)}function et(t,r){return p(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return p(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return p(t.getUTCMonth()+1,e,2)}function at(t,e){return p(t.getUTCMinutes(),e,2)}function ot(t,e){return p(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return p(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),p(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function pt(t,r){return p(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ht(t,e){return p(t.getUTCFullYear()%100,e,2)}function ft(t,e){return p(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var _t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=_t,t.isoParse=xt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":15}],15:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,i,a,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e<r-t?e:r},s.offset=function(t,e){return i(t=new Date(+t),null==e?1:Math.floor(e)),t},s.range=function(e,r,n){var a,o=[];if(e=s.ceil(e),n=null==n?1:Math.floor(n),!(e<r&&n>0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a<e&&e<r);return o},s.filter=function(e){return n((function(r){if(r>=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),p=c.range,h=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),f=h.range;function d(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var m=d(0),g=d(1),y=d(2),v=d(3),_=d(4),x=d(5),b=d(6),w=m.range,T=g.range,k=y.range,A=v.range,M=_.range,S=x.range,C=b.range,L=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),E=L.range,I=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));I.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var z=I.range,P=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),D=P.range,O=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),R=O.range,F=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),B=F.range;function N(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var U=N(0),j=N(1),V=N(2),q=N(3),H=N(4),Z=N(5),G=N(6),X=U.range,W=j.range,Y=V.range,K=q.range,J=H.range,Q=Z.range,$=G.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=h,t.timeDays=f,t.timeFriday=x,t.timeFridays=S,t.timeHour=c,t.timeHours=p,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=g,t.timeMondays=T,t.timeMonth=L,t.timeMonths=E,t.timeSaturday=b,t.timeSaturdays=C,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=m,t.timeSundays=w,t.timeThursday=_,t.timeThursdays=M,t.timeTuesday=y,t.timeTuesdays=k,t.timeWednesday=v,t.timeWednesdays=A,t.timeWeek=m,t.timeWeeks=w,t.timeYear=I,t.timeYears=z,t.utcDay=F,t.utcDays=B,t.utcFriday=Z,t.utcFridays=Q,t.utcHour=O,t.utcHours=R,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=P,t.utcMinutes=D,t.utcMonday=j,t.utcMondays=W,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=G,t.utcSaturdays=$,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=U,t.utcSundays=X,t.utcThursday=H,t.utcThursdays=J,t.utcTuesday=V,t.utcTuesdays=Y,t.utcWednesday=q,t.utcWednesdays=K,t.utcWeek=U,t.utcWeeks=X,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],16:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,p=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){p.call(this,t,e+"",r)}}function h(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+t[a])&&(n+=r);else for(;++a<i;)d(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=f(t[a]))?n+=r:--o;else for(;++a<i;)d(r=f(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=f(e[o]))&&i.push(n);else for(;++o<a;)d(n=f(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(h),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=f(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=f(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(h);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,y),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function b(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=_(v(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new b;if(t instanceof b)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};function w(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function T(t){return"\0"===(t+="")[0]?t.slice(1):t}function k(t){return w(t)in this._}function A(t){return(t=w(t))in this._&&delete this._[t]}function M(){var t=[];for(var e in this._)t.push(T(e));return t}function S(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function L(){this._=Object.create(null)}function E(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function z(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;r<n;++r){var i=P[r]+e;if(i in t)return i}}x(b,{has:k,get:function(t){return this._[w(t)]},set:function(t,e){return this._[w(t)]=e},remove:A,keys:M,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:T(e),value:this._[e]});return t},size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,p,h=-1,f=a.length,d=i[s++],m=new b;++h<f;)(p=m.get(l=d(u=a[h])))?p.push(u):m.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),m.forEach(c),u}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=i.length)return e;var n=[],o=a[r++];return e.forEach((function(e,i){n.push({key:e,values:t(i,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},x(L,{has:k,add:function(t){return this._[w(t+="")]=!0,t},remove:A,values:M,size:S,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=I(t,e,e[r]);return t};var P=["webkit","ms","moz","Moz","o","O"];function D(){}function O(){}function R(t){var e=[],r=new b;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function F(){t.event.preventDefault()}function B(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function N(e){for(var r=new O,n=0,i=arguments.length;++n<i;)r[arguments[n]]=R(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new O,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=R(t);return t},O.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return j(t,G),t}var q=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[z(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var G=t.selection.prototype=[];function X(t){return"function"==typeof t?t:function(){return q(t,this)}}function W(t){return"function"==typeof t?t:function(){return H(t,this)}}G.select=function(t){var e,r,n,i,a=[];t=X(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return V(a)},G.selectAll=function(t){var e,r,i=[];t=W(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,u=s.length;++l<u;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return V(i)};var Y="http://www.w3.org/1999/xhtml",K={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function J(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function Q(t){return t.trim().replace(/\s+/g," ")}function $(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function tt(t){return(t+"").trim().split(/^|\s+/)}function et(t,e){var r=(t=tt(t).map(rt)).length;return"function"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function rt(t){var e=$(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",Q(i+" "+t))):r.setAttribute("class",Q(i.replace(e," ")))}}function nt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function it(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function at(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(r,e)}}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function lt(t){return function(){return Z(this,t)}}function ut(t){return arguments.length||(t=h),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ct(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function pt(t){return j(t,ht),t}t.ns={prefix:K,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!$(t[i]).test(e))return!1;return!0}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},G.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(nt(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(nt(t,e,r))},G.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(it(e,t[e]));return this}return this.each(it(t,e))},G.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},G.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},G.append=function(t){return t=at(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},G.insert=function(t,e){return t=at(t),e=X(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},G.remove=function(){return this.each(ot)},G.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,c=r.length,p=Math.min(o,c),h=new Array(c),f=new Array(c),d=new Array(o);if(e){var m,g=new b,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(g.has(m=e.call(i,i.__data__,n))?d[n]=i:g.set(m,i),y[n]=m);for(n=-1;++n<c;)(i=g.get(m=e.call(r,a=r[n],n)))?!0!==i&&(h[n]=i,i.__data__=a):f[n]=st(a),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(d[n]=t[n])}else{for(n=-1;++n<p;)i=t[n],a=r[n],i?(i.__data__=a,h[n]=i):f[n]=st(a);for(;n<c;++n)f[n]=st(r[n]);for(;n<o;++n)d[n]=t[n]}f.update=h,f.parentNode=h.parentNode=d.parentNode=t.parentNode,s.push(f),l.push(h),u.push(d)}var s=pt([]),l=V([]),u=V([]);if("function"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return u},l},G.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},G.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=lt(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return V(i)},G.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},G.each=function(t){return ct(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},G.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},G.empty=function(){return!this.node()},G.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},G.size=function(){var t=0;return ct(this,(function(){++t})),t};var ht=[];function ft(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function dt(e,r,i){var a="__on"+e,o=e.indexOf("."),s=gt;o>0&&(e=e.slice(0,o));var l=mt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=yt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?D:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=pt,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return V(o)},ht.insert=function(t,e){return arguments.length<2&&(e=ft(this)),G.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[q(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),V([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(H(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,V([e])},G.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(dt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(dt(t,e,r))};var mt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function gt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function yt(t,e){var r=gt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&mt.forEach((function(t){"on"+t in i&&mt.remove(t)}));var vt,_t=0;function xt(e){var r=".dragsuppress-"+ ++_t,n="click"+r,i=t.select(o(e)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==vt&&(vt=!("onselectstart"in e)&&z(e.style,"userSelect")),vt){var s=a(e).style,l=s[vt];s[vt]="none"}return function(t){if(i.on(r,null),vt&&(s[vt]=l),t){var e=function(){i.on(n,null)};i.on(n,(function(){F(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return wt(t,B())};var bt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function wt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(bt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();bt=!(s.f||s.e),n.remove()}}return bt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function Tt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=B().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return wt(t,n)},t.behavior.drag=function(){var e=N(a,"drag","dragstart","dragend"),r=null,n=s(D,t.mouse,o,"mousemove","mouseup"),i=s(Tt,t.touch,E,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,u=this,c=t.event.target.correspondingElement||t.event.target,p=u.parentNode,h=e.of(u,arguments),f=0,d=n(),m=".drag"+(null==d?"":"-"+d),g=t.select(a(c)).on(o+m,_).on(s+m,x),y=xt(c),v=i(p,d);function _(){var t,e,r=i(p,d);r&&(t=r[0]-v[0],e=r[1]-v[1],f|=t|e,v=r,h({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}function x(){i(p,d)&&(g.on(o+m,null).on(s+m,null),y(f),h({type:"dragend"}))}l=r?[(l=r.apply(u,arguments)).x-v[0],l.y-v[1]]:[0,0],h({type:"dragstart"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=B().touches),e?n(e).map((function(e){var r=wt(t,e);return r.identifier=e.identifier,r})):[]};var kt=1e-6,At=1e-12,Mt=Math.PI,St=2*Mt,Ct=St-kt,Lt=Mt/2,Et=Mt/180,It=180/Mt;function zt(t){return t>0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Dt(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Ot(t){return t>1?Lt:t<-1?-Lt:Math.asin(t)}function Rt(t){return((t=Math.exp(t))+1/t)/2}function Ft(t){return(t=Math.sin(t/2))*t}var Bt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,p=l-a,h=c*c+p*p;if(h<At)n=Math.log(u/o)/Bt,r=function(t){return[i+t*c,a+t*p,o*Math.exp(Bt*t*n)]};else{var f=Math.sqrt(h),d=(u*u-o*o+4*h)/(2*o*2*f),m=(u*u-o*o-4*h)/(2*u*2*f),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Bt,r=function(t){var e,r=t*n,s=Rt(g),l=o/(2*f)*(s*(e=Bt*r+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+l*c,a+l*p,o*s/Rt(Bt*r+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,u,c,p,h={x:0,y:0,k:1},f=[960,500],d=jt,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",_="mouseup.zoom",x="touchstart.zoom",b=N(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,I).on(Ut+".zoom",P).on("dblclick.zoom",D).on(x,z)}function T(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function k(t){h.k=Math.max(d[0],Math.min(d[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function M(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},k(Math.pow(2,a)),A(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){u&&u.domain(l.range().map((function(t){return(t-h.x)/h.k})).map(l.invert)),p&&p.domain(c.range().map((function(t){return(t-h.y)/h.k})).map(c.invert))}function C(t){g++||t({type:"zoomstart"})}function L(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function E(t){--g||(t({type:"zoomend"}),r=null)}function I(){var e=this,r=b.of(e,arguments),n=0,i=t.select(o(e)).on(v,l).on(_,u),a=T(t.mouse(e)),s=xt(e);function l(){n=1,A(t.mouse(e),a),L(r)}function u(){i.on(v,null).on(_,null),s(n),E(r)}ys.call(e),C(r)}function z(){var e,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],p=t.select(r),f=xt(r);function d(){var n=t.touches(r);return e=h.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,p=n.length;o<p;++o)i[n[o].identifier]=null;var f=d(),m=Date.now();if(1===f.length){if(m-s<500){var y=f[0];M(r,y,i[y.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),F()}s=m}else if(f.length>1){y=f[0];var _=f[1],x=y[0]-_[0],b=y[1]-_[1];a=x*x+b*b}}function g(){var o,l,u,c,p=t.touches(r);ys.call(r);for(var h=0,f=p.length;h<f;++h,c=null)if(u=p[h],c=i[u.identifier]){if(l)break;o=u,l=c}if(c){var d=(d=u[0]-o[0])*d+(d=u[1]-o[1])*d,m=a&&Math.sqrt(d/a);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],k(m*e)}s=null,A(o,l),L(n)}function v(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void d()}t.selectAll(c).on(o,null),p.on(y,I).on(x,z),f(),E(n)}m(),C(n),p.on(y,null).on(x,m)}function P(){var i=b.of(this,arguments);a?clearTimeout(a):(ys.call(this),e=T(r=n||t.mouse(this)),C(i)),a=setTimeout((function(){a=null,E(i)}),50),F(),k(Math.pow(2,.002*Nt())*h.k),A(r,e),L(i)}function D(){var e=t.mouse(this),r=Math.log(h.k)/Math.LN2;M(this,e,T(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Ut||(Ut="onwheel"in i?(Nt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(Nt=function(){return t.event.wheelDelta},"mousewheel"):(Nt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=b.of(this,arguments),n=h;xs?t.select(this).transition().each("start.zoom",(function(){h=this.__chart__||{x:0,y:0,k:1},C(e)})).tween("zoom:zoom",(function(){var i=f[0],a=f[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-h.x)/h.k,(s-h.y)/h.k,i/h.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=h={x:o-r[0]*n,y:s-r[1]*n,k:n},L(e)}})).each("interrupt.zoom",(function(){E(e)})).each("end.zoom",(function(){E(e)})):(this.__chart__=h,C(e),L(e),E(e))}))},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},S(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},k(+t),S(),w):h.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?jt:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(f=t&&[+t[0],+t[1]],w):f},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(u=t,l=t.copy(),h={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(p=t,c=t.copy(),h={x:0,y:0,k:1},w):p},t.rebind(w,b,"on")};var Nt,Ut,jt=[0,1/0];function Vt(){}function qt(t,e,r){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):le(""+t,ue,qt):new qt(t,e,r)}t.color=Vt,Vt.prototype.toString=function(){return this.rgb()+""},t.hsl=qt;var Ht=qt.prototype=new Vt;function Zt(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ne(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):$t(e instanceof Yt?e.l:(e=ce((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Ht.rgb=function(){return Zt(this.h,this.s,this.l)},t.hcl=Gt;var Xt=Gt.prototype=new Vt;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):ce((t=ne(t)).r,t.g,t.b):new Yt(t,e,r)}Xt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Kt*(arguments.length?t:1)))},Xt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Kt*(arguments.length?t:1)))},Xt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Kt=18,Jt=Yt.prototype=new Vt;function Qt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ne(re(3.2404542*(i=.95047*te(i))-1.5371385*(n=1*te(n))-.4985314*(a=1.08883*te(a))),re(-.969266*i+1.8760108*n+.041556*a),re(.0556434*i-.2040259*n+1.0572252*a))}function $t(t,e,r){return t>0?new Gt(Math.atan2(r,e)*It,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):le(""+t,ne,Zt):new ne(t,e,r)}function ie(t){return new ne(t>>16,t>>8&255,255&t)}function ae(t){return ie(t)+""}Jt.brighter=function(t){return new Yt(Math.min(100,this.l+Kt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Yt(Math.max(0,this.l-Kt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return Qt(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Vt;function se(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(he(i[0]),he(i[1]),he(i[2]))}return(a=fe.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function ue(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new qt(n,i,l)}function ce(t,e,r){var n=ee((.4124564*(t=pe(t))+.3575761*(e=pe(e))+.1804375*(r=pe(r)))/.95047),i=ee((.2126729*t+.7151522*e+.072175*r)/1);return Yt(116*i-16,500*(n-i),200*(i-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ne(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ne(i,i,i)},oe.darker=function(t){return new ne((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},oe.hsl=function(){return ue(this.r,this.g,this.b)},oe.toString=function(){return"#"+se(this.r)+se(this.g)+se(this.b)};var fe=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function de(t){return"function"==typeof t?t:function(){return t}}function me(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ge(e,r,t,n)}}function ge(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function p(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||e>=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}fe.forEach((function(t,e){fe.set(t,ie(e))})),t.functor=de,t.xhr=me(E),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ge(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i}))},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function p(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=p())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=p();e&&null==(h=e(h,c++))||s.push(h)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new L,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join("\n")},i.formatRows=function(t){return t.map(s).join("\n")},i},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var ye,ve,_e,xe,be=this[z(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function we(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return ve?ve.n=a:ye=a,ve=a,_e||(xe=clearTimeout(xe),_e=1,be(Te)),a}function Te(){var t=ke(),e=Ae()-t;e>24?(isFinite(e)&&(clearTimeout(xe),xe=setTimeout(Te,e)),_e=0):(_e=1,be(Te))}function ke(){for(var t=Date.now(),e=ye;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ae(){for(var t,e=ye,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:ye=e.n;return ve=t,r}function Me(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){we.apply(this,arguments)},t.timer.flush=function(){ke(),Ae()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Se=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var r=Math.pow(10,3*v(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Ce(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:E;return function(e){var n=Le.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],p=+n[6],h=n[7],f=n[8],d=n[9],m=1,g="",y="",v=!1,_=!0;switch(f&&(f=+f.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),d){case"n":h=!0,d="g";break;case"%":m=100,y="%",d="f";break;case"p":m=100,y="%",d="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+d.toLowerCase());case"c":_=!1;case"d":v=!0,f=0;break;case"s":m=-1,d="r"}"$"===u&&(g=a[0],y=a[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=Ee.get(d)||Ie;var x=c&&h;return function(e){var n=y;if(v&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(m<0){var u=t.formatPrefix(e,f);e=u.scale(e),n=u.symbol+y}else e*=m;var b,w,T=(e=d(e,f)).lastIndexOf(".");if(T<0){var k=_?e.lastIndexOf("e"):-1;k<0?(b=e,w=""):(b=e.substring(0,k),w=e.substring(k))}else b=e.substring(0,T),w=r+e.substring(T+1);!c&&h&&(b=o(b,1/0));var A=g.length+b.length+w.length+(x?0:a.length),M=A<p?new Array(A=p-A+1).join(i):"";return x&&(b=o(M+b,M.length?p-w.length:1/0)),a+=g,e=b+w,("<"===s?a+e+M:">"===s?M+a+e:"^"===s?M.substring(0,A>>=1)+a+e+M.substring(A):a+(x?e:M+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Me(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Se[8+n/3]};var Le=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ee=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Me(e,r))).toFixed(Math.max(0,Math.min(20,Me(e*(1+1e-15),r))))}});function Ie(t){return t+""}var ze=t.time={},Pe=Date;function De(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}De.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Oe.setUTCDate.apply(this._,arguments)},setDay:function(){Oe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Oe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Oe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Oe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Oe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Oe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Oe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Oe.setTime.apply(this._,arguments)}};var Oe=Date.prototype;function Re(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new Pe(r-1)),1),r}function a(t,r){return e(t=new Pe(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Fe(t);return s.floor=s,s.round=Fe(n),s.ceil=Fe(i),s.offset=Fe(a),s.range=function(t,e,r){try{Pe=De;var n=new De;return n._=t,o(n,e,r)}finally{Pe=Date}},t}function Fe(t){return function(e,r){try{Pe=De;var n=new De;return n._=e,t(n,r)._}finally{Pe=Date}}}function Be(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=Ne[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=b[n])&&(n=a(r,null==i?"e"===n?" ":"0":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(p(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Pe!==De,i=new(n?De:Pe);return"j"in r?i.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function p(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in Ne?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(Pe=De);return r._=t,e(r)}finally{Pe=Date}}return r.parse=function(t){try{Pe=De;var r=e.parse(t);return r&&r._}finally{Pe=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var h=t.map(),f=qe(o),d=He(o),m=qe(s),g=He(s),y=qe(l),v=He(l),_=qe(u),x=He(u);a.forEach((function(t,e){h.set(t.toLowerCase(),e)}));var b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+ze.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(ze.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(ze.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.w=g.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){f.lastIndex=0;var n=f.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){_.lastIndex=0;var n=_.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return p(t,b.c.toString(),e,r)},d:Qe,e:Qe,H:tr,I:tr,j:$e,L:nr,m:Je,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Ge,w:Ze,W:Xe,x:function(t,e,r){return p(t,b.x.toString(),e,r)},X:function(t,e,r){return p(t,b.X.toString(),e,r)},y:Ye,Y:We,Z:Ke,"%":ar};return c}ze.year=Re((function(t){return(t=ze.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),ze.years=ze.year.range,ze.years.utc=ze.year.utc.range,ze.day=Re((function(t){var e=new Pe(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),ze.days=ze.day.range,ze.days.utc=ze.day.utc.range,ze.dayOfYear=function(t){var e=ze.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=ze[t]=Re((function(t){return(t=ze.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));ze[t+"s"]=r.range,ze[t+"s"].utc=r.utc.range,ze[t+"OfYear"]=function(t){var r=ze.year(t).getDay();return Math.floor((ze.dayOfYear(t)+(r+e)%7)/7)}})),ze.week=ze.sunday,ze.weeks=ze.sunday.range,ze.weeks.utc=ze.sunday.utc.range,ze.weekOfYear=ze.sundayOfYear;var Ne={"-":"",_:" ",0:"0"},Ue=/^\s*\d+/,je=/^%/;function Ve(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function qe(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function He(t){for(var e=new b,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Ze(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Ge(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Xe(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function We(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ye(t,e,r){Ue.lastIndex=0;var n,i=Ue.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function Ke(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qe(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=v(e)/60|0,i=v(e)%60;return r+Ve(n,"0",2)+Ve(i,"0",2)}function ar(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Ce(t),timeFormat:Be(t)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function pr(t,e){t&&fr.hasOwnProperty(t.type)&&fr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):pr(t,e)};var hr={Feature:function(t,e){pr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)pr(r[n].geometry,e)}},fr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){dr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)dr(r[n],e,0)},Polygon:function(t,e){mr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)mr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)pr(r[n],e)}};function dr(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function mr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)dr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return gr=0,t.geo.stream(e,Lr),gr};var gr,yr,vr,_r,xr,br,wr,Tr,kr,Ar,Mr,Sr,Cr=new lr,Lr={sphere:function(){gr+=4*Mt},point:D,lineStart:D,lineEnd:D,polygonStart:function(){Cr.reset(),Lr.lineStart=Er},polygonEnd:function(){var t=2*Cr;gr+=t<0?4*Mt+t:t,Lr.lineStart=Lr.lineEnd=Lr.point=D}};function Er(){var t,e,r,n,i;function a(t,e){e=e*Et/2+Mt/4;var a=(t*=Et)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,p=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Cr.add(Math.atan2(h,p)),r=t,n=l,i=u}Lr.point=function(o,s){Lr.point=a,r=(t=o)*Et,n=Math.cos(s=(e=s)*Et/2+Mt/4),i=Math.sin(s)},Lr.lineEnd=function(){a(t,e)}}function Ir(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function zr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Dr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Or(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Rr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Fr(t){return[Math.atan2(t[1],t[0]),Ot(t[2])]}function Br(t,e){return v(t[0]-e[0])<kt&&v(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,u,c,p,h={point:f,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=x,u=0,Lr.polygonStart()},polygonEnd:function(){Lr.polygonEnd(),h.point=f,h.lineStart=m,h.lineEnd=g,Cr<0?(e=-(n=180),r=-(i=90)):u>kt?i=90:u<-kt&&(r=-90),p[0]=e,p[1]=n}};function f(t,a){c.push(p=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function d(t,o){var s=Ir([t*Et,o*Et]);if(l){var u=Pr(l,s),c=Pr([u[1],-u[0],0],u);Rr(c),c=Fr(c);var p=t-a,h=p>0?1:-1,d=c[0]*It*h,m=v(p)>180;if(m^(h*a<d&&d<h*t))(g=c[1]*It)>i&&(i=g);else if(m^(h*a<(d=(d+360)%360-180)&&d<h*t)){var g;(g=-c[1]*It)<r&&(r=g)}else o<r&&(r=o),o>i&&(i=o);m?t<a?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>a?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t)}else f(t,o);l=s,a=t}function m(){h.point=d}function g(){p[0]=e,p[1]=n,h.point=f,l=null}function y(t,e){if(l){var r=t-a;u+=v(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Lr.point(t,e),d(t,e)}function _(){Lr.lineStart()}function x(){y(o,s),Lr.lineEnd(),v(u)>kt&&(e=-(n=180)),p[0]=e,p[1]=n,l=null}function b(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function T(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),c=[],t.geo.stream(a,h),u=c.length){c.sort(w);for(var o=1,s=[m=c[0]];o<u;++o)T((f=c[o])[0],m)||T(f[1],m)?(b(m[0],f[1])>b(m[0],m[1])&&(m[1]=f[1]),b(f[0],m[1])>b(m[0],m[1])&&(m[0]=f[0])):s.push(m=f);for(var l,u,f,d=-1/0,m=(o=0,s[u=s.length-1]);o<=u;m=f,++o)f=s[o],(l=b(m[1],f[0]))>d&&(d=l,e=f[0],n=m[1])}return c=p=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){yr=vr=_r=xr=br=wr=Tr=kr=Ar=Mr=Sr=0,t.geo.stream(e,Nr);var r=Ar,n=Mr,i=Sr,a=r*r+n*n+i*i;return a<At&&(r=wr,n=Tr,i=kr,vr<kt&&(r=_r,n=xr,i=br),(a=r*r+n*n+i*i)<At)?[NaN,NaN]:[Math.atan2(n,r)*It,Ot(i/Math.sqrt(a))*It]};var Nr={sphere:D,point:Ur,lineStart:Vr,lineEnd:qr,polygonStart:function(){Nr.lineStart=Hr},polygonEnd:function(){Nr.lineStart=Vr}};function Ur(t,e){t*=Et;var r=Math.cos(e*=Et);jr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function jr(t,e,r){++yr,_r+=(t-_r)/yr,xr+=(e-xr)/yr,br+=(r-br)/yr}function Vr(){var t,e,r;function n(n,i){n*=Et;var a=Math.cos(i*=Et),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=e*l-r*s)*u+(u=r*o-t*l)*u+(u=t*s-e*o)*u),t*o+e*s+r*l);vr+=u,wr+=u*(t+(t=o)),Tr+=u*(e+(e=s)),kr+=u*(r+(r=l)),jr(t,e,r)}Nr.point=function(i,a){i*=Et;var o=Math.cos(a*=Et);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),Nr.point=n,jr(t,e,r)}}function qr(){Nr.point=Ur}function Hr(){var t,e,r,n,i;function a(t,e){t*=Et;var a=Math.cos(e*=Et),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),u=n*l-i*s,c=i*o-r*l,p=r*s-n*o,h=Math.sqrt(u*u+c*c+p*p),f=r*o+n*s+i*l,d=h&&-Dt(f)/h,m=Math.atan2(h,f);Ar+=d*u,Mr+=d*c,Sr+=d*p,vr+=m,wr+=m*(r+(r=o)),Tr+=m*(n+(n=s)),kr+=m*(i+(i=l)),jr(r,n,i)}Nr.point=function(o,s){t=o,e=s,Nr.point=a,o*=Et;var l=Math.cos(s*=Et);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),jr(r,n,i)},Nr.lineEnd=function(){a(t,e),Nr.lineEnd=qr,Nr.point=Ur}}function Zr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Gr(){return!0}function Xr(t,e,r,n,i){var a=[],o=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Br(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Yr(r,t,null,!0),u=new Yr(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Yr(n,t,null,!1),u=new Yr(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}})),o.sort(e),Wr(a),Wr(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,p,h=a[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(s=0,u=c.length;s<u;++s)i.point((p=c[s])[0],p[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(d)for(s=(c=f.p.z).length-1;s>=0;--s)i.point((p=c[s])[0],p[1]);else n(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function Wr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Yr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Kr(e,r,n,i){return function(a,o){var s,l=r(o),u=a.invert(i[0],i[1]),c={point:p,lineStart:f,lineEnd:d,polygonStart:function(){c.point=x,c.lineStart=b,c.lineEnd=w,s=[],m=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=d,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Cr.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var p=u[0],h=p[0],f=p[1]/2+Mt/4,d=Math.sin(f),m=Math.cos(f),g=1;;){g===c&&(g=0);var y=(t=u[g])[0],v=t[1]/2+Mt/4,_=Math.sin(v),x=Math.cos(v),b=y-h,w=b>=0?1:-1,T=w*b,k=T>Mt,A=d*_;if(Cr.add(Math.atan2(A*w*Math.sin(T),m*x+A*Math.cos(T))),a+=k?b+w*St:b,k^h>=r^y>=r){var M=Pr(Ir(p),Ir(t));Rr(M);var S=Pr(i,M);Rr(S);var C=(k^b>=0?-1:1)*Ot(S[2]);(n>C||n===C&&(M[0]||M[1]))&&(o+=k^b>=0?1:-1)}if(!g++)break;h=y,d=_,m=x,p=t}}return(a<-kt||a<kt&&Cr<-kt)^1&o}(u,m);s.length?(_||(o.polygonStart(),_=!0),Xr(s,$r,e,n,o)):e&&(_||(o.polygonStart(),_=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),s=m=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function h(t,e){var r=a(t,e);l.point(r[0],r[1])}function f(){c.point=h,l.lineStart()}function d(){c.point=p,l.lineEnd()}var m,g,y=Qr(),v=r(y),_=!1;function x(t,e){g.push([t,e]);var r=a(t,e);v.point(r[0],r[1])}function b(){v.lineStart(),g=[]}function w(){x(g[0][0],g[0][1]),v.lineEnd();var t,e=v.clean(),r=y.buffer(),n=r.length;if(g.pop(),m.push(g),g=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Jr))}return c}}function Jr(t){return t.length>1}function Qr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:D,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-Lt-kt:Lt-t[1])-((e=e.x)[0]<0?e[1]-Lt-kt:Lt-e[1])}var tn=Kr(Gr,(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Mt:-Mt,l=v(a-r);v(l-Mt)<kt?(t.point(r,n=(n+o)/2>0?Lt:-Lt),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Mt&&(v(r-i)<kt&&(r-=i*kt),v(a-s)<kt&&(a-=s*kt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return v(o)>kt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*Lt,n.point(-Mt,i),n.point(0,i),n.point(Mt,i),n.point(Mt,0),n.point(Mt,-i),n.point(0,-i),n.point(-Mt,-i),n.point(-Mt,0),n.point(-Mt,i);else if(v(t[0]-e[0])>kt){var a=t[0]<e[0]?Mt:-Mt;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}),[-Mt,-Mt/2]);function en(t){var e=Math.cos(t),r=e>0,n=v(e)>kt;return Kr(i,(function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(p,h){var f,d=[p,h],m=i(p,h),g=r?m?0:o(p,h):m?o(p+(p<0?Mt:-Mt),h):0;if(!e&&(u=l=m)&&t.lineStart(),m!==l&&(f=a(e,d),(Br(e,f)||Br(d,f))&&(d[0]+=kt,d[1]+=kt,m=i(d[0],d[1]))),m!==l)c=0,m?(t.lineStart(),f=a(d,e),t.point(f[0],f[1])):(f=a(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(n&&e&&r^m){var y;g&s||!(y=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!m||e&&Br(e,d)||t.point(d[0],d[1]),e=d,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}}),Bn(t,6*Et),r?[0,-t]:[-Mt,t-Mt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Pr(Ir(t),Ir(r)),o=zr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,p=Pr(i,a),h=Or(i,u);Dr(h,Or(a,c));var f=p,d=zr(h,f),m=zr(f,f),g=d*d-m*(zr(h,h)-1);if(!(g<0)){var y=Math.sqrt(g),_=Or(f,(-d-y)/m);if(Dr(_,h),_=Fr(_),!n)return _;var x,b=t[0],w=r[0],T=t[1],k=r[1];w<b&&(x=b,b=w,w=x);var A=w-b,M=v(A-Mt)<kt;if(!M&&k<T&&(x=T,T=k,k=x),M||A<kt?M?T+k>0^_[1]<(v(_[0]-b)<kt?T:k):T<=_[1]&&_[1]<=k:A>Mt^(b<=_[0]&&_[0]<=w)){var S=Or(f,(-d+y)/m);return Dr(S,h),[_,Fr(S)]}}}function o(e,n){var i=r?t:Mt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}function rn(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=0,p=1,h=s.x-l,f=s.y-u;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<p&&(p=a)}else if(h>0){if(a>p)return;a>c&&(c=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>p)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<p&&(p=a)}if(a=e-u,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<p&&(p=a)}else if(f>0){if(a>p)return;a>c&&(c=a)}if(a=n-u,f||!(a<0)){if(a/=f,f<0){if(a>p)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<p&&(p=a)}return c>0&&(i.a={x:l+c*h,y:u+c*f}),p<1&&(i.b={x:l+p*h,y:u+p*f}),i}}}}}}function nn(e,r,n,i){return function(l){var u,c,p,h,f,d,m,g,y,v,_,x=l,b=Qr(),w=rn(e,r,n,i),T={point:M,lineStart:function(){T.point=S,c&&c.push(p=[]);v=!0,y=!1,m=g=NaN},lineEnd:function(){u&&(S(h,f),d&&y&&b.rejoin(),u.push(b.buffer()));T.point=M,y&&l.lineEnd()},polygonStart:function(){l=b,u=[],c=[],_=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=c[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&Pt(u,a,t)>0&&++e:a[1]<=n&&Pt(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=_&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),k(null,null,1,l),l.lineEnd()),a&&Xr(u,o,r,k,l),l.polygonEnd()),u=c=p=null}};function k(t,o,l,u){var c=0,p=0;if(null==t||(c=a(t,l))!==(p=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==p);else u.point(o[0],o[1])}function A(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function M(t,e){A(t,e)&&l.point(t,e)}function S(t,e){var r=A(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(c&&p.push([t,e]),v)h=t,f=e,d=r,v=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&y)l.point(t,e);else{var n={a:{x:m,y:g},b:{x:t,y:e}};w(n)?(y||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),_=!1):r&&(l.lineStart(),l.point(t,e),_=!1)}m=t,g=e,y=r}return T};function a(t,i){return v(t[0]-e)<kt?i>0?0:3:v(t[0]-n)<kt?i>0?2:1:v(t[1]-r)<kt?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Mt/3,n=En(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Mt/180,r=t[1]*Mt/180):[e/Mt*180,r/Mt*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Ot((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],p=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,p-.238*e],[c+.455*e,p+.238*e]]).stream(l).point,n=o.translate([c-.307*e,p+.201*e]).clipExtent([[c-.425*e+kt,p+.12*e+kt],[c-.214*e-kt,p+.234*e-kt]]).stream(l).point,i=s.translate([c-.205*e,p+.212*e]).clipExtent([[c-.214*e+kt,p+.166*e+kt],[c-.115*e-kt,p+.234*e-kt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,pn,hn,fn={point:D,lineStart:D,lineEnd:D,polygonStart:function(){ln=0,fn.lineStart=dn},polygonEnd:function(){fn.lineStart=fn.lineEnd=fn.point=D,sn+=v(ln/2)}};function dn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}fn.point=function(a,o){fn.point=i,t=r=a,e=n=o},fn.lineEnd=function(){i(t,e)}}var mn={point:function(t,e){t<un&&(un=t);t>pn&&(pn=t);e<cn&&(cn=e);e>hn&&(hn=e)},lineStart:D,lineEnd:D,polygonStart:D,polygonEnd:D};function gn(){var t=yn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=yn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function yn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var vn,_n={point:xn,lineStart:bn,lineEnd:wn,polygonStart:function(){_n.lineStart=Tn},polygonEnd:function(){_n.point=xn,_n.lineStart=bn,_n.lineEnd=wn}};function xn(t,e){_r+=t,xr+=e,++br}function bn(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Tr+=o*(e+n)/2,kr+=o,xn(t=r,e=n)}_n.point=function(n,i){_n.point=r,xn(t=n,e=i)}}function wn(){_n.point=xn}function Tn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Tr+=o*(n+e)/2,kr+=o,Ar+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),Sr+=3*o,xn(r=t,n=e)}_n.point=function(a,o){_n.point=i,xn(t=r=a,e=n=o)},_n.lineEnd=function(){i(t,e)}}function kn(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:D};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,St)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function An(t){var e=.5,r=Math.cos(30*Et),n=16;function i(t){return(n?o:a)(t)}function a(e){return Cn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,i,a,o,l,u,c,p,h,f,d,m,g={point:y,lineStart:v,lineEnd:x,polygonStart:function(){e.polygonStart(),g.lineStart=b},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function y(r,n){r=t(r,n),e.point(r[0],r[1])}function v(){p=NaN,g.point=_,e.lineStart()}function _(r,i){var a=Ir([r,i]),o=t(r,i);s(p,h,c,f,d,m,p=o[0],h=o[1],c=r,f=a[0],d=a[1],m=a[2],n,e),e.point(p,h)}function x(){g.point=y,e.lineEnd()}function b(){v(),g.point=w,g.lineEnd=T}function w(t,e){_(r=t,e),i=p,a=h,o=f,l=d,u=m,g.point=_}function T(){s(p,h,c,f,d,m,i,a,r,o,l,u,n,e),g.lineEnd=x,x()}return g}function s(n,i,a,o,l,u,c,p,h,f,d,m,g,y){var _=c-n,x=p-i,b=_*_+x*x;if(b>4*e&&g--){var w=o+f,T=l+d,k=u+m,A=Math.sqrt(w*w+T*T+k*k),M=Math.asin(k/=A),S=v(v(k)-1)<kt||v(a-h)<kt?(a+h)/2:Math.atan2(T,w),C=t(S,M),L=C[0],E=C[1],I=L-n,z=E-i,P=x*I-_*z;(P*P/b>e||v((_*I+x*z)/b-.5)>.3||o*f+l*d+u*m<r)&&(s(n,i,a,o,l,u,L,E,S,w/=A,T/=A,k,g,y),y.point(L,E),s(L,E,S,w,T,k,c,p,h,f,d,m,g,y))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function Mn(t){var e=An((function(e,r){return t([e*It,r*It])}));return function(t){return In(e(t))}}function Sn(t){this.stream=t}function Cn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ln(t){return En((function(){return t}))()}function En(e){var r,n,i,a,o,s,l=An((function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]})),u=150,c=480,p=250,h=0,f=0,d=0,m=0,g=0,y=tn,v=E,_=null,x=null;function b(t){return[(t=i(t[0]*Et,t[1]*Et))[0]*u+a,o-t[1]*u]}function w(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*It,t[1]*It]}function T(){i=Zr(n=Dn(d,m,g),r);var t=r(h,f);return a=c-t[0]*u,o=p+t[1]*u,k()}function k(){return s&&(s.valid=!1,s=null),b}return b.stream=function(t){return s&&(s.valid=!1),(s=In(y(n,l(v(t))))).valid=!0,s},b.clipAngle=function(t){return arguments.length?(y=null==t?(_=t,tn):en((_=+t)*Et),k()):_},b.clipExtent=function(t){return arguments.length?(x=t,v=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):E,k()):x},b.scale=function(t){return arguments.length?(u=+t,T()):u},b.translate=function(t){return arguments.length?(c=+t[0],p=+t[1],T()):[c,p]},b.center=function(t){return arguments.length?(h=t[0]%360*Et,f=t[1]%360*Et,T()):[h*It,f*It]},b.rotate=function(t){return arguments.length?(d=t[0]%360*Et,m=t[1]%360*Et,g=t.length>2?t[2]%360*Et:0,T()):[d*It,m*It,g*It]},t.rebind(b,l,"precision"),function(){return r=e.apply(this,arguments),b.invert=r.invert&&w,T()}}function In(t){return Cn(t,(function(e,r){t.point(e*Et,r*Et)}))}function zn(t,e){return[t,e]}function Pn(t,e){return[t>Mt?t-St:t<-Mt?t+St:t,e]}function Dn(t,e,r){return t?e||r?Zr(Rn(t),Fn(e,r)):Rn(t):e||r?Fn(e,r):Pn}function On(t){return function(e,r){return[(e+=t)>Mt?e-St:e<-Mt?e+St:e,r]}}function Rn(t){var e=On(t);return e.invert=On(-t),e}function Fn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),Ot(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),Ot(c*r-s*n)]},o}function Bn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Nn(r,i),a=Nn(r,a),(o>0?i<a:i>a)&&(i+=o*St)):(i=t+o*St,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Fr([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function Nn(t,e){var r=Ir(e);r[0]-=t,Rr(r);var n=Dt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function Un(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map((function(e){return[t,e]}))}}function jn(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map((function(e){return[e,t]}))}}function Vn(t){return t.source}function qn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(fn)),sn},s.centroid=function(e){return _r=xr=br=wr=Tr=kr=Ar=Mr=Sr=0,t.geo.stream(e,n(_n)),Sr?[Ar/Sr,Mr/Sr]:kr?[wr/kr,Tr/kr]:br?[_r/br,xr/br]:[NaN,NaN]},s.bounds=function(e){return pn=hn=-(un=cn=1/0),t.geo.stream(e,n(mn)),[[un,cn],[pn,hn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||Mn(t):E,l()):e},s.context=function(t){return arguments.length?(i=null==(r=t)?new gn:new kn(t),"function"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Sn(e);for(var n in t)r[n]=t[n];return r}}},Sn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Ln,t.geo.projectionMutator=En,(t.geo.equirectangular=function(){return Ln(zn)}).raw=zn.invert=zn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Et,e[1]*Et))[0]*=It,e[1]*=It,e}return t=Dn(t[0]%360*Et,t[1]*Et,t.length>2?t[2]*Et:0),e.invert=function(e){return(e=t.invert(e[0]*Et,e[1]*Et))[0]*=It,e[1]*=It,e},e},Pn.invert=zn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Dn(-t[0]*Et,-t[1]*Et,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=It,t[1]*=It}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Bn((t=+r)*Et,n*Et),i):t},i.precision=function(r){return arguments.length?(e=Bn(t*Et,(n=+r)*Et),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Et,i=t[1]*Et,a=e[1]*Et,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),p=Math.cos(a);return Math.atan2(Math.sqrt((r=p*o)*r+(r=u*c-l*p*s)*r),l*c+u*p*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,p,h,f=10,d=f,m=90,g=360,y=2.5;function _(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(i/m)*m,n,m).map(p).concat(t.range(Math.ceil(l/g)*g,s,g).map(h)).concat(t.range(Math.ceil(r/f)*f,e,f).filter((function(t){return v(t%m)>kt})).map(u)).concat(t.range(Math.ceil(o/d)*d,a,d).filter((function(t){return v(t%g)>kt})).map(c))}return _.lines=function(){return x().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(h(s).slice(1),p(n).reverse().slice(1),h(l).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.majorExtent(t).minorExtent(t):_.minorExtent()},_.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),_.precision(y)):[[i,l],[n,s]]},_.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),_.precision(y)):[[r,o],[e,a]]},_.step=function(t){return arguments.length?_.majorStep(t).minorStep(t):_.minorStep()},_.majorStep=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.minorStep=function(t){return arguments.length?(f=+t[0],d=+t[1],_):[f,d]},_.precision=function(t){return arguments.length?(y=+t,u=Un(o,a,90),c=jn(r,e,y),p=Un(l,s,90),h=jn(i,n,y),_):y},_.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=Vn,i=qn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Et,n=t[1]*Et,i=e[0]*Et,a=e[1]*Et,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),p=o*Math.sin(r),h=l*Math.cos(i),f=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Ft(a-n)+o*l*Ft(i-r))),m=1/Math.sin(d),(g=d?function(t){var e=Math.sin(t*=d)*m,r=Math.sin(d-t)*m,n=r*c+e*h,i=r*p+e*f,a=r*s+e*u;return[Math.atan2(i,n)*It,Math.atan2(a,Math.sqrt(n*n+i*i))*It]}:function(){return[r*It,n*It]}).distance=d,g;var r,n,i,a,o,s,l,u,c,p,h,f,d,m,g},t.geo.length=function(e){return vn=0,t.geo.stream(e,Hn),vn};var Hn={sphere:D,point:D,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Et),o=Math.cos(i),s=v((n*=Et)-t),l=Math.cos(s);vn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Et,e=Math.sin(a*=Et),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=D}},lineEnd:D,polygonStart:D,polygonEnd:D};function Zn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Gn=Zn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Ln(Gn)}).raw=Gn;var Xn=Zn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),E);function Wn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Mt/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Jn;function o(t,e){a>0?e<-Lt+kt&&(e=-Lt+kt):e>Lt-kt&&(e=Lt-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=zt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Lt]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(v(n)<kt)return zn;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-zt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return Ln(Xn)}).raw=Xn,(t.geo.conicConformal=function(){return an(Wn)}).raw=Wn,(t.geo.conicEquidistant=function(){return an(Yn)}).raw=Yn;var Kn=Zn((function(t){return 1/t}),Math.atan);function Jn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function Qn(t){var e,r=Ln(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=Mt*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Ln(Kn)}).raw=Kn,Jn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Lt]},(t.geo.mercator=function(){return Qn(Jn)}).raw=Jn;var $n=Zn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Ln($n)}).raw=$n;var ti=Zn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function ei(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function ri(t){return t[0]}function ni(t){return t[1]}function ii(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&Pt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ai(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Ln(ti)}).raw=ti,ei.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Lt]},(t.geo.transverseMercator=function(){var t=Qn(ei),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ei,t.geom={},t.geom.hull=function(t){var e=ri,r=ni;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=de(e),a=de(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(ai),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=ii(s),c=ii(l),p=c[0]===u[0],h=c[c.length-1]===u[u.length-1],f=[];for(n=u.length-1;n>=0;--n)f.push(t[s[u[n]][2]]);for(n=+p;n<c.length-h;++n)f.push(t[s[c[n]][2]]);return f}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return j(t,oi),t};var oi=t.geom.polygon.prototype=[];function si(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function li(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,p=n[1]-u,h=(s*(l-u)-p*(i-a))/(p*o-s*c);return[i+h*o,l+h*c]}function ui(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}oi.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},oi.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},oi.clip=function(t){for(var e,r,n,i,a,o,s=ui(t),l=-1,u=this.length-ui(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)si(o=e[r],c,i)?(si(a,c,i)||t.push(li(a,o,c,i)),t.push(o)):si(a,c,i)&&t.push(li(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var ci,pi,hi,fi,di,mi=[],gi=[];function yi(){Ri(this),this.edge=this.site=this.circle=null}function vi(t){var e=mi.pop()||new yi;return e.site=t,e}function _i(t){Ci(t),hi.remove(t),mi.push(t),Ri(t)}function xi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];_i(t);for(var l=a;l.circle&&v(r-l.circle.x)<kt&&v(n-l.circle.cy)<kt;)a=l.P,s.unshift(l),_i(l),l=a;s.unshift(l),Ci(l);for(var u=o;u.circle&&v(r-u.circle.x)<kt&&v(n-u.circle.cy)<kt;)o=u.N,s.push(u),_i(u),u=o;s.push(u),Ci(u);var c,p=s.length;for(c=1;c<p;++c)u=s[c],l=s[c-1],Pi(u.edge,l.site,u.site,i);l=s[0],(u=s[p-1]).edge=Ii(l.site,u.site,null,i),Si(l),Si(u)}function bi(t){for(var e,r,n,i,a=t.x,o=t.y,s=hi._;s;)if((n=wi(s,o)-a)>kt)s=s.L;else{if(!((i=a-Ti(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=vi(t);if(hi.insert(e,l),e||r){if(e===r)return Ci(e),r=vi(e.site),hi.insert(l,r),l.edge=r.edge=Ii(e.site,l.site),Si(e),void Si(r);if(r){Ci(e),Ci(r);var u=e.site,c=u.x,p=u.y,h=t.x-c,f=t.y-p,d=r.site,m=d.x-c,g=d.y-p,y=2*(h*g-f*m),v=h*h+f*f,_=m*m+g*g,x={x:(g*v-f*_)/y+c,y:(h*_-m*v)/y+p};Pi(r.edge,u,d,x),l.edge=Ii(u,t,null,x),r.edge=Ii(t,d,null,x),Si(e),Si(r)}else l.edge=Ii(e.site,l.site)}}function wi(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,p=1/a-1/u,h=c/u;return p?(-h+Math.sqrt(h*h-2*p*(c*c/(-2*u)-l+u/2+i-a/2)))/p+n:(n+s)/2}function Ti(t,e){var r=t.N;if(r)return wi(r,e);var n=t.site;return n.y===e?n.x:1/0}function ki(t){this.site=t,this.edges=[]}function Ai(t,e){return e.angle-t.angle}function Mi(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Si(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,p=2*(l*(g=a.y-s)-u*c);if(!(p>=-At)){var h=l*l+u*u,f=c*c+g*g,d=(g*h-u*f)/p,m=(l*f-c*h)/p,g=m+s,y=gi.pop()||new Mi;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,t.circle=y;for(var v=null,_=di._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}di.insert(v,y),v||(fi=y)}}}}function Ci(t){var e=t.circle;e&&(e.P||(fi=e.N),di.remove(e),gi.push(e),Ri(e),t.circle=null)}function Li(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,p=t.r,h=c.x,f=c.y,d=p.x,m=p.y,g=(h+d)/2,y=(f+m)/2;if(m===f){if(g<o||g>=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y<l)return}else a={x:g,y:u};r={x:g,y:l}}}else if(i=y-(n=(h-d)/(m-f))*g,n<-1||n>1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(f<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function Ei(t,e){this.l=t,this.r=e,this.a=this.b=null}function Ii(t,e,r,n){var i=new Ei(t,e);return ci.push(i),r&&Pi(i,t,e,r),n&&Pi(i,e,t,n),pi[t.i].edges.push(new Di(i,t,e)),pi[e.i].edges.push(new Di(i,e,t)),i}function zi(t,e,r){var n=new Ei(t,null);return n.a=e,n.b=r,ci.push(n),n}function Pi(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Di(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function Oi(){this._=null}function Ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fi(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Bi(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ni(t){for(;t.L;)t=t.L;return t}function Ui(t,e){var r,n,i,a=t.sort(ji).pop();for(ci=[],pi=new Array(t.length),hi=new Oi,di=new Oi;;)if(i=fi,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(pi[a.i]=new ki(a),bi(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;xi(i.arc)}e&&(function(t){for(var e,r=ci,n=rn(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Li(e=r[i],t)||!n(e)||v(e.a.x-e.b.x)<kt&&v(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,u,c,p=t[0][0],h=t[1][0],f=t[0][1],d=t[1][1],m=pi,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(c=s[o].end()).x,i=c.y,e=(u=s[++o%l].start()).x,r=u.y,(v(n-e)>kt||v(i-r)>kt)&&(s.splice(o,0,new Di(zi(a.site,c,v(n-p)<kt&&d-i>kt?{x:p,y:v(e-p)<kt?r:d}:v(i-d)<kt&&h-n>kt?{x:v(r-d)<kt?e:h,y:d}:v(n-h)<kt&&i-f>kt?{x:h,y:v(e-h)<kt?r:f}:v(i-f)<kt&&n-p>kt?{x:v(r-f)<kt?e:p,y:f}:null),a.site,null)),++l)}(e));var o={cells:pi,edges:ci};return hi=di=ci=pi=null,o}function ji(t,e){return e.y-t.y||e.x-t.x}ki.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Ai),e.length},Di.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Oi.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Ni(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(Fi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Bi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(Bi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fi(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?Ni(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Fi(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Bi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Fi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Bi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Fi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Bi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ri,r=ni,n=e,i=r,a=Vi;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return Ui(s(t),a).cells.forEach((function(a,s){var l=a.edges,u=a.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):u.x>=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}}))}return o.links=function(t){return Ui(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return Ui(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Ai),c=-1,p=u.length,h=u[p-1].edge,f=h.l===l?h.r:h.l;++c<p;)h,i=f,f=(h=u[c].edge).l===l?h.r:h.l,n<i.i&&n<f.i&&(o=i,s=f,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[f.i]])})),e},o.x=function(t){return arguments.length?(n=de(e=t),o):e},o.y=function(t){return arguments.length?(i=de(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Vi:t,o):a===Vi?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Vi?null:a&&a[1]},o};var Vi=[[-1e6,-1e6],[1e6,1e6]];function qi(t){return t.x}function Hi(t){return t.y}function Zi(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&Zi(t,l[0],r,n,o,s),l[1]&&Zi(t,l[1],o,n,i,s),l[2]&&Zi(t,l[2],r,s,o,a),l[3]&&Zi(t,l[3],o,s,i,a)}}function Gi(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,p,h,f){if(!(c>a||p>o||h<n||f<i)){if(d=u.point){var d,m=e-u.x,g=r-u.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=e-v,i=r-v,a=e+v,o=r+v,s=d}}for(var _=u.nodes,x=.5*(c+h),b=.5*(p+f),w=(r>=b)<<1|e>=x,T=w+4;w<T;++w)if(u=_[3&w])switch(3&w){case 0:t(u,c,p,x,b);break;case 1:t(u,x,p,h,b);break;case 2:t(u,c,b,x,f);break;case 3:t(u,x,b,h,f)}}}(t,n,i,a,o),s}function Xi(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return"#"+se(Math.round(n+o*t))+se(Math.round(i+s*t))+se(Math.round(a+l*t))}}function Wi(t,e){var r,n={},i={};for(r in t)r in e?n[r]=$i(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function Yi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ki(t,e){var r,n,i,a=Ji.lastIndex=Qi.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=Ji.exec(t))&&(n=Qi.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Yi(r,n)})),a=Qi.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=ri,s=ni;if(a=arguments.length)return o=qi,s=Hi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,u,c,p,h,f,d,m,g,y=de(o),_=de(s);if(null!=e)f=e,d=r,m=n,g=i;else if(m=g=-(f=d=1/0),u=[],c=[],h=t.length,a)for(p=0;p<h;++p)(l=t[p]).x<f&&(f=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(p=0;p<h;++p){var x=+y(l=t[p],p),b=+_(l,p);x<f&&(f=x),b<d&&(d=b),x>m&&(m=x),b>g&&(g=b),u.push(x),c.push(b)}var w=m-f,T=g-d;function k(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)A(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,p=n>=u,h=p<<1|c;t.leaf=!1,c?i=l:o=l,p?a=u:s=u,k(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=f+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+y(t,++p),+_(t,p),f,d,m,g)},visit:function(t){Zi(t,M,f,d,m,g)},find:function(t){return Gi(M,t[0],t[1],f,d,m,g)}};if(p=-1,null==e){for(;++p<h;)k(M,t[p],u[p],c[p],f,d,m,g);--p}else t.forEach(M.add);return u=c=t=l=null,M}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=Xi,t.interpolateObject=Wi,t.interpolateNumber=Yi,t.interpolateString=Ki;var Ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qi=new RegExp(Ji.source,"g");function $i(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function ta(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push($i(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=$i,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?fe.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Xi:Ki:e instanceof Vt?Xi:Array.isArray(e)?ta:"object"===r&&isNaN(e)?Wi:Yi)(t,e)}],t.interpolateArray=ta;var ea=function(){return E},ra=t.map({linear:ea,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return sa},cubic:function(){return la},sin:function(){return ca},exp:function(){return pa},circle:function(){return ha},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/St*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*St/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return fa}}),na=t.map({in:E,out:aa,"in-out":oa,"out-in":function(t){return oa(aa(t))}});function ia(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function aa(t){return function(e){return 1-t(1-e)}}function oa(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function sa(t){return t*t}function la(t){return t*t*t}function ua(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ca(t){return 1-Math.cos(t*Lt)}function pa(t){return Math.pow(2,10*(t-1))}function ha(t){return 1-Math.sqrt(1-t*t)}function fa(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function da(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ma(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=ya(i),s=ga(i,a),l=ya(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*It,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*It:0}function ga(t,e){return t[0]*e[0]+t[1]*e[1]}function ya(t){var e=Math.sqrt(ga(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=ra.get(n)||ea,ia((i=na.get(i)||E)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Zt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=da,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ma(e?e.matrix:va)})(e)},ma.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var va={a:1,b:0,c:0,d:1,e:0,f:0};function _a(t){return t.length?t.pop()+",":""}function xa(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Yi(t[0],e[0])},{i:i-2,x:Yi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(_a(r)+"rotate(",null,")")-2,x:Yi(t,e)})):e&&r.push(_a(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(_a(r)+"skewX(",null,")")-2,x:Yi(t,e)}):e&&r.push(_a(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(_a(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Yi(t[0],e[0])},{i:i-2,x:Yi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(_a(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}function ba(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function wa(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Ta(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ka(t),n=ka(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function ka(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function Aa(t){t.fixed|=2}function Ma(t){t.fixed&=-7}function Sa(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ca(t){t.fixed&=-5}t.interpolateTransform=xa,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Ta(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},u=0;function c(){var l,c,h,f,d,m={},g=[],y=t.range(i),v=[];for(e=[],r=[],l=0,f=-1;++f<i;){for(c=0,d=-1;++d<i;)c+=n[f][d];g.push(c),v.push(t.range(i)),l+=c}for(a&&y.sort((function(t,e){return a(g[t],g[e])})),o&&v.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(St-u*i)/l,c=0,f=-1;++f<i;){for(h=c,d=-1;++d<i;){var _=y[f],x=v[_][d],b=n[_][x],w=c,T=c+=b*l;m[_+"-"+x]={index:_,subindex:x,startAngle:w,endAngle:T,value:b}}r[_]={index:_,startAngle:h,endAngle:c,value:g[_]},c+=u}for(f=-1;++f<i;)for(d=f-1;++d<i;){var k=m[f+"-"+d],A=m[d+"-"+f];(k.value||A.value)&&e.push(k.value<A.value?{source:A,target:k}:{source:k,target:A})}s&&p()}function p(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&p(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),u=[1,1],c=.9,p=La,h=Ea,f=-30,d=Ia,m=.1,g=.64,y=[],v=[];function _(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/g<l){if(l<d){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<d){u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,p,h,d,g,x,b,w,T=y.length,k=v.length;for(s=0;s<k;++s)h=(p=v[s]).source,(g=(b=(d=p.target).x-h.x)*b+(w=d.y-h.y)*w)&&(b*=g=n*a[s]*((g=Math.sqrt(g))-i[s])/g,w*=g,d.x-=b*(x=h.weight+d.weight?h.weight/(h.weight+d.weight):.5),d.y-=w*x,h.x+=b*(x=1-x),h.y+=w*x);if((x=n*m)&&(b=u[0]/2,w=u[1]/2,s=-1,x))for(;++s<T;)(p=y[s]).x+=(b-p.x)*x,p.y+=(w-p.y)*x;if(f)for(!function t(e,r,n){var i=0,a=0;if(e.charge=0,!e.leaf)for(var o,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(o=s[u])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=r*n[e.point.index];e.charge+=e.pointCharge=c,i+=c*e.point.x,a+=c*e.point.y}e.cx=i/e.charge,e.cy=a/e.charge}(r=t.geom.quadtree(y),n,o),s=-1;++s<T;)(p=y[s]).fixed||r.visit(_(p));for(s=-1;++s<T;)(p=y[s]).fixed?(p.x=p.px,p.y=p.py):(p.x-=(p.px-(p.px=p.x))*c,p.y-=(p.py-(p.py=p.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(v=t,s):v},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=we(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,c=u[0],d=u[1];for(t=0;t<n;++t)(r=y[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=v[t]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=y[t],isNaN(r.x)&&(r.x=m("x",c)),isNaN(r.y)&&(r.y=m("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof p)for(t=0;t<l;++t)i[t]=+p.call(this,v[t],t);else for(t=0;t<l;++t)i[t]=p;if(a=[],"function"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,v[t],t);else for(t=0;t<l;++t)a[t]=h;if(o=[],"function"==typeof f)for(t=0;t<n;++t)o[t]=+f.call(this,y[t],t);else for(t=0;t<n;++t)o[t]=f;function m(r,i){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var a=v[u];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(E).on("dragstart.force",Aa).on("drag.force",x).on("dragend.force",Ma)),!arguments.length)return r;this.on("mouseover.force",Sa).on("mouseout.force",Ca).call(r)},t.rebind(s,l,"on")};var La=20,Ea=1,Ia=1/0;function za(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Ba,e}function Pa(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function Da(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function Oa(t){return t.children}function Ra(t){return t.value}function Fa(t,e){return e.value-t.value}function Ba(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=Fa,e=Oa,r=Ra;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=e.call(n,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Da(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Pa(t,(function(t){t.children&&(t.value=0)})),Da(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},za(n,e)},t.layout.pie=function(){var e=Number,r=Na,n=0,i=St,a=0;function o(s){var l,u=s.length,c=s.map((function(t,r){return+e.call(o,t,r)})),p=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof i?i.apply(this,arguments):i)-p,f=Math.min(Math.abs(h)/u,+("function"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),m=t.sum(c),g=m?(h-u*d)/m:0,y=t.range(u),v=[];return null!=r&&y.sort(r===Na?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),y.forEach((function(t){v[t]={data:s[t],value:l=c[t],startAngle:p,endAngle:p+=l*g+d,padAngle:f}})),v}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var Na={};function Ua(t){return t.x}function ja(t){return t.y}function Va(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=E,r=Za,n=Ga,i=Va,a=Ua,o=ja;function s(l,u){if(!(f=l.length))return l;var c=l.map((function(t,r){return e.call(s,t,r)})),p=c.map((function(t){return t.map((function(t,e){return[a.call(s,t,e),o.call(s,t,e)]}))})),h=r.call(s,p,u);c=t.permute(c,h),p=t.permute(p,h);var f,d,m,g,y=n.call(s,p,u),v=c[0].length;for(m=0;m<v;++m)for(i.call(s,c[0][m],g=y[m],p[0][m][1]),d=1;d<f;++d)i.call(s,c[d][m],g+=p[d-1][m][1],p[d][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:qa.get(t)||Za,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Ha.get(t)||Ga,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var qa=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(Xa),o=e.map(Wa),s=t.range(i).sort((function(t,e){return a[t]-a[e]})),l=0,u=0,c=[],p=[];for(r=0;r<i;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],p.push(n));return p.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:Za}),Ha=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,p=t[0],h=p.length,f=[];for(f[0]=l=u=0,r=1;r<h;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=p[r][0]-p[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}f[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<h;++r)f[r]-=u;return f},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:Ga});function Za(e){return t.range(e.length)}function Ga(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Xa(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function Wa(t){return t.reduce(Ya,0)}function Ya(t,e){return t+e[1]}function Ka(t,e){return Ja(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ja(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Qa(e){return[t.min(e),t.max(e)]}function $a(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function no(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,p=1/0,h=-1/0;if(e.forEach(io),(r=e[0]).x=-r.r,r.y=0,_(r),l>1&&((n=e[1]).x=n.r,n.y=0,_(n),l>2))for(oo(r,n,i=e[2]),_(i),to(r,i),r._pack_prev=i,to(i,n),n=r._pack_next,a=3;a<l;a++){oo(r,n,i=e[a]);var f=0,d=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(ro(o,i)){f=1;break}if(1==f)for(s=r._pack_prev;s!==o._pack_prev&&!ro(s,i);s=s._pack_prev,m++);f?(d<m||d==m&&n.r<r.r?eo(r,n=o):eo(r=s,n),a--):(to(r,i),n=i,_(i))}var g=(u+c)/2,y=(p+h)/2,v=0;for(a=0;a<l;a++)(i=e[a]).x-=g,i.y-=y,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=v,e.forEach(ao)}function _(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),p=Math.min(t.y-t.r,p),h=Math.max(t.y+t.r,h)}}function io(t){t._pack_next=t._pack_prev=t}function ao(t){delete t._pack_next,delete t._pack_prev}function oo(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function so(t,e){return t.parent==e.parent?1:2}function lo(t){var e=t.children;return e.length?e[0]:t.t}function uo(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function co(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function po(t,e,r){return t.a.parent===e.parent?t.a:r}function ho(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function fo(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function mo(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function go(t){return t.rangeExtent?t.rangeExtent():mo(t.range())}function yo(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function vo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function _o(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xo}t.layout.histogram=function(){var e=!0,r=Number,n=Qa,i=Ka;function a(a,o){for(var s,l,u=[],c=a.map(r,this),p=n.call(this,c,o),h=i.call(this,p,c,o),f=(o=-1,c.length),d=h.length-1,m=e?1:1/f;++o<d;)(s=u[o]=[]).dx=h[o+1]-(s.x=h[o]),s.y=0;if(d>0)for(o=-1;++o<f;)(l=c[o])>=p[0]&&l<=p[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=m,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=de(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Ja(e,t)}:de(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort($a),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Da(s,(function(t){t.r=+c(t.value)})),Da(s,no),n){var p=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Da(s,(function(t){t.r+=p})),Da(s,no),Da(s,(function(t){t.r-=p}))}return function t(e,r,n,i){var a=e.children;if(e.x=r+=i*e.x,e.y=n+=i*e.y,e.r*=i,a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},za(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],i=null;function a(t,a){var u=e.call(this,t,a),c=u[0],p=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(c);if(Da(p,o),p.parent.m=-p.z,Pa(p,s),i)Pa(c,l);else{var h=c,f=c,d=c;Pa(c,(function(t){t.x<h.x&&(h=t),t.x>f.x&&(f=t),t.depth>d.depth&&(d=t)}));var m=r(h,f)/2-h.x,g=n[0]/(f.x+r(f,h)/2+m),y=n[1]/(d.depth||1);Pa(c,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,p=s.m,h=l.m;s=uo(s),a=lo(a),s&&a;)l=lo(l),(o=uo(o)).a=t,(i=s.z+p-a.z-u+r(s._,a._))>0&&(co(po(s,t,n),t,i),u+=i,c+=i),p+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!uo(o)&&(o.t=s,o.m+=p-c),a&&!lo(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},za(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;Da(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var p=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),f=p.x-r(p,h)/2,d=h.x+r(h,p)/2;return Da(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},za(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=ho,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function p(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],u=e.slice(),h=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(c(u,a.dx*a.dy/t.value),s.area=0;(i=u.length)>0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(p)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function f(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++o<s;)(a=t[o]).x=l,a.y=u,a.dy=c,l+=a.dx=Math.min(r.x+r.dx-l,c?n(a.area/c):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++o<s;)(a=t[o]).x=l,a.y=u,a.dx=c,u+=a.dy=Math.min(r.y+r.dy-u,c?n(a.area/c):0);a.z=!1,a.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),c([a],a.dx*a.dy/a.value),(e?h:p)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){if(!arguments.length)return a;function e(e){var r=t.call(m,e,e.depth);return null==r?ho(e):fo(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return fo(e,t)}var n;return o=null==(a=t)?ho:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(u=t,m):u},m.mode=function(t){return arguments.length?(l=t+"",m):l},za(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var xo={floor:E,ceil:E};function bo(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function wo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function To(t,e){return vo(t,_o(ko(t,e)[2])),vo(t,_o(ko(t,e)[2])),t}function ko(t,e){null==e&&(e=10);var r=mo(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Ao(e,r){return t.range.apply(t,ko(e,r))}function Mo(e,r,n){var i=ko(e,r);if(n){var a=Le.exec(n);if(a.shift(),"s"===a[8]){var o=t.formatPrefix(Math.max(v(i[0]),v(i[1])));return a[7]||(a[7]="."+Co(o.scale(i[2]))),a[8]="f",n=t.format(a.join("")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]="."+function(t,e){var r=Co(e[2]);return t in So?Math.abs(r-Co(Math.max(v(e[0]),v(e[1]))))+ +("e"!==t):r-2*("%"===t)}(a[8],i)),n=a.join("")}else n=",."+Co(i[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?bo:yo,s=i?wa:ba;return a=t(e,r,s,n),o=t(r,e,s,$i),l}function l(t){return a(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(da)},l.clamp=function(t){return arguments.length?(i=t,s()):i},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return Ao(e,t)},l.tickFormat=function(t,r){return Mo(e,t,r)},l.nice=function(t){return To(e,t),s()},l.copy=function(){return t(e,r,n,i)},s()}([0,1],[0,1],$i,!1)};var So={s:1,g:1,p:1,r:1,e:1};function Co(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a},l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n},l.nice=function(){var t=vo(a.map(o),i?Math:Eo);return r.domain(t),a=t.map(s),l},l.ticks=function(){var t=mo(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),p=n%1?2:n;if(isFinite(c-u)){if(i){for(;u<c;u++)for(var h=1;h<p;h++)e.push(s(u)*h);e.push(s(u))}else for(e.push(s(u));u++<c;)for(h=p-1;h>0;h--)e.push(s(u)*h);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>l;c--);e=e.slice(u,c)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Lo;arguments.length<2?r=Lo:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=i?r(t):""}},l.copy=function(){return e(r.copy(),n,i,a)},wo(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Lo=t.format(".0e"),Eo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Io(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Io(r),a=Io(1/r);function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n},o.ticks=function(t){return Ao(n,t)},o.tickFormat=function(t,e){return Mo(n,t,e)},o.nice=function(t){return o.domain(To(n,t))},o.exponent=function(t){return arguments.length?(i=Io(r=t),a=Io(1/r),e.domain(n.map(i)),o):r},o.copy=function(){return t(e.copy(),r,n)},wo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],i=new b;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)},s.range=function(t){return arguments.length?(a=t,o=0,n={t:"range",a:arguments},s):a},s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=(i+u)/2,0):(u-i)/(r.length-1+e);return a=l(i+c*e/2,c),o=0,n={t:"rangePoints",a:arguments},s},s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=u=Math.round((i+u)/2),0):(u-i)/(r.length-1+e)|0;return a=l(i+Math.round(c*e/2+(u-i-(r.length-1+e)*c)/2),c),o=0,n={t:"rangeRoundPoints",a:arguments},s},s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],p=t[1-u],h=(p-c)/(r.length-e+2*i);return a=l(c+h*i,h),u&&a.reverse(),o=h*(1-e),n={t:"rangeBands",a:arguments},s},s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],p=t[1-u],h=Math.floor((p-c)/(r.length-e+2*i));return a=l(c+Math.round((p-c-(r.length-e)*h)/2),h),u&&a.reverse(),o=Math.round(h*(1-e)),n={t:"rangeRoundBands",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return mo(n.a[0])},s.copy=function(){return e(r,n)},s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(zo)},t.scale.category20=function(){return t.scale.ordinal().range(Po)},t.scale.category20b=function(){return t.scale.ordinal().range(Do)},t.scale.category20c=function(){return t.scale.ordinal().range(Oo)};var zo=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ae),Po=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ae),Do=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ae),Oo=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ae);function Ro(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}return o.domain=function(t){return arguments.length?(r=t.map(f).filter(d).sort(h),a()):r},o.range=function(t){return arguments.length?(n=t,a()):n},o.quantiles=function(){return i},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]},o.range=function(t){return arguments.length?(n=t,s()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]},o.copy=function(){return t(e,r,n)},s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}return i.domain=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=t,i):n},i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},i.copy=function(){return e(r,n)},i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return Ao(e,t)},r.tickFormat=function(t,r){return Mo(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=Bo,e=No,r=Ro,n=Fo,i=Uo,a=jo,o=Vo;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=i.apply(this,arguments)-Lt,p=a.apply(this,arguments)-Lt,h=Math.abs(p-c),f=c>p?0:1;if(u<s&&(d=u,u=s,s=d),h>=Ct)return l(u,f)+(s?l(s,1-f):"")+"Z";var d,m,g,y,v,_,x,b,w,T,k,A,M=0,S=0,C=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===Fo?Math.sqrt(s*s+u*u):+n.apply(this,arguments),f||(S*=-1),u&&(S=Ot(g/u*Math.sin(y))),s&&(M=Ot(g/s*Math.sin(y)))),u){v=u*Math.cos(c+S),_=u*Math.sin(c+S),x=u*Math.cos(p-S),b=u*Math.sin(p-S);var L=Math.abs(p-c-2*S)<=Mt?0:1;if(S&&qo(v,_,x,b)===f^L){var E=(c+p)/2;v=u*Math.cos(E),_=u*Math.sin(E),x=b=null}}else v=_=0;if(s){w=s*Math.cos(p-M),T=s*Math.sin(p-M),k=s*Math.cos(c+M),A=s*Math.sin(c+M);var I=Math.abs(c-p+2*M)<=Mt?0:1;if(M&&qo(w,T,k,A)===1-f^I){var z=(c+p)/2;w=s*Math.cos(z),T=s*Math.sin(z),k=A=null}}else w=T=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s<u^f?0:1;var P=d,D=d;if(h<Mt){var O=null==k?[w,T]:null==x?[v,_]:li([v,_],[k,A],[x,b],[w,T]),R=v-O[0],F=_-O[1],B=x-O[0],N=b-O[1],U=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),j=Math.sqrt(O[0]*O[0]+O[1]*O[1]);D=Math.min(d,(s-j)/(U-1)),P=Math.min(d,(u-j)/(U+1))}if(null!=x){var V=Ho(null==k?[w,T]:[k,A],[v,_],u,P,f),q=Ho([x,b],[w,T],u,P,f);d===P?C.push("M",V[0],"A",P,",",P," 0 0,",m," ",V[1],"A",u,",",u," 0 ",1-f^qo(V[1][0],V[1][1],q[1][0],q[1][1]),",",f," ",q[1],"A",P,",",P," 0 0,",m," ",q[0]):C.push("M",V[0],"A",P,",",P," 0 1,",m," ",q[0])}else C.push("M",v,",",_);if(null!=k){var H=Ho([v,_],[k,A],s,-D,f),Z=Ho([w,T],null==x?[v,_]:[x,b],s,-D,f);d===D?C.push("L",Z[0],"A",D,",",D," 0 0,",m," ",Z[1],"A",s,",",s," 0 ",f^qo(Z[1][0],Z[1][1],H[1][0],H[1][1]),",",1-f," ",H[1],"A",D,",",D," 0 0,",m," ",H[0]):C.push("L",Z[0],"A",D,",",D," 0 0,",m," ",H[0])}else C.push("L",w,",",T)}else C.push("M",v,",",_),null!=x&&C.push("A",u,",",u," 0 ",L,",",f," ",x,",",b),C.push("L",w,",",T),null!=k&&C.push("A",s,",",s," 0 ",I,",",1-f," ",k,",",A);return C.push("Z"),C.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=de(e),s):t},s.outerRadius=function(t){return arguments.length?(e=de(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=de(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Fo?Fo:de(t),s):n},s.startAngle=function(t){return arguments.length?(i=de(t),s):i},s.endAngle=function(t){return arguments.length?(a=de(t),s):a},s.padAngle=function(t){return arguments.length?(o=de(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Lt;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Fo="auto";function Bo(t){return t.innerRadius}function No(t){return t.outerRadius}function Uo(t){return t.startAngle}function jo(t){return t.endAngle}function Vo(t){return t&&t.padAngle}function qo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function Ho(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,p=t[1]+u,h=e[0]+l,f=e[1]+u,d=(c+h)/2,m=(p+f)/2,g=h-c,y=f-p,v=g*g+y*y,_=r-n,x=c*f-h*p,b=(y<0?-1:1)*Math.sqrt(Math.max(0,_*_*v-x*x)),w=(x*y-g*b)/v,T=(-x*g-y*b)/v,k=(x*y+g*b)/v,A=(-x*g+y*b)/v,M=w-d,S=T-m,C=k-d,L=A-m;return M*M+S*S>C*C+L*L&&(w=k,T=A),[[w-l,T-u],[w*r/_,T*r/_]]}function Zo(t){var e=ri,r=ni,n=Gr,i=Xo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,p=a.length,h=de(e),f=de(r);function d(){l.push("M",i(t(u),o))}for(;++c<p;)n.call(this,s=a[c],c)?u.push([+h.call(this,s,c),+f.call(this,s,c)]):u.length&&(d(),u=[]);return u.length&&d(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a="function"==typeof t?i=t:(i=Go.get(t)||Xo).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Zo(E)};var Go=t.map({linear:Xo,"linear-closed":Wo,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];for(;++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&i.push("H",n[0]);return i.join("")},"step-before":Yo,"step-after":Ko,basis:$o,"basis-open":function(t){if(t.length<4)return Xo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(ts(ns,a)+","+ts(ns,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),is(r,a,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[ts(ns,o),",",ts(ns,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),is(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return $o(t)},cardinal:function(t,e){return t.length<3?Xo(t):t[0]+Jo(t,Qo(t,e))},"cardinal-open":function(t,e){return t.length<4?Xo(t):t[1]+Jo(t.slice(1,-1),Qo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Wo(t):t[0]+Jo((t.push(t[0]),t),Qo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Xo(t):t[0]+Jo(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=as(i,a);for(;++e<r;)n[e]=(o+(o=as(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=as(t[s],t[s+1]),v(e)<kt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Xo(t){return t.length>1?t.join("L"):t+"Z"}function Wo(t){return t.join("L")+"Z"}function Yo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Ko(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Jo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Xo(t);var r=t.length!=e.length,n="",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var c=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Qo(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function $o(t){if(t.length<3)return Xo(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",ts(ns,o),",",ts(ns,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),is(l,o,s);return t.pop(),l.push("L",n),l.join("")}function ts(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Go.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var es=[0,2/3,1/3,0],rs=[0,1/3,2/3,0],ns=[0,1/6,2/3,1/6];function is(t,e,r){t.push("C",ts(es,e),",",ts(es,r),",",ts(rs,e),",",ts(rs,r),",",ts(ns,e),",",ts(ns,r))}function as(t,e){return(e[1]-t[1])/(e[0]-t[0])}function os(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Lt,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function ss(t){var e=ri,r=ri,n=0,i=ni,a=Gr,o=Xo,s=o.key,l=o,u="L",c=.7;function p(s){var p,h,f,d=[],m=[],g=[],y=-1,v=s.length,_=de(e),x=de(n),b=e===r?function(){return h}:de(r),w=n===i?function(){return f}:de(i);function T(){d.push("M",o(t(g),c),u,l(t(m.reverse()),c),"Z")}for(;++y<v;)a.call(this,p=s[y],y)?(m.push([h=+_.call(this,p,y),f=+x.call(this,p,y)]),g.push([+b.call(this,p,y),+w.call(this,p,y)])):m.length&&(T(),m=[],g=[]);return m.length&&T(),d.length?d.join(""):null}return p.x=function(t){return arguments.length?(e=r=t,p):r},p.x0=function(t){return arguments.length?(e=t,p):e},p.x1=function(t){return arguments.length?(r=t,p):r},p.y=function(t){return arguments.length?(n=i=t,p):i},p.y0=function(t){return arguments.length?(n=t,p):n},p.y1=function(t){return arguments.length?(i=t,p):i},p.defined=function(t){return arguments.length?(a=t,p):a},p.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=Go.get(t)||Xo).key,l=o.reverse||o,u=o.closed?"M":"L",p):s},p.tension=function(t){return arguments.length?(c=t,p):c},p}function ls(t){return t.radius}function us(t){return[t.x,t.y]}function cs(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Lt;return[r*Math.cos(n),r*Math.sin(n)]}}function ps(){return 64}function hs(){return"circle"}function fs(t){var e=Math.sqrt(t/Mt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Zo(os);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Yo.reverse=Ko,Ko.reverse=Yo,t.svg.area=function(){return ss(E)},t.svg.area.radial=function(){var t=ss(os);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Vn,e=qn,r=ls,n=Uo,i=jo;function a(r,n){var i,a,u=o(this,t,r,n),c=o(this,e,r,n);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(a=c,((i=u).a0==a.a0&&i.a1==a.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z")}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),u=n.call(t,s,o)-Lt,c=i.call(t,s,o)-Lt;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=de(t),a):r},a.source=function(e){return arguments.length?(t=de(e),a):t},a.target=function(t){return arguments.length?(e=de(t),a):e},a.startAngle=function(t){return arguments.length?(n=de(t),a):n},a.endAngle=function(t){return arguments.length?(i=de(t),a):i},a},t.svg.diagonal=function(){var t=Vn,e=qn,r=us;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=de(e),n):t},n.target=function(t){return arguments.length?(e=de(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=us,n=e.projection;return e.projection=function(t){return arguments.length?n(cs(r=t)):r},e},t.svg.symbol=function(){var t=hs,e=ps;function r(r,n){return(ds.get(t.call(this,r,n))||fs)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=de(e),r):t},r.size=function(t){return arguments.length?(e=de(t),r):e},r};var ds=t.map({circle:fs,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*gs)),r=e*gs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ms),r=e*ms/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ms),r=e*ms/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ds.keys();var ms=Math.sqrt(3),gs=Math.tan(30*Et);G.transition=function(t){for(var e,r,n=xs||++Ts,i=Ms(t),a=[],o=bs||{time:Date.now(),ease:ua,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,p=u.length;++c<p;)(r=u[c])&&Ss(r,c,i,n,o),e.push(r)}return _s(a,i,n)},G.interrupt=function(t){return this.each(null==t?ys:vs(Ms(t)))};var ys=vs(Ms());function vs(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function _s(t,e,r){return j(t,ws),t.namespace=e,t.id=r,t}var xs,bs,ws=[],Ts=0;function ks(t,e,r,n){var i=t.id,a=t.namespace;return ct(t,"function"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function As(t){return null==t&&(t=""),function(){this.textContent=t}}function Ms(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ss(t,e,r,n,i){var a,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),p=c[n];function h(r){var i=c.active,h=c[i];for(var d in h&&(h.timer.c=null,h.timer.t=NaN,--c.count,delete c[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),c)if(+d<n){var m=c[d];m.timer.c=null,m.timer.t=NaN,--c.count,delete c[d]}o.c=f,we((function(){return o.c&&f(r||1)&&(o.c=null,o.t=NaN),1}),0,a),c.active=n,p.event&&p.event.start.call(t,t.__data__,e),u=[],p.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)})),l=p.ease,s=p.duration}function f(i){for(var a=i/s,o=l(a),h=u.length;h>0;)u[--h].call(t,o);if(a>=1)return p.event&&p.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}p||(a=i.time,o=we((function(t){var e=p.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h}),0,a),p=c[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}ws.call=G.call,ws.empty=G.empty,ws.node=G.node,ws.size=G.size,t.transition=function(e,r){return e&&e.transition?xs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ws,ws.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=X(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,p=u.length;++c<p;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),Ss(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return _s(o,a,i)},ws.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=W(t);for(var u=-1,c=this.length;++u<c;)for(var p=this[u],h=-1,f=p.length;++h<f;)if(n=p[h]){a=n[s][o],r=t.call(n,n.__data__,h,u),l.push(e=[]);for(var d=-1,m=r.length;++d<m;)(i=r[d])&&Ss(i,d,s,o,a),e.push(i)}return _s(l,s,o)},ws.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=lt(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return _s(n,this.namespace,this.id)},ws.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ct(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},ws.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?xa:$i,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function s(t){return null==t?a:(t+="",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})}function l(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}return ks(this,"attr."+e,r,i.local?l:s)},ws.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},ws.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=$i(i,e),function(e){this.style.setProperty(t,n(e),r)})})}return ks(this,"style."+t,e,a)},ws.styleTween=function(t,e,r){function n(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,n)},ws.text=function(t){return ks(this,"text",t,As)},ws.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},ws.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ct(this,(function(t){t[n][r].ease=e})))},ws.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ct(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},ws.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ct(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},ws.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=bs,o=xs;try{xs=n,ct(this,(function(t,r,a){bs=t[i][n],e.call(t,t.__data__,r,a)}))}finally{bs=a,xs=o}}else ct(this,(function(a){var o=a[i][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},ws.transition=function(){for(var t,e,r,n=this.id,i=++Ts,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,p=(u=this[s]).length;c<p;c++)(e=u[c])&&Ss(e,c,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return _s(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=Cs,a=6,o=6,s=3,l=[10],u=null;function c(n){n.each((function(){var n,c=t.select(this),p=this.__chart__||r,h=this.__chart__=r.copy(),f=null==u?h.ticks?h.ticks.apply(h,l):h.domain():u,d=null==e?h.tickFormat?h.tickFormat.apply(h,l):E:e,m=c.selectAll(".tick").data(f,h),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),y=t.transition(m.exit()).style("opacity",kt).remove(),v=t.transition(m.order()).style("opacity",1),_=Math.max(a,0)+s,x=go(h),b=c.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),t.transition(b));g.append("line"),g.append("text");var T,k,A,M,S=g.select("line"),C=v.select("line"),L=m.select("text").text(d),I=g.select("text"),z=v.select("text"),P="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=Es,T="x",A="y",k="x2",M="y2",L.attr("dy",P<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+P*o+"V0H"+x[1]+"V"+P*o)):(n=Is,T="y",A="x",k="y2",M="x2",L.attr("dy",".32em").style("text-anchor",P<0?"end":"start"),w.attr("d","M"+P*o+","+x[0]+"H0V"+x[1]+"H"+P*o)),S.attr(M,P*a),I.attr(A,P*_),C.attr(k,0).attr(M,P*a),z.attr(T,0).attr(A,P*_),h.rangeBand){var D=h,O=D.rangeBand()/2;p=h=function(t){return D(t)+O}}else p.rangeBand?p=h:y.call(n,h,p);g.call(n,p,h),v.call(n,h,h)}))}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(i=t in Ls?t+"":Cs,c):i},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],c):a},c.innerTickSize=function(t){return arguments.length?(a=+t,c):a},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var Cs="bottom",Ls={top:1,right:1,bottom:1,left:1};function Es(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function Is(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=N(h,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],u=!0,c=!0,p=Ps[0];function h(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(p,E);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return zs[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",h.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=go(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),a&&(o=go(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),f(s)}))}function f(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"}))}function d(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var p,g,y=this,v=t.select(t.event.target),_=n.of(y,arguments),x=t.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,T=!/^(e|w)$/.test(b)&&a,k=v.classed("extent"),A=xt(y),M=t.mouse(y),S=t.select(o(y)).on("keydown.brush",E).on("keyup.brush",I);if(t.event.changedTouches?S.on("touchmove.brush",z).on("touchend.brush",D):S.on("mousemove.brush",z).on("mouseup.brush",D),x.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var C=+/w$/.test(b),L=+/^n/.test(b);g=[s[1-C]-M[0],l[1-L]-M[1]],M[0]=s[C],M[1]=l[L]}else t.event.altKey&&(p=M.slice());function E(){32==t.event.keyCode&&(k||(p=null,M[0]-=s[1],M[1]-=l[1],k=2),F())}function I(){32==t.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,F())}function z(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(p||(p=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]<p[0])],M[1]=l[+(e[1]<p[1])]):p=null),w&&P(e,i,0)&&(d(x),r=!0),T&&P(e,a,1)&&(m(x),r=!0),r&&(f(x),_({type:"brush",mode:k?"move":"resize"}))}function P(t,n,i){var a,o,h=go(n),f=h[0],d=h[1],m=M[i],g=i?l:s,y=g[1]-g[0];if(k&&(f-=m,d-=y+m),a=(i?c:u)?Math.max(f,Math.min(d,t[i])):t[i],k?o=(a+=m)+y:(p&&(m=Math.max(f,Math.min(d,2*p[i]-a))),m<a?(o=a,a=m):o=m),g[0]!=a||g[1]!=o)return i?r=null:e=null,g[0]=a,g[1]=o,!0}function D(){z(),x.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),t.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),_({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",v.style("cursor")),_({type:"brushstart"}),z()}return h.event=function(i){i.each((function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,xs?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})})).tween("brush:brush",(function(){var t=ta(s,a.x),n=ta(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})})):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))}))},h.x=function(t){return arguments.length?(p=Ps[!(i=t)<<1|!a],h):i},h.y=function(t){return arguments.length?(p=Ps[!i<<1|!(a=t)],h):a},h.clamp=function(t){return arguments.length?(i&&a?(u=!!t[0],c=!!t[1]):i?u=!!t:a&&(c=!!t),h):i&&a?[u,c]:i?u:a?c:null},h.extent=function(t){var n,o,u,c,p;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(p=n,n=o,o=p),n==s[0]&&o==s[1]||(s=[n,o])),a&&(u=t[0],c=t[1],i&&(u=u[1],c=c[1]),r=[u,c],a.invert&&(u=a(u),c=a(c)),c<u&&(p=u,u=c,c=p),u==l[0]&&c==l[1]||(l=[u,c])),h):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(p=n,n=o,o=p))),a&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],a.invert&&(u=a.invert(u),c=a.invert(c)),c<u&&(p=u,u=c,c=p))),i&&a?[[n,u],[o,c]]:i?[n,o]:a&&[u,c])},h.clear=function(){return h.empty()||(s=[0,0],l=[0,0],e=r=null),h},h.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(h,n,"on")};var zs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ps=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ds=ze.format=sr.timeFormat,Os=Ds.utc,Rs=Os("%Y-%m-%dT%H:%M:%S.%LZ");function Fs(t){return t.toISOString()}function Bs(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(Us,i);return a==Us.length?[r.year,ko(e.map((function(t){return t/31536e6})),n)[2]]:a?r[i/Us[a-1]<Us[a]/i?a-1:a]:[qs,ko(e,n)[2]]}return i.invert=function(t){return Ns(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Ns)},i.nice=function(t,e){var r=i.domain(),n=mo(r),o=null==t?a(n,10):"number"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Ns(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(vo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Ns(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ns(+e+1);return e}}:t))},i.ticks=function(t,e){var r=mo(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ns(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Bs(e.copy(),r,n)},wo(i,e)}function Ns(t){return new Date(t)}Ds.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fs:Rs,Fs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fs.toString=Rs.toString,ze.second=Re((function(t){return new Pe(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),ze.seconds=ze.second.range,ze.seconds.utc=ze.second.utc.range,ze.minute=Re((function(t){return new Pe(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),ze.minutes=ze.minute.range,ze.minutes.utc=ze.minute.utc.range,ze.hour=Re((function(t){var e=t.getTimezoneOffset()/60;return new Pe(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),ze.hours=ze.hour.range,ze.hours.utc=ze.hour.utc.range,ze.month=Re((function(t){return(t=ze.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),ze.months=ze.month.range,ze.months.utc=ze.month.utc.range;var Us=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],js=[[ze.second,1],[ze.second,5],[ze.second,15],[ze.second,30],[ze.minute,1],[ze.minute,5],[ze.minute,15],[ze.minute,30],[ze.hour,1],[ze.hour,3],[ze.hour,6],[ze.hour,12],[ze.day,1],[ze.day,2],[ze.week,1],[ze.month,1],[ze.month,3],[ze.year,1]],Vs=Ds.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Gr]]),qs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ns)},floor:E,ceil:E};js.year=ze.year,ze.scale=function(){return Bs(t.scale.linear(),js,Vs)};var Hs=js.map((function(t){return[t[0].utc,t[1]]})),Zs=Os.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Gr]]);function Gs(t){return JSON.parse(t.responseText)}function Xs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Hs.year=ze.year.utc,ze.scale.utc=function(){return Bs(t.scale.linear(),Hs,Zs)},t.text=me((function(t){return t.responseText})),t.json=function(t,e){return ge(t,"application/json",Gs,e)},t.html=function(t,e){return ge(t,"text/html",Xs,e)},t.xml=me((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],17:[function(t,e,r){(function(n,i){(function(){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){m[a]=t,m[a+1]=e,2===(a+=2)&&(s?s(g):b())};var u="undefined"!=typeof window?window:void 0,c=u||{},p=c.MutationObserver||c.WebKitMutationObserver,h="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(g,1)}}var m=new Array(1e3);function g(){for(var t=0;t<a;t+=2){(0,m[t])(m[t+1]),m[t]=void 0,m[t+1]=void 0}a=0}var y,v,_,x,b=void 0;function w(t,e){var r=this,n=new this.constructor(A);void 0===n[k]&&O(n);var i=r._state;if(i){var a=arguments[i-1];l((function(){return P(i,n,a,r._result)}))}else I(r,n,t,e);return n}function T(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return S(e,t),e}h?b=function(){return n.nextTick(g)}:p?(v=0,_=new p(g),x=document.createTextNode(""),_.observe(x,{characterData:!0}),b=function(){x.data=v=++v%2}):f?((y=new MessageChannel).port1.onmessage=g,b=function(){return y.port2.postMessage(0)}):b=void 0===u&&"function"==typeof t?function(){try{var t=Function("return this")().require("vertx");return"undefined"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:d()}catch(t){return d()}}():d();var k=Math.random().toString(36).substring(2);function A(){}function M(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===T?function(t,e){1===e._state?L(t,e._result):2===e._state?E(t,e._result):I(e,void 0,(function(e){return S(t,e)}),(function(e){return E(t,e)}))}(t,r):void 0===n?L(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?S(t,r):L(t,r))}),(function(e){n||(n=!0,E(t,e))}),t._label);!n&&i&&(n=!0,E(t,i))}),t)}(t,r,n):L(t,r)}function S(t,e){if(t===e)E(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(n=e),null===n||"object"!==i&&"function"!==i)L(t,e);else{var r=void 0;try{r=e.then}catch(e){return void E(t,e)}M(t,e,r)}var n,i}function C(t){t._onerror&&t._onerror(t._result),z(t)}function L(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(z,t))}function E(t,e){void 0===t._state&&(t._state=2,t._result=e,l(C,t))}function I(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+1]=r,i[a+2]=n,0===a&&t._state&&l(z,t)}function z(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?P(r,n,i,a):i(a);t._subscribers.length=0}}function P(t,r,n,i){var a=e(n),o=void 0,s=void 0,l=!0;if(a){try{o=n(i)}catch(t){l=!1,s=t}if(r===o)return void E(r,new TypeError("A promises callback cannot return that same promise."))}else o=i;void 0!==r._state||(a&&l?S(r,o):!1===l?E(r,s):1===t?L(r,o):2===t&&E(r,o))}var D=0;function O(t){t[k]=D++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[k]||O(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&L(this.promise,this._result))):E(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===T){var i=void 0,a=void 0,o=!1;try{i=t.then}catch(t){o=!0,a=t}if(i===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===F){var s=new r(A);o?E(s,a):M(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===t?E(n,r):this._result[e]=r),0===this._remaining&&L(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;I(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var F=function(){function t(e){this[k]=D++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e((function(e){S(t,e)}),(function(e){E(t,e)}))}catch(e){E(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return e(t)?this.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return F.prototype.then=w,F.all=function(t){return new R(this,t).promise},F.race=function(t){var e=this;return r(t)?new e((function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},F.resolve=T,F.reject=function(t){var e=new this(A);return E(e,t),e},F._setScheduler=function(t){s=t},F._setAsap=function(t){l=t},F._asap=l,F.polyfill=function(){var t=void 0;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=F},F.Promise=F,F}))}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:65}],18:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":53}],19:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15];return t[0]=s*(h*y-f*g)-p*(l*y-u*g)+m*(l*f-u*h),t[1]=-(n*(h*y-f*g)-p*(i*y-a*g)+m*(i*f-a*h)),t[2]=n*(l*y-u*g)-s*(i*y-a*g)+m*(i*u-a*l),t[3]=-(n*(l*f-u*h)-s*(i*f-a*h)+p*(i*u-a*l)),t[4]=-(o*(h*y-f*g)-c*(l*y-u*g)+d*(l*f-u*h)),t[5]=r*(h*y-f*g)-c*(i*y-a*g)+d*(i*f-a*h),t[6]=-(r*(l*y-u*g)-o*(i*y-a*g)+d*(i*u-a*l)),t[7]=r*(l*f-u*h)-o*(i*f-a*h)+c*(i*u-a*l),t[8]=o*(p*y-f*m)-c*(s*y-u*m)+d*(s*f-u*p),t[9]=-(r*(p*y-f*m)-c*(n*y-a*m)+d*(n*f-a*p)),t[10]=r*(s*y-u*m)-o*(n*y-a*m)+d*(n*u-a*s),t[11]=-(r*(s*f-u*p)-o*(n*f-a*p)+c*(n*u-a*s)),t[12]=-(o*(p*g-h*m)-c*(s*g-l*m)+d*(s*h-l*p)),t[13]=r*(p*g-h*m)-c*(n*g-i*m)+d*(n*h-i*p),t[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+d*(n*l-i*s)),t[15]=r*(s*h-l*p)-o*(n*h-i*p)+c*(n*l-i*s),t}},{}],20:[function(t,e,r){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],21:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],22:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],23:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],p=t[10],h=t[11],f=t[12],d=t[13],m=t[14],g=t[15];return(e*o-r*a)*(p*g-h*m)-(e*s-n*a)*(c*g-h*d)+(e*l-i*a)*(c*m-p*d)+(r*s-n*o)*(u*g-h*f)-(r*l-i*o)*(u*m-p*f)+(n*l-i*s)*(u*d-c*f)}},{}],24:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,p=n*s,h=i*o,f=i*s,d=i*l,m=a*o,g=a*s,y=a*l;return t[0]=1-p-d,t[1]=c+y,t[2]=h-g,t[3]=0,t[4]=c-y,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=h+g,t[9]=f-m,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],25:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);if(Math.abs(u)<1e-6)return null;return o*=u=1/u,s*=u,l*=u,n=Math.sin(e),i=Math.cos(e),a=1-i,t[0]=o*o*a+i,t[1]=s*o*a+l*n,t[2]=l*o*a-s*n,t[3]=0,t[4]=o*s*a-l*n,t[5]=s*s*a+i,t[6]=l*s*a+o*n,t[7]=0,t[8]=o*l*a+s*n,t[9]=s*l*a-o*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],26:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,p=n*l,h=n*u,f=i*l,d=i*u,m=a*u,g=o*s,y=o*l,v=o*u;return t[0]=1-(f+m),t[1]=p+v,t[2]=h-y,t[3]=0,t[4]=p-v,t[5]=1-(c+m),t[6]=d+g,t[7]=0,t[8]=h+y,t[9]=d-g,t[10]=1-(c+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],27:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],28:[function(t,e,r){e.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},{}],29:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],30:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],31:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],32:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}},{}],33:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],34:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),copy:t("./copy"),identity:t("./identity"),transpose:t("./transpose"),invert:t("./invert"),adjoint:t("./adjoint"),determinant:t("./determinant"),multiply:t("./multiply"),translate:t("./translate"),scale:t("./scale"),rotate:t("./rotate"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),fromRotation:t("./fromRotation"),fromRotationTranslation:t("./fromRotationTranslation"),fromScaling:t("./fromScaling"),fromTranslation:t("./fromTranslation"),fromXRotation:t("./fromXRotation"),fromYRotation:t("./fromYRotation"),fromZRotation:t("./fromZRotation"),fromQuat:t("./fromQuat"),frustum:t("./frustum"),perspective:t("./perspective"),perspectiveFromFieldOfView:t("./perspectiveFromFieldOfView"),ortho:t("./ortho"),lookAt:t("./lookAt"),str:t("./str")}},{"./adjoint":19,"./clone":20,"./copy":21,"./create":22,"./determinant":23,"./fromQuat":24,"./fromRotation":25,"./fromRotationTranslation":26,"./fromScaling":27,"./fromTranslation":28,"./fromXRotation":29,"./fromYRotation":30,"./fromZRotation":31,"./frustum":32,"./identity":33,"./invert":35,"./lookAt":36,"./multiply":37,"./ortho":38,"./perspective":39,"./perspectiveFromFieldOfView":40,"./rotate":41,"./rotateX":42,"./rotateY":43,"./rotateZ":44,"./scale":45,"./str":46,"./translate":47,"./transpose":48}],35:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,_=r*l-i*o,x=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-p*d,A=c*g-h*d,M=c*y-f*d,S=p*g-h*m,C=p*y-f*m,L=h*y-f*g,E=v*L-_*C+x*S+b*M-w*A+T*k;if(!E)return null;return E=1/E,t[0]=(s*L-l*C+u*S)*E,t[1]=(i*C-n*L-a*S)*E,t[2]=(m*T-g*w+y*b)*E,t[3]=(h*w-p*T-f*b)*E,t[4]=(l*M-o*L-u*A)*E,t[5]=(r*L-i*M+a*A)*E,t[6]=(g*x-d*T-y*_)*E,t[7]=(c*T-h*x+f*_)*E,t[8]=(o*C-s*M+u*k)*E,t[9]=(n*M-r*C-a*k)*E,t[10]=(d*w-m*x+y*v)*E,t[11]=(p*x-c*w-f*v)*E,t[12]=(s*A-o*S-l*k)*E,t[13]=(r*S-n*A+i*k)*E,t[14]=(m*_-d*b-g*v)*E,t[15]=(c*b-p*_+h*v)*E,t}},{}],36:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,i){var a,o,s,l,u,c,p,h,f,d,m=e[0],g=e[1],y=e[2],v=i[0],_=i[1],x=i[2],b=r[0],w=r[1],T=r[2];if(Math.abs(m-b)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-T)<1e-6)return n(t);p=m-b,h=g-w,f=y-T,d=1/Math.sqrt(p*p+h*h+f*f),a=_*(f*=d)-x*(h*=d),o=x*(p*=d)-v*f,s=v*h-_*p,(d=Math.sqrt(a*a+o*o+s*s))?(a*=d=1/d,o*=d,s*=d):(a=0,o=0,s=0);l=h*s-f*o,u=f*a-p*s,c=p*o-h*a,(d=Math.sqrt(l*l+u*u+c*c))?(l*=d=1/d,u*=d,c*=d):(l=0,u=0,c=0);return t[0]=a,t[1]=l,t[2]=p,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=f,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(l*m+u*g+c*y),t[14]=-(p*m+h*g+f*y),t[15]=1,t}},{"./identity":33}],37:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*i+x*l+b*h+w*g,t[2]=_*a+x*u+b*f+w*y,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*i+x*l+b*h+w*g,t[6]=_*a+x*u+b*f+w*y,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*i+x*l+b*h+w*g,t[10]=_*a+x*u+b*f+w*y,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*i+x*l+b*h+w*g,t[14]=_*a+x*u+b*f+w*y,t[15]=_*o+x*c+b*d+w*v,t}},{}],38:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t}},{}],39:[function(t,e,r){e.exports=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}},{}],40:[function(t,e,r){e.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},{}],41:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,u,c,p,h,f,d,m,g,y,v,_,x,b,w,T,k,A,M,S,C=n[0],L=n[1],E=n[2],I=Math.sqrt(C*C+L*L+E*E);if(Math.abs(I)<1e-6)return null;C*=I=1/I,L*=I,E*=I,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],p=e[4],h=e[5],f=e[6],d=e[7],m=e[8],g=e[9],y=e[10],v=e[11],_=C*C*o+a,x=L*C*o+E*i,b=E*C*o-L*i,w=C*L*o-E*i,T=L*L*o+a,k=E*L*o+C*i,A=C*E*o+L*i,M=L*E*o-C*i,S=E*E*o+a,t[0]=s*_+p*x+m*b,t[1]=l*_+h*x+g*b,t[2]=u*_+f*x+y*b,t[3]=c*_+d*x+v*b,t[4]=s*w+p*T+m*k,t[5]=l*w+h*T+g*k,t[6]=u*w+f*T+y*k,t[7]=c*w+d*T+v*k,t[8]=s*A+p*M+m*S,t[9]=l*A+h*M+g*S,t[10]=u*A+f*M+y*S,t[11]=c*A+d*M+v*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],42:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+p*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=p*i-s*n,t[11]=h*i-l*n,t}},{}],43:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],p=e[10],h=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i-u*n,t[1]=o*i-c*n,t[2]=s*i-p*n,t[3]=l*i-h*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+p*i,t[11]=l*n+h*i,t}},{}],44:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],p=e[6],h=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+p*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=p*i-s*n,t[7]=h*i-l*n,t}},{}],45:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],46:[function(t,e,r){e.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}},{}],47:[function(t,e,r){e.exports=function(t,e,r){var n,i,a,o,s,l,u,c,p,h,f,d,m=r[0],g=r[1],y=r[2];e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*g+p*y+e[12],t[13]=i*m+l*g+h*y+e[13],t[14]=a*m+u*g+f*y+e[14],t[15]=o*m+c*g+d*y+e[15]);return t}},{}],48:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},{}],49:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":51}],50:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":51}],51:[function(t,e,r){e.exports=!0},{}],52:[function(t,e,r){"use strict";e.exports=a,e.exports.isMobile=a,e.exports.default=a;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function a(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?i.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],53:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],54:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function u(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}var p=1;function h(){return p++}function f(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function y(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function v(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?y(t,_):t}var x={};function b(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function w(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)e+=((o=t[i]).x-(a=t[r]).x)*(a.y+o.y);return e}function k(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function A(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var M=null;function S(t){if(null==M){var e=t.navigator?t.navigator.userAgent:null;M=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return M}function C(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,E,I,z,P=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),D=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,O=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,R={now:P,frame:function(t){var e=D(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=self.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==E&&(E=self.matchMedia("(prefers-reduced-motion: reduce)")),E.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},B={supported:!1,testSupport:function(t){!N&&z&&(U?j(t):I=t)}},N=!1,U=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;B.supported=!0}catch(t){}t.deleteTexture(e),N=!0}self.document&&((z=self.document.createElement("img")).onload=function(){I&&j(I),I=null,U=!0},z.onerror=function(){N=!0,I=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01",q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=W(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=W(t);return H(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,Y(i))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=W(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(R.devicePixelRatio>=2||512===e?"@2x":"")+(B.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,n)},q.prototype.canonicalizeTileURL=function(t,e){var r=W(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return!t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},q.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&H(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];G(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},q.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=W(F.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return Y(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),Y(t)};var Z=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function G(t){return Z.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function W(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Y(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function K(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var J=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};J.prototype.getStorageKey=function(t){var e,r=K(F.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},J.prototype.fetchEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){b("Unable to read from LocalStorage")}},J.prototype.saveEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){b("Unable to write to LocalStorage")}},J.prototype.processRequests=function(t){},J.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var a=W(F.EVENTS_URL);a.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.10.1",skuId:V,userId:this.anonId},s=e?c(o,e):o,l={url:Y(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=_t(l,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},J.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Q,$,tt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=f()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(J),et=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=K(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=f(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(J)),rt=et.postTurnstileEvent.bind(et),nt=new tt,it=nt.postMapLoadEvent.bind(nt),at=500,ot=50;function st(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ut,ct=1/0;function pt(){return null==ut&&(ut=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),ut}var ht={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ht);var ft,dt,mt=function(t){function e(e,r,n){401===r&&G(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),gt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href},yt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(gt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:gt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&G(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&b(r),n&&a)return u(n);var l=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(st(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=A(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===$)try{new Response(new ReadableStream),$=!0}catch(t){$=!1}$?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);st(),Q&&Q.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return b(t.message)}))})))}}(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?function(t,e){if(st(),!Q)return e(null);var r=lt(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=A(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},vt=function(t,e){return yt(c(t,{type:"arrayBuffer"}),e)},_t=function(t,e){return yt(c(t,{method:"POST"}),e)};ft=[],dt=0;var xt=function(t,e){if(B.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),dt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ft.push(r),r}dt++;var n=!1,i=function(){if(!n)for(n=!0,dt--;ft.length&&dt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=ft.shift();t.cancelled||(t.cancel=xt(t.requestParameters,t.callback).cancel)}},a=vt(t,(function(t,r,n,a){i(),t?e(t):r&&(pt()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,n){var i=new self.Image,a=self.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src)},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?a.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}(r,e,n,a))}));return{cancel:function(){a.cancel(),i()}}};function bt(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function wt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var Tt=function(t,e){void 0===e&&(e={}),c(this,e),this.type=t},kt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",c({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Tt),At=function(){};At.prototype.on=function(t,e){return this._listeners=this._listeners||{},bt(t,e,this._listeners),this},At.prototype.off=function(t,e){return wt(t,e,this._listeners),wt(t,e,this._oneTimeListeners),this},At.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},bt(t,e,this._oneTimeListeners),this},At.prototype.fire=function(t,e){"string"==typeof t&&(t=new Tt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];wt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(c(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof kt&&console.error(t.error);return this},At.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},At.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},St=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ct(t){var e=t.value;return e?[new St(t.key,e,"constants have been deprecated as of v8")]:[]}function Lt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}function Et(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function It(t){if(Array.isArray(t))return t.map(It);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=It(t[r]);return e}return Et(t)}var zt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Pt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1]}};Pt.prototype.concat=function(t){return new Pt(this,t)},Pt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Pt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Dt={kind:"null"},Ot={kind:"number"},Rt={kind:"string"},Ft={kind:"boolean"},Bt={kind:"color"},Nt={kind:"object"},Ut={kind:"value"},jt={kind:"collator"},Vt={kind:"formatted"},qt={kind:"resolvedImage"};function Ht(t,e){return{kind:"array",itemType:t,N:e}}function Zt(t){if("array"===t.kind){var e=Zt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Gt=[Dt,Ot,Rt,Ft,Bt,Vt,Nt,Ht(Ut),qt];function Xt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Xt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Gt;r<n.length;r+=1)if(!Xt(n[r],e))return null}return"Expected "+Zt(t)+" but found "+Zt(e)+" instead."}function Wt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Yt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Kt=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function o(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var c=s.substr(0,l),p=s.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[i(p[0]),i(p[1]),i(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*o(y,g,f+1/3)),n(255*o(y,g,f)),n(255*o(y,g,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,Jt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Jt.parse=function(t){if(t){if(t instanceof Jt)return t;if("string"==typeof t){var e=Kt(t);if(e)return new Jt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Jt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},Jt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Jt.black=new Jt(0,0,0,1),Jt.white=new Jt(1,1,1,1),Jt.transparent=new Jt(0,0,0,0),Jt.red=new Jt(1,0,0,1);var Qt=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Qt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Qt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var $t=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},te=function(t){this.sections=t};te.fromString=function(t){return new te([new $t(t,null,null,null,null)])},te.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},te.factory=function(t){return t instanceof te?t:te.fromString(t)},te.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},te.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var ee=function(t){this.name=t.name,this.available=t.available};function re(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ne(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Jt)return!0;if(t instanceof Qt)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ne(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!ne(t[n]))return!1;return!0}return!1}function ie(t){if(null===t)return Dt;if("string"==typeof t)return Rt;if("boolean"==typeof t)return Ft;if("number"==typeof t)return Ot;if(t instanceof Jt)return Bt;if(t instanceof Qt)return jt;if(t instanceof te)return Vt;if(t instanceof ee)return qt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=ie(i[n]);if(e){if(e===a)continue;e=Ut;break}e=a}return Ht(e||Ut,r)}return Nt}function ae(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Jt||t instanceof te||t instanceof ee?t.toString():JSON.stringify(t)}ee.prototype.toString=function(){return this.name},ee.fromString=function(t){return t?new ee({name:t,available:!1}):null},ee.prototype.serialize=function(){return["image",this.name]};var oe=function(t,e){this.type=t,this.value=e};oe.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ne(t[1]))return e.error("invalid value");var r=t[1],n=ie(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new oe(n,r)},oe.prototype.evaluate=function(){return this.value},oe.prototype.eachChild=function(){},oe.prototype.outputDefined=function(){return!0},oe.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Jt?["rgba"].concat(this.value.toArray()):this.value instanceof te?this.value.serialize():this.value};var se=function(t){this.name="ExpressionEvaluationError",this.message=t};se.prototype.toJSON=function(){return this.message};var le={string:Rt,number:Ot,boolean:Ft,object:Nt},ue=function(t,e){this.type=t,this.args=e};ue.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=le[s],n++}else a=Ut;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Ht(a,o)}else r=le[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,Ut);if(!u)return null;l.push(u)}return new ue(r,l)},ue.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Xt(this.type,ie(r)))return r;if(e===this.args.length-1)throw new se("Expected value to be of type "+Zt(this.type)+", but found "+Zt(ie(r))+" instead.")}return null},ue.prototype.eachChild=function(t){this.args.forEach(t)},ue.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ue.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ce=function(t){this.type=Vt,this.sections=t};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ot)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Ht(Rt))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Bt)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var p=e.parse(t[a],1,Ut);if(!p)return null;var h=p.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:p,scale:null,font:null,textColor:null})}}return new ce(n)},ce.prototype.evaluate=function(t){return new te(this.sections.map((function(e){var r=e.content.evaluate(t);return ie(r)===qt?new $t("",r,null,null,null):new $t(ae(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ce.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},ce.prototype.outputDefined=function(){return!1},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var pe=function(t){this.type=qt,this.input=t};pe.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Rt);return r?new pe(r):e.error("No image name provided.")},pe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ee.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},pe.prototype.eachChild=function(t){t(this.input)},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){return["image",this.input.serialize()]};var he={"to-boolean":Ft,"to-color":Bt,"to-number":Ot,"to-string":Rt},fe=function(t,e){this.type=t,this.args=e};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=he[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Ut);if(!o)return null;i.push(o)}return new fe(n,i)},fe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Jt)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":re(e[0],e[1],e[2],e[3])))return new Jt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new se(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var u=Number(o);if(!isNaN(u))return u}throw new se("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?te.fromString(ae(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ee.fromString(ae(this.args[0].evaluate(t))):ae(this.args[0].evaluate(t))},fe.prototype.eachChild=function(t){this.args.forEach(t)},fe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},fe.prototype.serialize=function(){if("formatted"===this.type.kind)return new ce([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var de=["Unknown","Point","LineString","Polygon"],me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?de[this.feature.type]:this.feature.type:null},me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},me.prototype.canonicalID=function(){return this.canonical},me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Jt.parse(t)),e};var ge=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ge.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return!1},ge.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ge.parse=function(t,e){var r,n=t[0],i=ge.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var p=c[u],h=p[0],f=p[1];l=new Be(e.registry,e.path,null,e.scope);for(var d=[],m=!1,g=1;g<t.length;g++){var y=t[g],v=Array.isArray(h)?h[g-1]:h.type,_=l.parse(y,1+d.length,v);if(!_){m=!0;break}d.push(_)}if(!m)if(Array.isArray(h)&&h.length!==d.length)l.error("Expected "+h.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(h)?h[x]:h.type,w=d[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new ge(n,a,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var T=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Zt).join(", ")+")":"("+Zt(e.type)+"...)"})).join(" | "),k=[],A=1;A<t.length;A++){var M=e.parse(t[A],1+k.length);if(!M)return null;k.push(Zt(M.type))}e.error("Expected arguments of type "+T+", but found ("+k.join(", ")+") instead.")}return null},ge.register=function(t,e){for(var r in ge.definitions=e,e)t[r]=ge};var ye=function(t,e,r){this.type=jt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function ve(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function _e(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function xe(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function be(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function we(t,e){for(var r,n,i,a,o,s,l,u=!1,c=0,p=e.length;c<p;c++)for(var h=e[c],f=0,d=h.length;f<d-1;f++){if((a=(r=t)[0]-(n=h[f])[0])*(l=r[1]-(i=h[f+1])[1])-(s=r[0]-i[0])*(o=r[1]-n[1])==0&&a*s<=0&&o*l<=0)return!1;be(t,h[f],h[f+1])&&(u=!u)}return u}function Te(t,e){for(var r=0;r<e.length;r++)if(we(t,e[r]))return!0;return!1}function ke(t,e,r,n){var i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function Ae(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(0!=(p=[(c=a[o+1])[0]-(u=a[o])[0],c[1]-u[1]])[0]*(h=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-p[1]*h[0]&&ke(s,l,u,c)&&ke(u,c,s,l))return!0;var s,l,u,c,p,h;return!1}function Me(t,e){for(var r=0;r<t.length;++r)if(!we(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Ae(t[n],t[n+1],e))return!1;return!0}function Se(t,e){for(var r=0;r<e.length;r++)if(Me(t,e[r]))return!0;return!1}function Ce(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=xe(t[i][o],r);ve(e,s),a.push(s)}n.push(a)}return n}function Le(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Ce(t[i],e,r);n.push(a)}return n}function Ee(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}ve(e,t)}function Ie(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,l=t;s<l.length;s+=1)for(var u=0,c=l[s];u<c.length;u+=1){var p=c[u],h=[p.x+a[0],p.y+a[1]];Ee(h,e,r,i),o.push(h)}return o}function ze(t,e,r,n){for(var i,a=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],l=0,u=t;l<u.length;l+=1){for(var c=[],p=0,h=u[l];p<h.length;p+=1){var f=h[p],d=[f.x+o[0],f.y+o[1]];ve(e,d),c.push(d)}s.push(c)}if(e[2]-e[0]<=a/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)Ee(v[y],e,r,a)}return s}ye.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ft);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ft);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Rt))?null:new ye(n,i,a)},ye.prototype.evaluate=function(t){return new Qt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ye.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ye.prototype.outputDefined=function(){return!1},ye.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Pe=function(t,e){this.type=Ft,this.geojson=t,this.geometries=e};function De(t){if(t instanceof ge){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Pe)return!1;var e=!0;return t.eachChild((function(t){e&&!De(t)&&(e=!1)})),e}function Oe(t){if(t instanceof ge&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Oe(t)&&(e=!1)})),e}function Re(t,e){if(t instanceof ge&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Re(t,e)&&(r=!1)})),r}Pe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ne(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Pe(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Pe(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Pe(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Pe.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ce(e.coordinates,n,i),o=Ie(t.geometry(),r,n,i);if(!_e(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!we(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Le(e.coordinates,n,i),c=Ie(t.geometry(),r,n,i);if(!_e(r,n))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!Te(h[p],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Ce(e.coordinates,n,i),o=ze(t.geometry(),r,n,i);if(!_e(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Me(l[s],a))return!1}if("MultiPolygon"===e.type){var u=Le(e.coordinates,n,i),c=ze(t.geometry(),r,n,i);if(!_e(r,n))return!1;for(var p=0,h=c;p<h.length;p+=1)if(!Se(h[p],u))return!1}return!0}(t,this.geometries)}return!1},Pe.prototype.eachChild=function(){},Pe.prototype.outputDefined=function(){return!0},Pe.prototype.serialize=function(){return["within",this.geojson]};var Fe=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Fe.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Fe(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Fe.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Fe.prototype.eachChild=function(){},Fe.prototype.outputDefined=function(){return!1},Fe.prototype.serialize=function(){return["var",this.name]};var Be=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Pt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Ne(t,e){for(var r,n=t.length-1,i=0,a=n,o=0;i<=a;)if((r=t[o=Math.floor((i+a)/2)])<=e){if(o===n||e<t[o+1])return o;i=o+1}else{if(!(r>e))throw new se("Input is not a number.");a=o-1}return 0}Be.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Be.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ue(e,[t]):"coerce"===r?new fe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof oe)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof Fe)return t(e.boundExpression);if(e instanceof ge&&"error"===e.name)return!1;if(e instanceof ye)return!1;if(e instanceof Pe)return!1;var r=e instanceof fe||e instanceof ue,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof oe})),!!n&&De(e)&&Re(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var l=new me;try{a=new oe(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Be.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Be(this.registry,n,e||null,i,this.errors)},Be.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new zt(n,t))},Be.prototype.checkSubtype=function(t,e){var r=Xt(t,e);return r&&this.error(r),r};var Ue=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[1];this.labels.push(a[0]),this.outputs.push(o)}};function je(t,e,r){return t*(1-r)+e*r}Ue.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Ot);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],l=a,u=a+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new Ue(i,r,n)},Ue.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ne(e,n)].evaluate(t)},Ue.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ue.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ue.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ve=Object.freeze({__proto__:null,number:je,color:function(t,e,r){return new Jt(je(t.r,e.r,r),je(t.g,e.g,r),je(t.b,e.b,r),je(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return je(t,e[n],r)}))}}),qe=6/29*3*(6/29),He=Math.PI/180,Ze=180/Math.PI;function Ge(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function Xe(t){return t>6/29?t*t*t:qe*(t-4/29)}function We(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ke(t){var e=Ye(t.r),r=Ye(t.g),n=Ye(t.b),i=Ge((.4124564*e+.3575761*r+.1804375*n)/.95047),a=Ge((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-Ge((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Je(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xe(e),r=.95047*Xe(r),n=1.08883*Xe(n),new Jt(We(3.2404542*r-1.5371385*e-.4985314*n),We(-.969266*r+1.8760108*e+.041556*n),We(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Qe(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var $e={forward:Ke,reverse:Je,interpolate:function(t,e,r){return{l:je(t.l,e.l,r),a:je(t.a,e.a,r),b:je(t.b,e.b,r),alpha:je(t.alpha,e.alpha,r)}}},tr={forward:function(t){var e=Ke(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Ze;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*He,r=t.c;return Je({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Qe(t.h,e.h,r),c:je(t.c,e.c,r),l:je(t.l,e.l,r),alpha:je(t.alpha,e.alpha,r)}}},er=Object.freeze({__proto__:null,lab:$e,hcl:tr}),rr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function nr(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}rr.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=nr(e,t.base,n,i);else if("linear"===t.name)a=nr(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(nr(e,1,n,i))}return a},rr.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ot)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Bt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<a.length;c+=2){var p=a[c],h=a[c+1],f=c+3,d=c+4;if("number"!=typeof p)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,u);if(!m)return null;u=u||m.type,l.push([p,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new rr(u,r,n,i,l):e.error("Type "+Zt(u)+" is not interpolatable.")},rr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ne(e,n),o=rr.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);return"interpolate"===this.operator?Ve[this.type.kind.toLowerCase()](s,l,o):"interpolate-hcl"===this.operator?tr.reverse(tr.interpolate(tr.forward(s),tr.forward(l),o)):$e.reverse($e.interpolate($e.forward(s),$e.forward(l),o))},rr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},rr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},rr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var ir=function(t,e){this.type=t,this.args=e};ir.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=e.parse(o[a],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s)}var l=n&&i.some((function(t){return Xt(n,t.type)}));return new ir(l?Ut:r,i)},ir.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof ee&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},ir.prototype.eachChild=function(t){this.args.forEach(t)},ir.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ir.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ar=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ar.prototype.evaluate=function(t){return this.result.evaluate(t)},ar.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},ar.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new ar(r,o):null},ar.prototype.outputDefined=function(){return this.result.outputDefined()},ar.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize())}return t.push(this.result.serialize()),t};var or=function(t,e,r){this.type=t,this.index=e,this.input=r};or.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ot),n=e.parse(t[2],2,Ht(e.expectedType||Ut));return r&&n?new or(n.type.itemType,r,n):null},or.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new se("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new se("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new se("Array index must be an integer, but found "+e+" instead.");return r[e]},or.prototype.eachChild=function(t){t(this.index),t(this.input)},or.prototype.outputDefined=function(){return!1},or.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var sr=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};sr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),n=e.parse(t[2],2,Ut);return r&&n?Wt(r.type,[Ft,Rt,Ot,Dt,Ut])?new sr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(r.type)+" instead"):null},sr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Zt(ie(e))+" instead.");if(!Yt(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Zt(ie(r))+" instead.");return r.indexOf(e)>=0},sr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},sr.prototype.outputDefined=function(){return!0},sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var lr=function(t,e,r){this.type=Ot,this.needle=t,this.haystack=e,this.fromIndex=r};lr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),n=e.parse(t[2],2,Ut);if(!r||!n)return null;if(!Wt(r.type,[Ft,Rt,Ot,Dt,Ut]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ot);return i?new lr(r,n,i):null}return new lr(r,n)},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found "+Zt(ie(e))+" instead.");if(!Yt(r,["string","array"]))throw new se("Expected second argument to be of type array or string, but found "+Zt(ie(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ur=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};ur.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,p=s;c<p.length;c+=1){var h=p[c];if("number"!=typeof h&&"string"!=typeof h)return u.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ie(h)))return null}else r=ie(h);if(void 0!==i[String(h)])return u.error("Branch labels must be unique.");i[String(h)]=a.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,a.push(f)}var d=e.parse(t[1],1,Ut);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new ur(r,n,d,i,a,m):null},ur.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ie(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ur.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ur.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ur.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(p=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[p][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],p=c[0],h=c[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var cr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};cr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Ft);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new cr(r,n,s):null},cr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},cr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i)}t(this.otherwise)},cr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},cr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var pr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function hr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function fr(t,e,r,n){return 0===n.compare(e,r)}function dr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Ft,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Ut);if(!a)return null;if(!hr(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Zt(a.type)+"'.");var o=e.parse(t[2],2,Ut);if(!o)return null;if(!hr(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Zt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Zt(a.type)+"' and '"+Zt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ue(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ue(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,jt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=ie(a),l=ie(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new se('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=ie(a),c=ie(o);if("string"!==u.kind||"string"!==c.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}pr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ut),n=e.parse(t[2],2,Ot);if(!r||!n)return null;if(!Wt(r.type,[Ht(Ut),Rt,Ut]))return e.error("Expected first argument to be of type array or string, but found "+Zt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ot);return i?new pr(r.type,r,n,i):null}return new pr(r.type,r,n)},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new se("Expected first argument to be of type array or string, but found "+Zt(ie(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},pr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var mr=dr("==",(function(t,e,r){return e===r}),fr),gr=dr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!fr(0,e,r,n)})),yr=dr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),vr=dr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),_r=dr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),xr=dr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),br=function(t,e,r,n,i){this.type=Rt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};br.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ot);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Rt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Rt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ot)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ot))?null:new br(r,i,a,o,s)},br.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},br.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},br.prototype.outputDefined=function(){return!1},br.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var wr=function(t){this.type=Ot,this.input=t};wr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Zt(r.type)+" instead."):new wr(r):null},wr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new se("Expected value to be of type string or array, but found "+Zt(ie(e))+" instead.")},wr.prototype.eachChild=function(t){t(this.input)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Tr={"==":mr,"!=":gr,">":vr,"<":yr,">=":xr,"<=":_r,array:ue,at:or,boolean:ue,case:cr,coalesce:ir,collator:ye,format:ce,image:pe,in:sr,"index-of":lr,interpolate:rr,"interpolate-hcl":rr,"interpolate-lab":rr,length:wr,let:ar,literal:oe,match:ur,number:ue,"number-format":br,object:ue,slice:pr,step:Ue,string:ue,"to-boolean":fe,"to-color":fe,"to-number":fe,"to-string":fe,var:Fe,within:Pe};function kr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=re(r,n,i,o);if(s)throw new se(s);return new Jt(r/255*o,n/255*o,i/255*o,o)}function Ar(t,e){return t in e}function Mr(t,e){var r=e[t];return void 0===r?null:r}function Sr(t){return{type:t}}function Cr(t){return{result:"success",value:t}}function Lr(t){return{result:"error",value:t}}function Er(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ir(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function zr(t){return!!t.expression&&t.expression.interpolated}function Pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Dr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Or(t){return t}function Rr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Fr(t,e,r,n,i){return Rr(typeof r===i?n[r]:void 0,t.default,e.default)}function Br(t,e,r){if("number"!==Pr(r))return Rr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ne(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Nr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Pr(r))return Rr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ne(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=Ve[e.type]||Or;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=er[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function Ur(t,e,r){return"color"===e.type?r=Jt.parse(r):"formatted"===e.type?r=te.fromString(r.toString()):"resolvedImage"===e.type?r=ee.fromString(r.toString()):Pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Rr(r,t.default,e.default)}ge.register(Tr,{error:[{kind:"error"},[Rt],function(t,e){throw new se(e[0].evaluate(t))}],typeof:[Rt,[Ut],function(t,e){return Zt(ie(e[0].evaluate(t)))}],"to-rgba":[Ht(Ot,4),[Bt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Bt,[Ot,Ot,Ot],kr],rgba:[Bt,[Ot,Ot,Ot,Ot],kr],has:{type:Ft,overloads:[[[Rt],function(t,e){return Ar(e[0].evaluate(t),t.properties())}],[[Rt,Nt],function(t,e){var r=e[1];return Ar(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Ut,overloads:[[[Rt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Rt,Nt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Ut,[Rt],function(t,e){return Mr(e[0].evaluate(t),t.featureState||{})}],properties:[Nt,[],function(t){return t.properties()}],"geometry-type":[Rt,[],function(t){return t.geometryType()}],id:[Ut,[],function(t){return t.id()}],zoom:[Ot,[],function(t){return t.globals.zoom}],"heatmap-density":[Ot,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ot,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ut,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ot,Sr(Ot),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Ot,Sr(Ot),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Ot,overloads:[[[Ot,Ot],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Ot],function(t,e){return-e[0].evaluate(t)}]]},"/":[Ot,[Ot,Ot],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Ot,[Ot,Ot],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Ot,[],function(){return Math.LN2}],pi:[Ot,[],function(){return Math.PI}],e:[Ot,[],function(){return Math.E}],"^":[Ot,[Ot,Ot],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Ot,[Ot],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Ot,[Ot],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Ot,[Ot],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Ot,[Ot],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Ot,[Ot],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Ot,[Ot],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Ot,[Ot],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Ot,[Ot],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Ot,[Ot],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Ot,[Ot],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Ot,Sr(Ot),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Ot,Sr(Ot),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Ot,[Ot],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Ot,[Ot],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ot,[Ot],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Ot,[Ot],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ft,[Rt,Ut],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Ft,[Ut],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ft,[Rt],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ft,[Rt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Ft,[Rt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ft,[Rt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ft,[Rt,Ut],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Ft,[Ut],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ft,[Ut],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ft,[Ht(Rt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Ht(Ut)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[Rt,Ht(Ut)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ft,[Rt,Ht(Ut)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Sr(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Ft,overloads:[[[Ft,Ft],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Sr(Ft),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Ft,[Ft],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ft,[Rt],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Rt,[Rt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Rt,[Rt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Rt,Sr(Ut),function(t,e){return e.map((function(e){return ae(e.evaluate(t))})).join("")}],"resolved-locale":[Rt,[jt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var jr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new me,this._defaultValue=e?function(t){return"color"===t.type&&Dr(t.default)?new Jt(0,0,0,0):"color"===t.type?Jt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Vr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Tr}function qr(t,e){var r=new Be(Tr,[],e?function(t){var e={color:Bt,string:Rt,number:Ot,enum:Rt,boolean:Ft,formatted:Vt,resolvedImage:qt};return"array"===t.type?Ht(e[t.value]||Ut,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Cr(new jr(n,e)):Lr(r.errors)}jr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},jr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new se("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Hr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Oe(e.expression)};Hr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Hr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Zr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Oe(e.expression),this.interpolationType=n};function Gr(t,e){if("error"===(t=qr(t,e)).result)return t;var r=t.value.expression,n=De(r);if(!n&&!Er(e))return Lr([new zt("","data expressions not supported")]);var i=Re(r,["zoom"]);if(!i&&!Ir(e))return Lr([new zt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof ar)r=t(e.result);else if(e instanceof ir)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else(e instanceof Ue||e instanceof rr)&&e.input instanceof ge&&"zoom"===e.input.name&&(r=e);return r instanceof zt||e.eachChild((function(e){var n=t(e);n instanceof zt?r=n:!r&&n?r=new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new zt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return a||i?a instanceof zt?Lr([a]):a instanceof rr&&!zr(e)?Lr([new zt("",'"interpolate" expressions cannot be used with this property')]):Cr(a?new Zr(n?"camera":"composite",t.value,a.labels,a instanceof rr?a.interpolation:void 0):new Hr(n?"constant":"source",t.value)):Lr([new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Zr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},Zr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?rr.interpolationFactor(this.interpolationType,t,e,r):0};var Xr=function(t,e){this._parameters=t,this._specification=e,Lt(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),u=e.type||(zr(r)?"exponential":"interval");if(o&&((e=Lt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],Jt.parse(t[1])]}))),e.default=Jt.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!er[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)n=Nr;else if("interval"===u)n=Br;else if("categorical"===u){n=Fr,i=Object.create(null);for(var c=0,p=e.stops;c<p.length;c+=1){var h=p[c];i[h[0]]=h[1]}a=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');n=Ur}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var g=e.stops[m],y=g[0].zoom;void 0===f[y]&&(f[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},d.push(y)),f[y].stops.push([g[0].value,g[1]])}for(var v=[],_=0,x=d;_<x.length;_+=1){var b=x[_];v.push([f[b].zoom,t(f[b],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:rr.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return Nr({stops:v,base:e.base},r,i).evaluate(i,n)}}}if(l){var T="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:rr.interpolationFactor.bind(void 0,T),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,a)}}}return{kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Rr(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification))};function Wr(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=Pr(r);if("object"!==l)return[new St(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],p=n[c]||n["*"],h=void 0;if(i[c])h=i[c];else if(n[c])h=xn;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new St(e,r[u],'unknown property "'+u+'"'));continue}h=xn}s=s.concat(h({key:(e?e+".":e)+u,value:r[u],valueSpec:p,style:a,styleSpec:o,object:r,objectKey:u},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new St(e,r,'missing required property "'+f+'"'));return s}function Yr(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||xn;if("array"!==Pr(e))return[new St(a,e,"array expected, "+Pr(e)+" found")];if(r.length&&e.length!==r.length)return[new St(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new St(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Pr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(o({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:i,key:a+"["+u+"]"}));return l}function Kr(t){var e=t.key,r=t.value,n=t.valueSpec,i=Pr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new St(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new St(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new St(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Jr(t){var e,r,n,i=t.valueSpec,a=Et(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===Pr(t.value.stops)&&"array"===Pr(t.value.stops[0])&&"object"===Pr(t.value.stops[0][0]),c=Wr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new St(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Yr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Pr(r)&&0===r.length&&e.push(new St(t.key,r,"array must have at least one stop")),e},default:function(t){return xn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new St(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new St(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!zr(t.valueSpec)&&c.push(new St(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Er(t.valueSpec)?c.push(new St(t.key,t.value,"property functions not supported")):s&&!Ir(t.valueSpec)&&c.push(new St(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new St(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],a=t.value,s=t.key;if("array"!==Pr(a))return[new St(s,a,"array expected, "+Pr(a)+" found")];if(2!==a.length)return[new St(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==Pr(a[0]))return[new St(s,a,"object expected, "+Pr(a[0])+" found")];if(void 0===a[0].zoom)return[new St(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new St(s,a,"object stop key must have value")];if(n&&n>Et(a[0].zoom))return[new St(s,a[0].zoom,"stop zoom values must appear in ascending order")];Et(a[0].zoom)!==n&&(n=Et(a[0].zoom),r=void 0,o={}),e=e.concat(Wr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Kr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Vr(It(a[1]))?e.concat([new St(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(xn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Pr(t.value),l=Et(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new St(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new St(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return Er(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new St(t.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new St(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new St(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new St(t.key,u,"integer expected, found "+l)]}}function Qr(t){var e=("property"===t.expressionContext?Gr:qr)(It(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new St(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new St(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Oe(r))return[new St(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Oe(r))return[new St(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Re(r,["zoom","feature-state"]))return[new St(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!De(r))return[new St(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function $r(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Et(r))&&i.push(new St(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Et(r))&&i.push(new St(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function tn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!tn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Xr.deserialize=function(t){return new Xr(t._parameters,t._specification)},Xr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var en={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function rn(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};tn(t)||(t=an(t));var e=qr(t,en);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function nn(t,e){return t<e?-1:t>e?1:0}function an(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?on(t[1],t[2],"=="):"!="===r?un(on(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?on(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(an))):"all"===r?["all"].concat(t.slice(1).map(an)):"none"===r?["all"].concat(t.slice(1).map(an).map(un)):"in"===r?sn(t[1],t.slice(2)):"!in"===r?un(sn(t[1],t.slice(2))):"has"===r?ln(t[1]):"!has"===r?un(ln(t[1])):"within"!==r||t}function on(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function sn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(nn)]]:["filter-in-small",t,["literal",e]]}}function ln(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function un(t){return["!",t]}function cn(t){return tn(It(t.value))?Qr(Lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Pr(r))return[new St(n,r,"array expected, "+Pr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new St(n,r,"filter array must have at least 1 element")];switch(o=o.concat($r({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Et(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Et(r[1])&&o.push(new St(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new St(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Pr(r[1]))&&o.push(new St(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=Pr(r[s]),"$type"===Et(r[1])?o=o.concat($r({key:n+"["+s+"]",value:r[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new St(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)o=o.concat(t({key:n+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Pr(r[1]),2!==r.length?o.push(new St(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&o.push(new St(n+"[1]",r[1],"string expected, "+i+" found"));break;case"within":i=Pr(r[1]),2!==r.length?o.push(new St(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==i&&o.push(new St(n+"[1]",r[1],"object expected, "+i+" found"))}return o}(t)}function pn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return xn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var u,c=t.valueSpec||s[o];if(!c)return[new St(r,a,'unknown property "'+o+'"')];if("string"===Pr(a)&&Er(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new St(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var p=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&p.push(new St(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Dr(It(a))&&"identity"===Et(a.type)&&p.push(new St(r,a,'"text-font" does not support identity functions'))),p.concat(xn({key:t.key,value:a,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function hn(t){return pn(t,"paint")}function fn(t){return pn(t,"layout")}function dn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new St(n,r,'either "type" or "ref" is required'));var o,s=Et(r.type),l=Et(r.ref);if(r.id)for(var u=Et(r.id),c=0;c<t.arrayIndex;c++){var p=i.layers[c];Et(p.id)===u&&e.push(new St(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+p.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new St(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){Et(t.id)===l&&(o=t)})),o?o.ref?e.push(new St(n,r.ref,"ref cannot reference another ref layer")):s=Et(o.type):e.push(new St(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Et(h.type);h?"vector"===f&&"raster"===s?e.push(new St(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new St(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new St(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new St(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new St(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new St(n,r.source,'source "'+r.source+'" not found'))}else e.push(new St(n,r,'missing required property "source"'));return e=e.concat(Wr({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return xn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:cn,layout:function(t){return Wr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return fn(Lt({layerType:s},t))}}})},paint:function(t){return Wr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return hn(Lt({layerType:s},t))}}})}}}))}function mn(t){var e=t.value,r=t.key,n=Pr(e);return"string"!==n?[new St(r,e,"string expected, "+n+" found")]:[]}var gn={promoteId:function(t){var e=t.key,r=t.value;if("string"===Pr(r))return mn({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,mn({key:e+"."+i,value:r[i]}));return n}};function yn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new St(r,e,'"type" is required')];var a,o=Et(e.type);switch(o){case"vector":case"raster":case"raster-dem":return Wr({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:gn});case"geojson":if(a=Wr({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:gn}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c="string"==typeof u?[u,["accumulated"],["get",s]]:u;a.push.apply(a,Qr({key:r+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),a.push.apply(a,Qr({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return a;case"video":return Wr({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Wr({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new St(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return $r({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function vn(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=Pr(e);if(void 0===e)return a;if("object"!==o)return a.concat([new St("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);a=a.concat(l&&n[l[1]]&&n[l[1]].transition?xn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?xn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new St(s,e[s],'unknown property "'+s+'"')])}return a}var _n={"*":function(){return[]},array:Yr,boolean:function(t){var e=t.value,r=t.key,n=Pr(e);return"boolean"!==n?[new St(r,e,"boolean expected, "+n+" found")]:[]},number:Kr,color:function(t){var e=t.key,r=t.value,n=Pr(r);return"string"!==n?[new St(e,r,"color expected, "+n+" found")]:null===Kt(r)?[new St(e,r,'color expected, "'+r+'" found')]:[]},constants:Ct,enum:$r,filter:cn,function:Jr,layer:dn,object:Wr,source:yn,light:vn,string:mn,formatted:function(t){return 0===mn(t).length?[]:Qr(t)},resolvedImage:function(t){return 0===mn(t).length?[]:Qr(t)}};function xn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Dr(Et(e))?Jr(t):r.expression&&Vr(It(e))?Qr(t):r.type&&_n[r.type]?_n[r.type](t):Wr(Lt({},t,{valueSpec:r.type?n[r.type]:r}))}function bn(t){var e=t.value,r=t.key,n=mn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new St(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new St(r,e,'"glyphs" url must include a "{range}" token'))),n}function wn(t,e){void 0===e&&(e=Mt);var r=[];return r=r.concat(xn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:bn,"*":function(){return[]}}})),t.constants&&(r=r.concat(Ct({key:"constants",value:t.constants,style:t,styleSpec:e}))),Tn(r)}function Tn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function kn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Tn(t.apply(this,e))}}wn.source=kn(yn),wn.light=kn(vn),wn.layer=kn(dn),wn.filter=kn(cn),wn.paintProperty=kn(hn),wn.layoutProperty=kn(fn);var An=wn,Mn=An.light,Sn=An.paintProperty,Cn=An.layoutProperty;function Ln(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new kt(new Error(i[n].message))),r=!0;return r}var En=In;function In(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var a=0;a<this.d*this.d;a++){var o=i[3+a],s=i[3+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}In.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},In.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},In.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},In.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},In.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var u=this.keys,c=this.bboxes,p=0;p<l.length;p++){var h=l[p];if(void 0===o[h]){var f=4*h;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&n>=c[f+1])?(o[h]=!0,a.push(u[h])):o[h]=!1}}},In.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},In.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},In.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},In.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[3+o]=a,i.set(s,a),a+=s.length}return i[3+t.length]=a,i.set(this.keys,a),i[3+t.length+1]=a+=this.keys.length,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var zn=self.ImageData,Pn=self.ImageBitmap,Dn={};function On(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Dn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Rn in On("Object",Object),En.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},En.deserialize=function(t){return new En(t.buffer)},On("Grid",En),On("Color",Jt),On("Error",Error),On("ResolvedImage",ee),On("StylePropertyFunction",Xr),On("StyleExpression",jr,{omit:["_evaluator"]}),On("ZoomDependentExpression",Zr),On("ZoomConstantExpression",Hr),On("CompoundExpression",ge,{omit:["_evaluate"]}),Tr)Tr[Rn]._classRegistryKey||On("Expression_"+Rn,Tr[Rn]);function Fn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Bn(t){return Pn&&t instanceof Pn}function Nn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Fn(t)||Bn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof zn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1)n.push(Nn(a[i],e));return n}if("object"==typeof t){var o=t.constructor,s=o._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=o.serialize?o.serialize(t,e):{};if(!o.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(Dn[s].omit.indexOf(u)>=0)){var c=t[u];l[u]=Dn[s].shallow.indexOf(u)>=0?c:Nn(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function Un(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Fn(t)||Bn(t)||ArrayBuffer.isView(t)||t instanceof zn)return t;if(Array.isArray(t))return t.map(Un);if("object"==typeof t){var e=t.$name||"Object",r=Dn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=Dn[e].shallow.indexOf(o)>=0?s:Un(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var jn=function(){this.first=!0};jn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Vn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function qn(t){for(var e=0,r=t;e<r.length;e+=1)if(Hn(r[e].charCodeAt(0)))return!0;return!1}function Hn(t){return!(746!==t&&747!==t&&(t<4352||!(Vn["Bopomofo Extended"](t)||Vn.Bopomofo(t)||Vn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Vn["CJK Compatibility Ideographs"](t)||Vn["CJK Compatibility"](t)||Vn["CJK Radicals Supplement"](t)||Vn["CJK Strokes"](t)||!(!Vn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Vn["CJK Unified Ideographs Extension A"](t)||Vn["CJK Unified Ideographs"](t)||Vn["Enclosed CJK Letters and Months"](t)||Vn["Hangul Compatibility Jamo"](t)||Vn["Hangul Jamo Extended-A"](t)||Vn["Hangul Jamo Extended-B"](t)||Vn["Hangul Jamo"](t)||Vn["Hangul Syllables"](t)||Vn.Hiragana(t)||Vn["Ideographic Description Characters"](t)||Vn.Kanbun(t)||Vn["Kangxi Radicals"](t)||Vn["Katakana Phonetic Extensions"](t)||Vn.Katakana(t)&&12540!==t||!(!Vn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Vn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Vn["Unified Canadian Aboriginal Syllabics"](t)||Vn["Unified Canadian Aboriginal Syllabics Extended"](t)||Vn["Vertical Forms"](t)||Vn["Yijing Hexagram Symbols"](t)||Vn["Yi Syllables"](t)||Vn["Yi Radicals"](t))))}function Zn(t){return!(Hn(t)||function(t){return!!(Vn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Vn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Vn["Letterlike Symbols"](t)||Vn["Number Forms"](t)||Vn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Vn["Control Pictures"](t)&&9251!==t||Vn["Optical Character Recognition"](t)||Vn["Enclosed Alphanumerics"](t)||Vn["Geometric Shapes"](t)||Vn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Vn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Vn["CJK Symbols and Punctuation"](t)||Vn.Katakana(t)||Vn["Private Use Area"](t)||Vn["CJK Compatibility Forms"](t)||Vn["Small Form Variants"](t)||Vn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Gn(t){return t>=1424&&t<=2303||Vn["Arabic Presentation Forms-A"](t)||Vn["Arabic Presentation Forms-B"](t)}function Xn(t,e){return!(!e&&Gn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Vn.Khmer(t))}function Wn(t){for(var e=0,r=t;e<r.length;e+=1)if(Gn(r[e].charCodeAt(0)))return!0;return!1}var Yn=null,Kn="unavailable",Jn=null,Qn=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Kn="error"),Yn&&Yn(t)};function $n(){ti.fire(new Tt("pluginStateChange",{pluginStatus:Kn,pluginURL:Jn}))}var ti=new At,ei=function(){return Kn},ri=function(){if("deferred"!==Kn||!Jn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Kn="loading",$n(),Jn&&vt({url:Jn},(function(t){t?Qn(t):(Kn="loaded",$n())}))},ni={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Kn||null!=ni.applyArabicShaping},isLoading:function(){return"loading"===Kn},setState:function(t){Kn=t.pluginStatus,Jn=t.pluginURL},isParsed:function(){return null!=ni.applyArabicShaping&&null!=ni.processBidirectionalText&&null!=ni.processStyledBidirectionalText},getPluginURL:function(){return Jn}},ii=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new jn,this.transition={})};ii.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!Xn(n[r].charCodeAt(0),e))return!1;return!0}(t,ni.isLoaded())},ii.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ii.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var ai=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Dr(t))return new Xr(t,e);if(Vr(t)){var r=Gr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=Jt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ai.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ai.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var oi=function(t){this.property=t,this.value=new ai(t,void 0)};oi.prototype.transitioned=function(t,e){return new li(this.property,this.value,e,c({},t.transition,this.transition),t.now)},oi.prototype.untransitioned=function(){return new li(this.property,this.value,null,{},0)};var si=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};si.prototype.getValue=function(t){return _(this._values[t].value.value)},si.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new oi(this._values[t].property)),this._values[t].value=new ai(this._values[t].property,null===e?void 0:_(e))},si.prototype.getTransition=function(t){return _(this._values[t].transition)},si.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new oi(this._values[t].property)),this._values[t].transition=_(e)||void 0},si.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a)}return t},si.prototype.transitioned=function(t,e){for(var r=new ui(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a])}return r},si.prototype.untransitioned=function(){for(var t=new ui(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var li=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};li.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var ui=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ui.prototype.possiblyEvaluate=function(t,e,r){for(var n=new hi(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n},ui.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};ci.prototype.getValue=function(t){return _(this._values[t].value)},ci.prototype.setValue=function(t,e){this._values[t]=new ai(this._values[t].property,null===e?void 0:_(e))},ci.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},ci.prototype.possiblyEvaluate=function(t,e,r){for(var n=new hi(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(t,e,r)}return n};var pi=function(t,e,r){this.property=t,this.value=e,this.parameters=r};pi.prototype.isConstant=function(){return"constant"===this.value.kind},pi.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},pi.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var hi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};hi.prototype.get=function(t){return this._values[t]};var fi=function(t){this.specification=t};fi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},fi.prototype.interpolate=function(t,e,r){var n=Ve[this.specification.type];return n?n(t,e,r):t};var di=function(t,e){this.specification=t,this.overrides=e};di.prototype.possiblyEvaluate=function(t,e,r,n){return new pi(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},di.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new pi(this,{kind:"constant",value:void 0},t.parameters);var n=Ve[this.specification.type];return n?new pi(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},di.prototype.evaluate=function(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new pi(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new pi(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new pi(this,{kind:"constant",value:s},e)}return new pi(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(di),gi=function(t){this.specification=t};gi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new ii(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ii(Math.floor(e.zoom),e)),t.expression.evaluate(new ii(Math.floor(e.zoom+1),e)),e)}},gi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},gi.prototype.interpolate=function(t){return t};var yi=function(t){this.specification=t};yi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},yi.prototype.interpolate=function(){return!1};var vi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new ai(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new oi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};On("DataDrivenProperty",di),On("DataConstantProperty",fi),On("CrossFadedDataDrivenProperty",mi),On("CrossFadedProperty",gi),On("ColorRampProperty",yi);var _i=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ci(r.layout)),r.paint)){for(var n in this._transitionablePaint=new si(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new hi(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Cn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Sn,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],a=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||i||this._handleOverridablePaintPropertyUpdate(t,o,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Ln(this,t.call(An,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Mt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof pi&&Er(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(At),xi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},wi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ti(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=xi[t.type].BYTES_PER_ELEMENT,a=r=ki(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:ki(r,Math.max(n,e)),alignment:e}}function ki(t,e){return Math.ceil(t/e)*e}wi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},wi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},wi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},wi.prototype.clear=function(){this.length=0},wi.prototype.resize=function(t){this.reserve(t),this.length=t},wi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},wi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(wi);Ai.prototype.bytesPerElement=4,On("StructArrayLayout2i4",Ai);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(wi);Mi.prototype.bytesPerElement=8,On("StructArrayLayout4i8",Mi);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(wi);Si.prototype.bytesPerElement=12,On("StructArrayLayout2i4i12",Si);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(wi);Ci.prototype.bytesPerElement=8,On("StructArrayLayout2i4ub8",Ci);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l,u)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c){var p=9*t,h=18*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.uint8[h+16]=u,this.uint8[h+17]=c,t},e}(wi);Li.prototype.bytesPerElement=18,On("StructArrayLayout8ui2ub18",Li);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,l,u,c,p)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=p,this.int16[f+11]=h,t},e}(wi);Ei.prototype.bytesPerElement=24,On("StructArrayLayout4i4ui4i24",Ei);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(wi);Ii.prototype.bytesPerElement=12,On("StructArrayLayout3f12",Ii);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(wi);zi.prototype.bytesPerElement=4,On("StructArrayLayout1ul4",zi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u){var c=10*t,p=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[p+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(wi);Pi.prototype.bytesPerElement=20,On("StructArrayLayout6i1ul2ui20",Pi);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(wi);Di.prototype.bytesPerElement=12,On("StructArrayLayout2i2i2i12",Di);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(wi);Oi.prototype.bytesPerElement=16,On("StructArrayLayout2f1f2i16",Oi);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(wi);Ri.prototype.bytesPerElement=12,On("StructArrayLayout2ub2f12",Ri);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(wi);Fi.prototype.bytesPerElement=6,On("StructArrayLayout3ui6",Fi);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g,y){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[_+2]=a,this.uint32[_+3]=o,this.uint32[_+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[_+7]=p,this.float32[_+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=g,this.int16[v+22]=y,t},e}(wi);Bi.prototype.bytesPerElement=48,On("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g,y,v,_,x,b,w,T,k,A,M,S){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g,y,v,_,x,b,w,T,k,A,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g,y,v,_,x,b,w,T,k,A,M,S,C){var L=34*t,E=17*t;return this.int16[L+0]=e,this.int16[L+1]=r,this.int16[L+2]=n,this.int16[L+3]=i,this.int16[L+4]=a,this.int16[L+5]=o,this.int16[L+6]=s,this.int16[L+7]=l,this.uint16[L+8]=u,this.uint16[L+9]=c,this.uint16[L+10]=p,this.uint16[L+11]=h,this.uint16[L+12]=f,this.uint16[L+13]=d,this.uint16[L+14]=m,this.uint16[L+15]=g,this.uint16[L+16]=y,this.uint16[L+17]=v,this.uint16[L+18]=_,this.uint16[L+19]=x,this.uint16[L+20]=b,this.uint16[L+21]=w,this.uint16[L+22]=T,this.uint32[E+12]=k,this.float32[E+13]=A,this.float32[E+14]=M,this.float32[E+15]=S,this.float32[E+16]=C,t},e}(wi);Ni.prototype.bytesPerElement=68,On("StructArrayLayout8i15ui1ul4f68",Ni);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(wi);Ui.prototype.bytesPerElement=4,On("StructArrayLayout1f4",Ui);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(wi);ji.prototype.bytesPerElement=6,On("StructArrayLayout3i6",ji);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(wi);Vi.prototype.bytesPerElement=8,On("StructArrayLayout1ul2ui8",Vi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(wi);qi.prototype.bytesPerElement=4,On("StructArrayLayout2ui4",qi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(wi);Hi.prototype.bytesPerElement=2,On("StructArrayLayout1ui2",Hi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(wi);Zi.prototype.bytesPerElement=8,On("StructArrayLayout2f8",Zi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(wi);Gi.prototype.bytesPerElement=16,On("StructArrayLayout4f16",Gi);var Xi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(bi);Xi.prototype.size=20;var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xi(this,t)},e}(Pi);On("CollisionBoxArray",Wi);var Yi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(bi);Yi.prototype.size=48;var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yi(this,t)},e}(Bi);On("PlacedSymbolArray",Ki);var Ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(bi);Ji.prototype.size=68;var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ji(this,t)},e}(Ni);On("SymbolInstanceArray",Qi);var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Ui);On("GlyphOffsetArray",$i);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(ji);On("SymbolLineVertexArray",ta);var ea=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(bi);ea.prototype.size=8;var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ea(this,t)},e}(Vi);On("FeatureIndexArray",ra);var na=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,ia=function(t){void 0===t&&(t=[]),this.segments=t};function aa(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}ia.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>ia.MAX_VERTEX_ARRAY_LENGTH&&b("Max vertices per segment is "+ia.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>ia.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},ia.prototype.get=function(){return this.segments},ia.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},ia.simpleSegment=function(t,e,r,n){return new ia([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},ia.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,On("SegmentVector",ia);var oa=Ti([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint8"},{name:"a_pixel_ratio_to",components:1,type:"Uint8"}]),sa=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,l,u;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),la=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ua=sa,ca=la;ua.murmur3=sa,ua.murmur2=ca;var pa=function(){this.ids=[],this.positions=[],this.indexed=!1};pa.prototype.add=function(t,e,r,n){this.ids.push(fa(t)),this.positions.push(e,r,n)},pa.prototype.getPositions=function(t){for(var e=fa(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},pa.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n<i;){for(var a=e[n+i>>1],o=n-1,s=i+1;;){do{o++}while(e[o]<a);do{s--}while(e[s]>a);if(o>=s)break;da(e,o,s),da(r,3*o,3*s),da(r,3*o+1,3*s+1),da(r,3*o+2,3*s+2)}s-n<i-s?(t(e,r,n,s),n=s+1):(t(e,r,s+1,i),i=s)}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},pa.deserialize=function(t){var e=new pa;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ha=Math.pow(2,53)-1;function fa(t){var e=+t;return!isNaN(e)&&e<=ha?e:ua(String(t))}function da(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}On("FeaturePositionMap",pa);var ma=function(t,e){this.gl=t.gl,this.location=e},ga=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(ma),ya=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(ma),va=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(ma),_a=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(ma),xa=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(ma),ba=function(t){function e(e,r){t.call(this,e,r),this.current=Jt.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(ma),wa=new Float32Array(16),Ta=function(t){function e(e,r){t.call(this,e,r),this.current=wa}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(ma);function ka(t){return[aa(255*t.r,255*t.g),aa(255*t.b,255*t.a)]}var Aa=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};Aa.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},Aa.prototype.getBinding=function(t,e,r){return"color"===this.type?new ba(t,e):new ya(t,e)};var Ma=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Ma.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Ma.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)},Ma.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new xa(t,e):new ya(t,e)};var Sa=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Sa.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new ii(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)},Sa.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},Sa.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=ka(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Sa.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Sa.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Ca=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};Ca.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new ii(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new ii(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)},Ca.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)},Ca.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=ka(r),a=ka(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},Ca.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ca.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Ca.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=l(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},Ca.prototype.getBinding=function(t,e,r){return new ya(t,e)};var La=function(t,e,r,n,i,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};La.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)},La.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},La.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=n[r.min],a=n[r.mid],o=n[r.max];if(i&&a&&o)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],a.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],a.pixelRatio,o.pixelRatio)}},La.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,oa.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,oa.members,this.expression.isStateDependent))},La.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Ea=function(t,e,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof pi&&Er(o.property.specification)){var s=za(a,t.type),l=o.value,u=o.property.specification.type,c=o.property.useIntegerZoom,p=o.property.specification["property-type"],h="cross-faded"===p||"cross-faded-data-driven"===p;if("constant"===l.kind)this.binders[a]=h?new Ma(l.value,s):new Aa(l.value,s,u),i.push("/u_"+a);else if("source"===l.kind||h){var f=Pa(a,u,"source");this.binders[a]=h?new La(l,u,c,e,f,t.id):new Sa(l,s,u,f),i.push("/a_"+a)}else{var d=Pa(a,u,"composite");this.binders[a]=new Ca(l,s,u,c,e,d),i.push("/z_"+a)}}}this.cacheKey=i.sort().join("")};Ea.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Sa||e instanceof Ca?e.maxValue:0},Ea.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof Sa||o instanceof Ca||o instanceof La)&&o.populatePaintArray(t,e,r,n,i)}},Ea.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof Ma&&n.setConstantPatternPositions(t,e)}},Ea.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,l=e.getPositions(o);s<l.length;s+=1){var u=l[s],c=r.feature(u.index);for(var p in this.binders){var h=this.binders[p];if((h instanceof Sa||h instanceof Ca||h instanceof La)&&!0===h.expression.isStateDependent){var f=n.paint.get(p);h.expression=f.value,h.updatePaintArray(u.start,u.end,c,t[o],i),a=!0}}}return a},Ea.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Aa||r instanceof Ma)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Ea.prototype.getPaintVertexBuffers=function(){return this._buffers},Ea.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof Aa||i instanceof Ma||i instanceof Ca)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var l=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:l})}}}return r},Ea.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property;this.binders[l].setUniform(o.binding,n,r.get(l),s)}},Ea.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof La){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof Sa||r instanceof Ca)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Ea.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Sa||r instanceof Ca||r instanceof La)&&r.upload(t)}this.updatePaintBuffers()},Ea.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Sa||e instanceof Ca||e instanceof La)&&e.destroy()}};var Ia=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=new Ea(o,r,n,t)}this.needsUpload=!1,this._featureMap=new pa,this._bufferOffset=0};function za(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Pa(t,e,r){var n={color:{source:Zi,composite:Gi},number:{source:Ui,composite:Zi}},i=function(t){return{"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[t]}(t);return i&&i[r]||n[e][r]}Ia.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Ia.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload}},Ia.prototype.get=function(t){return this.programConfigurations[t]},Ia.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Ia.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},On("ConstantBinder",Aa),On("CrossFadedConstantBinder",Ma),On("SourceExpressionBinder",Sa),On("CrossFadedCompositeBinder",La),On("CompositeExpressionBinder",Ca),On("ProgramConfiguration",Ea,{omit:["_buffers"]}),On("ProgramConfigurationSet",Ia);var Da={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function Oa(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<Da.min||o.x>Da.max||o.y<Da.min||o.y>Da.max)&&(b("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=l(o.x,Da.min,Da.max),o.y=l(o.y,Da.min,Da.max))}return r}function Ra(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Fa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ai,this.indexArray=new Fi,this.segments=new ia,this.programConfigurations=new Ia(na,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ba(t,e){for(var r=0;r<t.length;r++)if(Xa(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(Xa(t,e[n]))return!0;return!!Va(t,e)}function Na(t,e,r){return!!Xa(t,e)||!!Ha(e,t,r)}function Ua(t,e){if(1===t.length)return Ga(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Xa(t,n[i]))return!0;for(var a=0;a<t.length;a++)if(Ga(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(Va(t,e[o]))return!0;return!1}function ja(t,e,r){if(t.length>1){if(Va(t,e))return!0;for(var n=0;n<e.length;n++)if(Ha(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Ha(t[i],e,r))return!0;return!1}function Va(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(qa(n,i,e[a],e[a+1]))return!0;return!1}function qa(t,e,r,n){return w(t,r,n)!==w(e,r,n)&&w(t,e,r)!==w(t,e,n)}function Ha(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Za(t,e[i-1],e[i])<n)return!0;return!1}function Za(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Ga(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).length-1;s<r.length;l=s++)(n=r[s]).y>e.y!=(i=r[l]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Xa(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Wa(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var a=w(t,e,r[0]);return a!==w(t,e,r[1])||a!==w(t,e,r[2])||a!==w(t,e,r[3])}function Ya(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ka(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ja(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(o));return s}Fa.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var l=s[o],u=l.feature,c=l.id,p=l.index,h=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d={type:u.type,id:c,properties:u.properties,geometry:f?Oa(u):[]};if(this.layers[0]._featureFilter.filter(new ii(this.zoom),d,r)){f||(d.geometry=Oa(u));var m=a?a.evaluate(d,{},r):void 0;i.push({id:c,properties:u.properties,type:u.type,sourceLayerIndex:h,index:p,geometry:d.geometry,patterns:{},sortKey:m})}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],_=v.geometry,x=v.index,b=v.sourceLayerIndex,w=t[x].feature;this.addFeature(v,_,x,r),e.featureIndex.insert(w,_,x,b,this.index)}},Fa.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Fa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Fa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,na),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Fa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fa.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var l=s[o],u=l.x,c=l.y;if(!(u<0||u>=8192||c<0||c>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=p.vertexLength;Ra(this.layoutVertexArray,u,c,-1,-1),Ra(this.layoutVertexArray,u,c,1,-1),Ra(this.layoutVertexArray,u,c,1,1),Ra(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},On("CircleBucket",Fa,{omit:["layers"]});var Qa=new vi({"circle-sort-key":new di(Mt.layout_circle["circle-sort-key"])}),$a={paint:new vi({"circle-radius":new di(Mt.paint_circle["circle-radius"]),"circle-color":new di(Mt.paint_circle["circle-color"]),"circle-blur":new di(Mt.paint_circle["circle-blur"]),"circle-opacity":new di(Mt.paint_circle["circle-opacity"]),"circle-translate":new fi(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new fi(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new fi(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new fi(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new di(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new di(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new di(Mt.paint_circle["circle-stroke-opacity"])}),layout:Qa},to="undefined"!=typeof Float32Array?Float32Array:Array;function eo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ro(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*i+x*l+b*h+w*g,t[2]=_*a+x*u+b*f+w*y,t[3]=_*o+x*c+b*d+w*v,t[4]=(_=r[4])*n+(x=r[5])*s+(b=r[6])*p+(w=r[7])*m,t[5]=_*i+x*l+b*h+w*g,t[6]=_*a+x*u+b*f+w*y,t[7]=_*o+x*c+b*d+w*v,t[8]=(_=r[8])*n+(x=r[9])*s+(b=r[10])*p+(w=r[11])*m,t[9]=_*i+x*l+b*h+w*g,t[10]=_*a+x*u+b*f+w*y,t[11]=_*o+x*c+b*d+w*v,t[12]=(_=r[12])*n+(x=r[13])*s+(b=r[14])*p+(w=r[15])*m,t[13]=_*i+x*l+b*h+w*g,t[14]=_*a+x*u+b*f+w*y,t[15]=_*o+x*c+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var no,io=ro;function ao(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}no=new to(3),to!=Float32Array&&(no[0]=0,no[1]=0,no[2]=0),function(){var t=new to(4);to!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var oo=(function(){var t=new to(2);to!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,$a)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Fa(t)},e.prototype.queryRadius=function(t){var e=t;return Ya("circle-radius",this,e)+Ya("circle-stroke-width",this,e)+Ka(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=Ja(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),p=c?l:function(t,e){return t.map((function(t){return so(t,e)}))}(l,s),h=c?u*o:u,f=0,d=n;f<d.length;f+=1)for(var m=0,g=d[f];m<g.length;m+=1){var y=g[m],v=c?y:so(y,s),_=h,x=ao([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=a.cameraToCenterDistance/x[3]),Na(p,v,_))return!0}return!1},e}(_i));function so(t,e){var r=ao([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Fa);function uo(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function co(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=uo({},{width:n,height:i},r);po(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}}function po(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<i.height;l++)for(var u=((r.y+l)*t.width+r.x)*a,c=((n.y+l)*e.width+n.x)*a,p=0;p<i.width*a;p++)s[c+p]=o[u+p];return e}On("HeatmapBucket",lo,{omit:["layers"]});var ho=function(t,e){uo(this,t,1,e)};ho.prototype.resize=function(t){co(this,t,1)},ho.prototype.clone=function(){return new ho({width:this.width,height:this.height},new Uint8Array(this.data))},ho.copy=function(t,e,r,n,i){po(t,e,r,n,i,1)};var fo=function(t,e){uo(this,t,4,e)};fo.prototype.resize=function(t){co(this,t,4)},fo.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},fo.prototype.clone=function(){return new fo({width:this.width,height:this.height},new Uint8Array(this.data))},fo.copy=function(t,e,r,n,i){po(t,e,r,n,i,4)},On("AlphaImage",ho),On("RGBAImage",fo);var mo={paint:new vi({"heatmap-radius":new di(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new di(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new fi(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new yi(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new fi(Mt.paint_heatmap["heatmap-opacity"])})};function go(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a)}return new fo({width:256,height:1},r)}var yo=function(t){function e(e){t.call(this,e,mo),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new lo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=go(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(_i),vo={paint:new vi({"hillshade-illumination-direction":new fi(Mt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new fi(Mt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new fi(Mt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new fi(Mt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new fi(Mt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new fi(Mt.paint_hillshade["hillshade-accent-color"])})},_o=function(t){function e(e){t.call(this,e,vo)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(_i),xo=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,bo=To,wo=To;function To(t,e,r){r=r||2;var n,i,a,o,s,l,u,c=e&&e.length,p=c?e[0]*r:t.length,h=ko(t,0,p,r,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=ko(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(Oo(o));for(s.sort(Io),i=0;i<s.length;i++)zo(s[i],r),r=Ao(r,r.next);return r}(t,e,h,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var d=r;d<p;d+=r)(s=t[d])<n&&(n=s),(l=t[d+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return Mo(h,f,r,n,i,u),f}function ko(t,e,r,n,i){var a,o;if(i===Wo(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Zo(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Zo(a,t[a],t[a+1],o);return o&&No(o,o.next)&&(Go(o),o=o.next),o}function Ao(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!No(n,n.next)&&0!==Bo(n.prev,n,n.next))n=n.next;else{if(Go(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Mo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Do(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Co(t,n,i,a):So(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Go(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?Mo(t=Lo(Ao(t),e,r),e,r,n,i,a,2):2===o&&Eo(t,e,r,n,i,a):Mo(Ao(t),e,r,n,i,a,1);break}}}function So(t){var e=t.prev,r=t,n=t.next;if(Bo(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ro(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Bo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Co(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Bo(i,a,o)>=0)return!1;for(var s=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=Do(i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,e,r,n),c=Do(s,l,e,r,n),p=t.prevZ,h=t.nextZ;p&&p.z>=u&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&Ro(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Bo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&Ro(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Bo(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&Ro(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Bo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&Ro(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Bo(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function Lo(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!No(i,a)&&Uo(i,n,n.next,a)&&qo(i,a)&&qo(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Go(n),Go(n.next),n=t=a),n=n.next}while(n!==t);return Ao(n)}function Eo(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Fo(o,s)){var l=Ho(o,s);return o=Ao(o,o.next),l=Ao(l,l.next),Mo(o,e,r,n,i,a),void Mo(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Io(t,e){return t.x-e.x}function zo(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r;var l,u=r,c=r.x,p=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&Ro(a<p?i:o,a,c,p,a<p?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),qo(n,t)&&(l<h||l===h&&(n.x>r.x||n.x===r.x&&Po(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=Ho(e,t);Ao(e,e.next),Ao(r,r.next)}}function Po(t,e){return Bo(t.prev,t,e.prev)<0&&Bo(e.next,t,t.next)<0}function Do(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Oo(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Ro(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Fo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Uo(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(qo(t,e)&&qo(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Bo(t.prev,t,e.prev)||Bo(t,e.prev,e))||No(t,e)&&Bo(t.prev,t,t.next)>0&&Bo(e.prev,e,e.next)>0)}function Bo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function No(t,e){return t.x===e.x&&t.y===e.y}function Uo(t,e,r,n){var i=Vo(Bo(t,e,r)),a=Vo(Bo(t,e,n)),o=Vo(Bo(r,n,t)),s=Vo(Bo(r,n,e));return i!==a&&o!==s||!(0!==i||!jo(t,r,e))||!(0!==a||!jo(t,n,e))||!(0!==o||!jo(r,t,n))||!(0!==s||!jo(r,e,n))}function jo(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Vo(t){return t>0?1:t<0?-1:0}function qo(t,e){return Bo(t.prev,t,t.next)<0?Bo(t,e,t.next)>=0&&Bo(t,t.prev,e)>=0:Bo(t,e,t.prev)<0||Bo(t,t.next,e)<0}function Ho(t,e){var r=new Xo(t.i,t.x,t.y),n=new Xo(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Zo(t,e,r,n){var i=new Xo(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Go(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Xo(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Wo(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Yo(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var p=e[r],h=n,f=i;for(Ko(e,n,r),a(e[i],p)>0&&Ko(e,n,i);h<f;){for(Ko(e,h,f),h++,f--;a(e[h],p)<0;)h++;for(;a(e[f],p)>0;)f--}0===a(e[n],p)?Ko(e,n,f):Ko(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||Jo)}function Ko(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Jo(t,e){return t<e?-1:t>e?1:0}function Qo(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o<r;o++){var s=T(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]))}if(n&&a.push(n),e>1)for(var l=0;l<a.length;l++)a[l].length<=e||(Yo(a[l],e,1,a[l].length-1,$o),a[l]=a[l].slice(0,e));return a}function $o(t,e){return e.area-t.area}function ts(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function es(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},r,{},i.availableImages),p=u.evaluate({zoom:n},r,{},i.availableImages),h=u.evaluate({zoom:n+1},r,{},i.availableImages);p=p&&p.name?p.name:p,h=h&&h.name?h.name:h,a[c=c&&c.name?c.name:c]=!0,a[p]=!0,a[h]=!0,r.patterns[l.id]={min:c,mid:p,max:h}}}return r}To.deviation=function(t,e,r,n){var i=e&&e.length,a=Math.abs(Wo(t,0,i?e[0]*r:t.length,r));if(i)for(var o=0,s=e.length;o<s;o++)a-=Math.abs(Wo(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r));var l=0;for(o=0;o<n.length;o+=3){var u=n[o]*r,c=n[o+1]*r,p=n[o+2]*r;l+=Math.abs((t[u]-t[p])*(t[c+1]-t[u+1])-(t[u]-t[c])*(t[p+1]-t[u+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},To.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&r.holes.push(n+=t[i-1].length)}return r},bo.default=wo;var rs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ai,this.indexArray=new Fi,this.indexArray2=new qi,this.programConfigurations=new Ia(xo,t.layers,t.zoom),this.segments=new ia,this.segments2=new ia,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};rs.prototype.populate=function(t,e,r){this.hasPattern=ts("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:h?Oa(l):[]};if(this.layers[0]._featureFilter.filter(new ii(this.zoom),f,r)){h||(f.geometry=Oa(l));var d=n?n.evaluate(f,{},r,e.availableImages):void 0;i.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f.geometry,patterns:{},sortKey:d})}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,g=i;m<g.length;m+=1){var y=g[m],v=y.geometry,_=y.index,x=y.sourceLayerIndex;if(this.hasPattern){var b=es("fill",this.layers,y,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(y,v,_,r,{});e.featureIndex.insert(t[_].feature,v,_,x,this.index)}},rs.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},rs.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},rs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},rs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},rs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xo),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},rs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},rs.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Qo(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),h=p.vertexLength,f=[],d=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&d.push(f.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),_=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(_+y.length-1,_),f.push(y[0].x),f.push(y[0].y);for(var x=1;x<y.length;x++)this.layoutVertexArray.emplaceBack(y[x].x,y[x].y),this.indexArray2.emplaceBack(_+x-1,_+x),f.push(y[x].x),f.push(y[x].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var b=bo(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(h+b[w],h+b[w+1],h+b[w+2]);p.vertexLength+=l,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},On("FillBucket",rs,{omit:["layers","patternFeatures"]});var ns=new vi({"fill-sort-key":new di(Mt.layout_fill["fill-sort-key"])}),is={paint:new vi({"fill-antialias":new fi(Mt.paint_fill["fill-antialias"]),"fill-opacity":new di(Mt.paint_fill["fill-opacity"]),"fill-color":new di(Mt.paint_fill["fill-color"]),"fill-outline-color":new di(Mt.paint_fill["fill-outline-color"]),"fill-translate":new fi(Mt.paint_fill["fill-translate"]),"fill-translate-anchor":new fi(Mt.paint_fill["fill-translate-anchor"]),"fill-pattern":new mi(Mt.paint_fill["fill-pattern"])}),layout:ns},as=function(t){function e(e){t.call(this,e,is)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new rs(t)},e.prototype.queryRadius=function(){return Ka(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return Ua(Ja(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(_i),os=Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ss=ls;function ls(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(us,this,e)}function us(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function cs(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}ls.types=["Unknown","Point","LineString","Polygon"],ls.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,l=[];t.pos<r;){if(a<=0){var u=t.readVarint();n=7&u,a=u>>3}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},ls.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},ls.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=ls.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(n=0;n<l.length;n++)p[n]=l[n][0];c(l=p);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=cs(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var h={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var ps=hs;function hs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(fs,this,e),this.length=this._features.length}function fs(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ds(t,e,r){if(3===t){var n=new ps(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}hs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ss(this._pbf,e,this.extent,this._keys,this._values)};var ms={VectorTile:function(t,e){this.layers=t.readFields(ds,{},e)},VectorTileFeature:ss,VectorTileLayer:ps},gs=ms.VectorTileFeature.types,ys=Math.pow(2,13);function vs(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*ys)+o,i*ys*2,a*ys*2,Math.round(s))}var _s=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Si,this.indexArray=new Fi,this.programConfigurations=new Ia(os,t.layers,t.zoom),this.segments=new ia,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function xs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}_s.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ts("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,l=a.index,u=a.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,p={type:o.type,id:s,properties:o.properties,geometry:c?Oa(o):[]};if(this.layers[0]._featureFilter.filter(new ii(this.zoom),p,r)){var h={id:s,sourceLayerIndex:u,index:l,geometry:c?p.geometry:Oa(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(h.id=o.id),this.hasPattern?this.features.push(es("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,l,r,{}),e.featureIndex.insert(o,h.geometry,l,u,this.index,!0)}}},_s.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},_s.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},_s.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_s.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_s.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,os),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},_s.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},_s.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=Qo(e,500);a<o.length;a+=1){for(var s=o[a],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=s;h<f.length;h+=1){var d=f[h];if(0!==d.length&&!((z=d).every((function(t){return t.x<0}))||z.every((function(t){return t.x>8192}))||z.every((function(t){return t.y<0}))||z.every((function(t){return t.y>8192}))))for(var m=0,g=0;g<d.length;g++){var y=d[g];if(g>=1){var v=d[g-1];if(!xs(y,v)){p.vertexLength+4>ia.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=y.sub(v)._perp()._unit(),x=v.dist(y);m+x>32768&&(m=0),vs(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,0,m),vs(this.layoutVertexArray,y.x,y.y,_.x,_.y,0,1,m),vs(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m+=x),vs(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+l>ia.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===gs[t.type]){for(var w=[],T=[],k=p.vertexLength,A=0,M=s;A<M.length;A+=1){var S=M[A];if(0!==S.length){S!==s[0]&&T.push(w.length/2);for(var C=0;C<S.length;C++){var L=S[C];vs(this.layoutVertexArray,L.x,L.y,0,0,1,1,0),w.push(L.x),w.push(L.y)}}}for(var E=bo(w,T),I=0;I<E.length;I+=3)this.indexArray.emplaceBack(k+E[I],k+E[I+2],k+E[I+1]);p.primitiveLength+=E.length/3,p.vertexLength+=l}}var z;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},On("FillExtrusionBucket",_s,{omit:["layers","features"]});var bs={paint:new vi({"fill-extrusion-opacity":new fi(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new di(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new fi(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new fi(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new mi(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new di(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new di(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new fi(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ws=function(t){function e(e){t.call(this,e,bs)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new _s(t)},e.prototype.queryRadius=function(){return Ka(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,l){var u=Ja(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),p=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,n){for(var a=[],o=0,s=t;o<s.length;o+=1){var l=s[o],u=[l.x,l.y,0,1];ao(u,u,e),a.push(new i(u[0]/u[3],u[1]/u[3]))}return a}(u,l),f=function(t,e,r,n){for(var a=[],o=[],s=n[8]*e,l=n[9]*e,u=n[10]*e,c=n[11]*e,p=n[8]*r,h=n[9]*r,f=n[10]*r,d=n[11]*r,m=0,g=t;m<g.length;m+=1){for(var y=[],v=[],_=0,x=g[m];_<x.length;_+=1){var b=x[_],w=b.x,T=b.y,k=n[0]*w+n[4]*T+n[12],A=n[1]*w+n[5]*T+n[13],M=n[2]*w+n[6]*T+n[14],S=n[3]*w+n[7]*T+n[15],C=M+u,L=S+c,E=k+p,I=A+h,z=M+f,P=S+d,D=new i((k+s)/L,(A+l)/L);D.z=C/L,y.push(D);var O=new i(E/P,I/P);O.z=z/P,v.push(O)}a.push(y),o.push(v)}return[a,o]}(n,p,c,l);return function(t,e,r){var n=1/0;Ua(r,e)&&(n=ks(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var l=a[s],u=[l,a[s+1],o[s+1],o[s],l];Ba(r,u)&&(n=Math.min(n,ks(r,u)))}return n!==1/0&&n}(f[0],f[1],h)},e}(_i);function Ts(t,e){return t.x*e.x+t.y*e.y}function ks(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),l=a.sub(i),u=o.sub(i),c=Ts(s,s),p=Ts(s,l),h=Ts(l,l),f=Ts(u,s),d=Ts(u,l),m=c*h-p*p,g=(h*f-p*d)/m,y=(c*d-p*f)/m,v=i.z*(1-g-y)+r.z*g+a.z*y;if(isFinite(v))return v}return 1/0}for(var _=1/0,x=0,b=e;x<b.length;x+=1)_=Math.min(_,b[x].z);return _}var As=Ti([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ms=ms.VectorTileFeature.types,Ss=Math.cos(Math.PI/180*37.5),Cs=Math.pow(2,14)/.5,Ls=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ci,this.indexArray=new Fi,this.programConfigurations=new Ia(As,t.layers,t.zoom),this.segments=new ia,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ls.prototype.populate=function(t,e,r){this.hasPattern=ts("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.id,c=s.index,p=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:l.type,id:u,properties:l.properties,geometry:h?Oa(l):[]};if(this.layers[0]._featureFilter.filter(new ii(this.zoom),f,r)){h||(f.geometry=Oa(l));var d=n?n.evaluate(f,{},r):void 0;i.push({id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f.geometry,patterns:{},sortKey:d})}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,g=i;m<g.length;m+=1){var y=g[m],v=y.geometry,_=y.index,x=y.sourceLayerIndex;if(this.hasPattern){var b=es("line",this.layers,y,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(y,v,_,r,{});e.featureIndex.insert(t[_].feature,v,_,x,this.index)}},Ls.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ls.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r)}},Ls.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ls.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ls.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,As),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ls.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ls.prototype.addFeature=function(t,e,r,n,i){for(var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit"),c=0,p=e;c<p.length;c+=1)this.addLine(p[c],t,o,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Ls.prototype.addLine=function(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance()}for(var s="Polygon"===Ms[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var c,p=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(g=t[u].sub(c=t[l-2])._unit()._perp());for(var y=u;y<l;y++)if(!(d=y===l-1?s?t[u+1]:void 0:t[y+1])||!t[y].equals(d)){g&&(m=g),c&&(f=c),c=t[y],g=d?d.sub(c)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var _=m.x*g.x+m.y*g.y,x=v.x*g.x+v.y*g.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),T=x<Ss&&f&&d,k=m.x*g.y-m.y*g.x>0;if(T&&y>u){var A=c.dist(f);if(A>2*p){var M=c.sub(c.sub(f)._mult(p/A)._round());this.updateDistance(f,M),this.addCurrentVertex(M,m,0,0,h),f=M}}var S=f&&d,C=S?r:s?"butt":n;if(S&&"round"===C&&(b<a?C="miter":b<=2&&(C="fakeround")),"miter"===C&&b>i&&(C="bevel"),"bevel"===C&&(b>2&&(C="flipbevel"),b<i&&(C="miter")),f&&this.updateDistance(f,c),"miter"===C)v._mult(b),this.addCurrentVertex(c,v,0,0,h);else if("flipbevel"===C){if(b>100)v=g.mult(-1);else{var L=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(L*(k?-1:1))}this.addCurrentVertex(c,v,0,0,h),this.addCurrentVertex(c,v.mult(-1),0,0,h)}else if("bevel"===C||"fakeround"===C){var E=-Math.sqrt(b*b-1),I=k?E:0,z=k?0:E;if(f&&this.addCurrentVertex(c,m,I,z,h),"fakeround"===C)for(var P=Math.round(180*w/Math.PI/20),D=1;D<P;D++){var O=D/P;if(.5!==O){var R=O-.5;O+=O*R*(O-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*R*R+(.848013+_*(.215638*_-1.06021)))}var F=g.sub(m)._mult(O)._add(m)._unit()._mult(k?-1:1);this.addHalfVertex(c,F.x,F.y,!1,k,0,h)}d&&this.addCurrentVertex(c,g,-I,-z,h)}else if("butt"===C)this.addCurrentVertex(c,v,0,0,h);else if("square"===C){var B=f?1:-1;this.addCurrentVertex(c,v,B,B,h)}else"round"===C&&(f&&(this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m,1,1,h,!0)),d&&(this.addCurrentVertex(c,g,-1,-1,h,!0),this.addCurrentVertex(c,g,0,0,h)));if(T&&y<l-1){var N=c.dist(d);if(N>2*p){var U=c.add(d.sub(c)._mult(p/N)._round());this.updateDistance(c,U),this.addCurrentVertex(U,g,0,0,h),c=U}}}}},Ls.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>Cs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},Ls.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&s)<<2,s>>6);var l=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),o.primitiveLength++),i?this.e2=l:this.e1=l},Ls.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Cs-1):this.distance},Ls.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},On("LineBucket",Ls,{omit:["layers","patternFeatures"]});var Es=new vi({"line-cap":new fi(Mt.layout_line["line-cap"]),"line-join":new di(Mt.layout_line["line-join"]),"line-miter-limit":new fi(Mt.layout_line["line-miter-limit"]),"line-round-limit":new fi(Mt.layout_line["line-round-limit"]),"line-sort-key":new di(Mt.layout_line["line-sort-key"])}),Is={paint:new vi({"line-opacity":new di(Mt.paint_line["line-opacity"]),"line-color":new di(Mt.paint_line["line-color"]),"line-translate":new fi(Mt.paint_line["line-translate"]),"line-translate-anchor":new fi(Mt.paint_line["line-translate-anchor"]),"line-width":new di(Mt.paint_line["line-width"]),"line-gap-width":new di(Mt.paint_line["line-gap-width"]),"line-offset":new di(Mt.paint_line["line-offset"]),"line-blur":new di(Mt.paint_line["line-blur"]),"line-dasharray":new gi(Mt.paint_line["line-dasharray"]),"line-pattern":new mi(Mt.paint_line["line-pattern"]),"line-gradient":new yi(Mt.paint_line["line-gradient"])}),layout:Es},zs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ii(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(di))(Is.paint.properties["line-width"].specification);zs.useIntegerZoom=!0;var Ps=function(t){function e(e){t.call(this,e,Is)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){this.gradient=go(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=zs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ls(t)},e.prototype.queryRadius=function(t){var e=t,r=Ds(Ya("line-width",this,e),Ya("line-gap-width",this,e)),n=Ya("line-offset",this,e);return r/2+Math.abs(n)+Ka(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var l=Ja(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*Ds(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],l=0;l<o.length;l++){var u=o[l],c=o[l+1],p=0===l?n:u.sub(o[l-1])._unit()._perp(),h=l===o.length-1?n:c.sub(u)._unit()._perp(),f=p._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(u))}r.push(s)}return r}(n,c*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(Xa(t,i[a]))return!0;if(ja(t,i,r))return!0}return!1}(l,n,u)},e.prototype.isTileClipped=function(){return!0},e}(_i);function Ds(t,e){return e>0?e+2*t:t}var Os=Ti([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Rs=Ti([{name:"a_projected_pos",components:3,type:"Float32"}],4),Fs=(Ti([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ti([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Bs=(Ti([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ns=Ti([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Us(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ni.applyArabicShaping&&(t=ni.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ti([{name:"triangle",components:3,type:"Uint16"}]),Ti([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ti([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ti([{type:"Float32",name:"offsetX"}]),Ti([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var js={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Vs=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+t[e+p],p+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+p],p+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=u}return(f?-1:1)*o*Math.pow(2,a-n)},qs=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(e*l-1)*Math.pow(2,i),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+f]=255&o,f+=d,o/=256,u-=8);t[r+f-d]|=128*m},Hs=Zs;function Zs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Zs.Varint=0,Zs.Fixed64=1,Zs.Bytes=2,Zs.Fixed32=5;var Gs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Xs(t){return t.type===Zs.Bytes?t.readVarint()+t.pos:t.pos+1}function Ws(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ys(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Ks(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Js(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function $s(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function tl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function el(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function rl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function nl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function il(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function al(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ol(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function sl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ll(t,e,r){1===t&&r.readMessage(ul,e)}function ul(t,e,r){if(3===t){var n=r.readMessage(cl,{}),i=n.width,a=n.height,o=n.left,s=n.top,l=n.advance;e.push({id:n.id,bitmap:new ho({width:i+6,height:a+6},n.bitmap),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function cl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function pl(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w)}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var p=c[u],h=o.length-1;h>=0;h--){var f=o[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=o.pop();h<o.length&&(o[h]=d)}else p.h===f.h?(f.x+=p.w,f.w-=p.w):p.w===f.w?(f.y+=p.h,f.h-=p.h):(o.push({x:f.x+p.w,y:f.y,w:f.w-p.w,h:p.h}),f.y+=p.h,f.h-=p.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Zs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=al(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=sl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=al(this.buf,this.pos)+4294967296*al(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=al(this.buf,this.pos)+4294967296*sl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Vs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Vs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return Ws(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return Ws(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return Ws(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return Ws(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return Ws(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return Ws(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Gs?function(t,e,r){return Gs.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Zs.Bytes)return t.push(this.readVarint(e));var r=Xs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSVarint());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Zs.Bytes)return t.push(this.readBoolean());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFloat());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Zs.Bytes)return t.push(this.readDouble());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFixed32());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSFixed32());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Zs.Bytes)return t.push(this.readFixed64());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Zs.Bytes)return t.push(this.readSFixed64());var e=Xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Zs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Zs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Zs.Fixed32)this.pos+=4;else{if(e!==Zs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ol(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ol(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ol(this.buf,-1&t,this.pos),ol(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ol(this.buf,-1&t,this.pos),ol(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ys(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),qs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),qs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ys(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Zs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ks,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Js,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,tl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Qs,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,$s,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,el,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,il,e)},writeBytesField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var hl=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},fl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};fl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},fl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},fl.tlbr.get=function(){return this.tl.concat(this.br)},fl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(hl.prototype,fl);var dl=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=pl(i),o=new fo({width:a.w||1,height:a.h||1});for(var s in t){var l=t[s],u=r[s].paddedRect;fo.copy(l.data,o,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var c in e){var p=e[c],h=n[c].paddedRect,f=h.x+1,d=h.y+1,m=p.data.width,g=p.data.height;fo.copy(p.data,o,{x:0,y:0},{x:f,y:d},p.data),fo.copy(p.data,o,{x:0,y:g-1},{x:f,y:d-1},{width:m,height:1}),fo.copy(p.data,o,{x:0,y:0},{x:f,y:d+g},{width:m,height:1}),fo.copy(p.data,o,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:g}),fo.copy(p.data,o,{x:0,y:0},{x:f+m,y:d},{width:1,height:g})}this.image=o,this.iconPositions=r,this.patternPositions=n};dl.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new hl(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},dl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},dl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},On("ImagePosition",hl),On("ImageAtlas",dl);var ml={horizontal:1,vertical:2,horizontalOnly:3},gl=function(){this.scale=1,this.fontStack="",this.imageName=null};gl.forText=function(t,e){var r=new gl;return r.scale=t||1,r.fontStack=e,r},gl.forImage=function(t){var e=new gl;return e.imageName=t,e};var yl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function vl(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m){var g,y=yl.fromFeature(t,i);p===ml.vertical&&y.verticalizePunctuation();var v=ni.processBidirectionalText,_=ni.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var x=0,b=v(y.toString(),Al(y,u,a,e,n,f,d));x<b.length;x+=1){var w=b[x],T=new yl;T.text=w,T.sections=y.sections;for(var k=0;k<w.length;k++)T.sectionIndex.push(0);g.push(T)}}else if(_){g=[];for(var A=0,M=_(y.text,y.sectionIndex,Al(y,u,a,e,n,f,d));A<M.length;A+=1){var S=M[A],C=new yl;C.text=S[0],C.sectionIndex=S[1],C.sections=y.sections,g.push(C)}}else g=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(y,Al(y,u,a,e,n,f,d));var L=[],E={positionedLines:L,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,l,u,c,p){for(var h=0,f=-17,d=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,_=i;v<_.length;v+=1){var x=_[v];x.trim();var b=x.getMaxScale(),w=24*(b-1),T={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=T;var k=T.positionedGlyphs,A=0;if(x.length()){for(var M=0;M<x.length();M++){var S=x.getSection(M),C=x.getSectionIndex(M),L=x.getCharCode(M),E=0,I=null,z=null,P=null,D=24,O=!(l===ml.horizontal||!c&&!Hn(L)||c&&(_l[L]||(H=L,Vn.Arabic(H)||Vn["Arabic Supplement"](H)||Vn["Arabic Extended-A"](H)||Vn["Arabic Presentation Forms-A"](H)||Vn["Arabic Presentation Forms-B"](H))));if(S.imageName){var R=n[S.imageName];if(!R)continue;P=S.imageName,t.iconsInText=t.iconsInText||!0,z=R.paddedRect;var F=R.displaySize;S.scale=24*S.scale/p,E=w+(24-F[1]*S.scale),D=(I={width:F[0],height:F[1],left:1,top:-3,advance:O?F[1]:F[0]}).advance;var B=O?F[0]*S.scale-24*b:F[1]*S.scale-24*b;B>0&&B>A&&(A=B)}else{var N=r[S.fontStack],U=N&&N[L];if(U&&U.rect)z=U.rect,I=U.metrics;else{var j=e[S.fontStack],V=j&&j[L];if(!V)continue;I=V.metrics}E=24*(b-S.scale)}O?(t.verticalizable=!0,k.push({glyph:L,imageName:P,x:h,y:f+E,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:I,rect:z}),h+=D*S.scale+u):(k.push({glyph:L,imageName:P,x:h,y:f+E,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:C,metrics:I,rect:z}),h+=I.advance*S.scale+u)}0!==k.length&&(d=Math.max(h-u,d),Sl(k,0,k.length-1,g,A)),h=0;var q=a*b+A;T.lineOffset=Math.max(A,w),f+=q,m=Math.max(q,m),++y}else f+=a,++y}var H,Z=f- -17,G=Ml(o),X=G.horizontalAlign,W=G.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var u,c=(e-r)*i;u=a!==o?-s*n- -17:(-n*l+.5)*o;for(var p=0,h=t;p<h.length;p+=1)for(var f=0,d=h[p].positionedGlyphs;f<d.length;f+=1){var m=d[f];m.x+=c,m.y+=u}})(t.positionedLines,g,X,W,d,m,a,Z,i.length),t.top+=-W*Z,t.bottom=t.top+Z,t.left+=-X*d,t.right=t.left+d}(E,e,r,n,g,o,s,l,p,u,h,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(L)&&E}yl.fromFeature=function(t,e){for(var r=new yl,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},yl.prototype.length=function(){return this.text.length},yl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},yl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},yl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},yl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Zn(n)&&!js[t[r+1]]||i&&Zn(i)&&!js[t[r-1]]||!js[t[r]]?t[r]:js[t[r]]}return e}(this.text)},yl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&_l[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&_l[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},yl.prototype.substring=function(t,e){var r=new yl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},yl.prototype.toString=function(){return this.text},yl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},yl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(gl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},yl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(gl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):b("Reached maximum number of images 6401")}else b("Can't add FormattedSection with an empty image.")},yl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var _l={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},xl={};function bl(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function wl(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Tl(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function kl(t,e,r,n,i,a){for(var o=null,s=wl(e,r,i,a),l=0,u=n;l<u.length;l+=1){var c=u[l],p=wl(e-c.x,r,i,a)+c.badness;p<=s&&(o=c,s=p)}return{index:t,x:e,priorBreak:o,badness:s}}function Al(t,e,r,n,i,a,o){if("point"!==a)return[];if(!t)return[];for(var s,l=[],u=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var l=t.getSection(s);o+=bl(t.getCharCode(s),l,n,i,e,a)}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),c=t.text.indexOf("\u200b")>=0,p=0,h=0;h<t.length();h++){var f=t.getSection(h),d=t.getCharCode(h);if(_l[d]||(p+=bl(d,f,n,i,e,o)),h<t.length()-1){var m=!((s=d)<11904||!(Vn["Bopomofo Extended"](s)||Vn.Bopomofo(s)||Vn["CJK Compatibility Forms"](s)||Vn["CJK Compatibility Ideographs"](s)||Vn["CJK Compatibility"](s)||Vn["CJK Radicals Supplement"](s)||Vn["CJK Strokes"](s)||Vn["CJK Symbols and Punctuation"](s)||Vn["CJK Unified Ideographs Extension A"](s)||Vn["CJK Unified Ideographs"](s)||Vn["Enclosed CJK Letters and Months"](s)||Vn["Halfwidth and Fullwidth Forms"](s)||Vn.Hiragana(s)||Vn["Ideographic Description Characters"](s)||Vn["Kangxi Radicals"](s)||Vn["Katakana Phonetic Extensions"](s)||Vn.Katakana(s)||Vn["Vertical Forms"](s)||Vn["Yi Radicals"](s)||Vn["Yi Syllables"](s)));(xl[d]||m||f.imageName)&&l.push(kl(h+1,p,u,l,Tl(d,t.getCharCode(h+1),m&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(kl(t.length(),p,u,l,0,!0))}function Ml(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Sl(t,e,r,n,i){if(n||i)for(var a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n,s=e;s<=r;s++)t[s].x-=o,t[s].y+=i}function Cl(t,e,r,n,i,a){var o,s=t.image;if(s.content){var l=s.content,u=s.pixelRatio||1;o=[l[0]/u,l[1]/u,s.displaySize[0]-l[2]/u,s.displaySize[1]-l[3]/u]}var c,p,h,f,d=e.left*a,m=e.right*a;"width"===r||"both"===r?(f=i[0]+d-n[3],p=i[0]+m+n[1]):p=(f=i[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var g=e.top*a,y=e.bottom*a;return"height"===r||"both"===r?(c=i[1]+g-n[0],h=i[1]+y+n[2]):h=(c=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:p,bottom:h,left:f,collisionPadding:o}}xl[10]=!0,xl[32]=!0,xl[38]=!0,xl[40]=!0,xl[41]=!0,xl[43]=!0,xl[45]=!0,xl[47]=!0,xl[173]=!0,xl[183]=!0,xl[8203]=!0,xl[8208]=!0,xl[8211]=!0,xl[8231]=!0;var Ll=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);function El(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new ii(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new ii(s)),maxSize:r.evaluate(new ii(l)),interpolationType:i}}function Il(t,e,r){var n=e.uSize,i=r.lowerSize;return"source"===t.kind?i/128:"composite"===t.kind?je(i/128,r.upperSize/128,e.uSizeT):n}function zl(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=i?l(rr.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=je(t.minSize,t.maxSize,a):r=a}return{uSizeT:r,uSize:n}}On("Anchor",Ll);var Pl=Object.freeze({__proto__:null,getSizeData:El,evaluateSizeForFeature:Il,evaluateSizeForZoom:zl,SIZE_PACK_FACTOR:128});function Dl(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o],p=t[o+1];if(!p)return!1;var h=t[o-1].angleTo(c)-c.angleTo(p);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:h}),u+=h;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=c.dist(p)}return!0}function Ol(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Rl(t,e,r){return t?.6*e*r:0}function Fl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Bl(t,e,r,n,i,a){for(var o=Rl(r,i,a),s=Fl(r,n)*a,l=0,u=Ol(t)/2,c=0;c<t.length-1;c++){var p=t[c],h=t[c+1],f=p.dist(h);if(l+f>u){var d=(u-l)/f,m=je(p.x,h.x,d),g=je(p.y,h.y,d),y=new Ll(m,g,h.angleTo(p),c);return y._round(),!o||Dl(t,y,s,o,e)?y:void 0}l+=f}}function Nl(t,e,r,n,i,a,o,s,l){var u=Rl(n,a,o),c=Fl(n,i),p=c*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-p<e/4&&(e=p+e/4),function t(e,r,n,i,a,o,s,l,u){for(var c=o/2,p=Ol(e),h=0,f=r-n,d=[],m=0;m<e.length-1;m++){for(var g=e[m],y=e[m+1],v=g.dist(y),_=y.angleTo(g);f+n<h+v;){var x=((f+=n)-h)/v,b=je(g.x,y.x,x),w=je(g.y,y.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-c>=0&&f+c<=p){var T=new Ll(b,w,_,m);T._round(),i&&!Dl(e,T,o,i,a)||d.push(T)}}h+=v}return l||d.length||s||(d=t(e,h/2,n,i,a,o,s,!0,u)),d}(t,h?e/2*s%e:(c/2+2*a)*o*s%e,e,u,r,p,h,!1,l)}function Ul(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var p=l[c],h=l[c+1];p.x<e&&h.x<e||(p.x<e?p=new i(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x<e&&(h=new i(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y<r&&h.y<r||(p.y<r?p=new i(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round():h.y<r&&(h=new i(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round()),p.x>=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(n-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=n&&(h=new i(n,p.y+(n-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=a&&h.y>=a||(p.y>=a?p=new i(p.x+(a-p.y)/(h.y-p.y)*(h.x-p.x),a)._round():h.y>=a&&(h=new i(p.x+(a-p.y)/(h.y-p.y)*(h.x-p.x),a)._round()),u&&p.equals(u[u.length-1])||o.push(u=[p]),u.push(h)))))}return o}function jl(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=o.stretchX||[[0,l]],f=o.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),g=f.reduce(d,0),y=l-m,v=u-g,_=0,x=m,b=0,w=g,T=0,k=y,A=0,M=v;if(o.content&&n){var S=o.content;_=Vl(h,0,S[0]),b=Vl(f,0,S[1]),x=Vl(h,S[0],S[2]),w=Vl(f,S[1],S[3]),T=S[0]-_,A=S[1]-b,k=S[2]-S[0]-x,M=S[3]-S[1]-w}var C=function(n,a,l,u){var h=Hl(n.stretch-_,x,c,t.left),f=Zl(n.fixed-T,k,n.stretch,m),d=Hl(a.stretch-b,w,p,t.top),y=Zl(a.fixed-A,M,a.stretch,g),v=Hl(l.stretch-_,x,c,t.left),S=Zl(l.fixed-T,k,l.stretch,m),C=Hl(u.stretch-b,w,p,t.top),L=Zl(u.fixed-A,M,u.stretch,g),E=new i(h,d),I=new i(v,d),z=new i(v,C),P=new i(h,C),D=new i(f/s,y/s),O=new i(S/s,L/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),N=[B,-F,F,B];E._matMult(N),I._matMult(N),P._matMult(N),z._matMult(N)}var U=n.stretch+n.fixed,j=a.stretch+a.fixed;return{tl:E,tr:I,bl:P,br:z,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+j,w:l.stretch+l.fixed-U,h:u.stretch+u.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:k/s/c,minFontScaleY:M/s/p,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var L=ql(h,y,m),E=ql(f,v,g),I=0;I<L.length-1;I++)for(var z=L[I],P=L[I+1],D=0;D<E.length-1;D++)a.push(C(z,E[D],P,E[D+1]));else a.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return a}function Vl(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]))}return n}function ql(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return n.push({fixed:e+1,stretch:r}),n}function Hl(t,e,r,n){return t/e*r+n}function Zl(t,e,r,n){return t-e*r/n}var Gl=function(t,e,r,n,a,o,s,l,u,c){if(this.boxStartIndex=t.length,u){var p=o.top,h=o.bottom,f=o.collisionPadding;f&&(p-=f[1],h+=f[3]);var d=h-p;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,_=o.collisionPadding;if(_&&(y-=_[0]*s,m-=_[1]*s,v+=_[2]*s,g+=_[3]*s),c){var x=new i(y,m),b=new i(v,m),w=new i(y,g),T=new i(v,g),k=c*Math.PI/180;x._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),y=Math.min(x.x,b.x,w.x,T.x),v=Math.max(x.x,b.x,w.x,T.x),m=Math.min(x.y,b.y,w.y,T.y),g=Math.max(x.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,a)}this.boxEndIndex=t.length},Xl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Wl),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Wl(t,e){return t<e?-1:t>e?1:0}function Yl(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<n)&&(n=c.x),(!u||c.y<a)&&(a=c.y),(!u||c.x>o)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var p=Math.min(o-n,s-a),h=p/2,f=new Xl([],Kl);if(0===p)return new i(n,a);for(var d=n;d<o;d+=p)for(var m=a;m<s;m+=p)f.push(new Jl(d+h,m+h,h,t));for(var g=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new Jl(r/e,n/e,0,t)}(t),y=f.length;f.length;){var v=f.pop();(v.d>g.d||!g.d)&&(g=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-g.d<=e||(f.push(new Jl(v.p.x-(h=v.h/2),v.p.y-h,h,t)),f.push(new Jl(v.p.x+h,v.p.y-h,h,t)),f.push(new Jl(v.p.x-h,v.p.y+h,h,t)),f.push(new Jl(v.p.x+h,v.p.y+h,h,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+g.d)),g.p}function Kl(t,e){return e.max-t.max}function Jl(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,l=s-1;o<s;l=o++){var u=a[o],c=a[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Za(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Xl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Xl.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Xl.prototype.peek=function(){return this.data[0]},Xl.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Xl.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a}e[t]=i};var Ql=Number.POSITIVE_INFINITY;function $l(t,e){return e[1]!==Ql?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function tu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function eu(t,e,r,n,a,o,s,l,u,c,p,h,f,d,m){var g=function(t,e,r,n,a,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[],p=0,h=e.positionedLines;p<h.length;p+=1)for(var f=h[p],d=0,m=f.positionedGlyphs;d<m.length;d+=1){var g=m[d];if(g.rect){var y=g.rect||{},v=4,_=!0,x=1,b=0,w=(a||l)&&g.vertical,T=g.metrics.advance*g.scale/2;if(l&&e.verticalizable&&(b=f.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var k=s[g.imageName];_=k.sdf,v=1/(x=k.pixelRatio)}var A=a?[g.x+T,g.y]:[0,0],M=a?[0,0]:[g.x+T+r[0],g.y+r[1]-b],S=[0,0];w&&(S=M,M=[0,0]);var C=(g.metrics.left-v)*g.scale-T+M[0],L=(-g.metrics.top-v)*g.scale+M[1],E=C+y.w*g.scale/x,I=L+y.h*g.scale/x,z=new i(C,L),P=new i(E,L),D=new i(C,I),O=new i(E,I);if(w){var R=new i(-T,T- -17),F=-Math.PI/2,B=12-T,N=new i(22-B,-(g.imageName?B:0)),U=new(Function.prototype.bind.apply(i,[null].concat(S)));z._rotateAround(F,R)._add(N)._add(U),P._rotateAround(F,R)._add(N)._add(U),D._rotateAround(F,R)._add(N)._add(U),O._rotateAround(F,R)._add(N)._add(U)}if(u){var j=Math.sin(u),V=Math.cos(u),q=[V,-j,j,V];z._matMult(q),P._matMult(q),D._matMult(q),O._matMult(q)}var H=new i(0,0),Z=new i(0,0);c.push({tl:z,tr:P,bl:D,br:O,tex:y,writingMode:e.writingMode,glyphOffset:A,sectionIndex:g.sectionIndex,isSDF:_,pixelOffsetTL:H,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return c}(0,r,l,a,o,s,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||v[1]>32640)&&b(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,c,e,u.lineStartIndex,u.lineLength,f,m);for(var _=0,x=p;_<x.length;_+=1)h[x[_]]=t.text.placedSymbolArray.length-1;return 4*g.length}function ru(t){for(var e in t)return t[e];return null}function nu(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[e]=[];return i[e].push(n),!1}var iu=ms.VectorTileFeature.types,au=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ou(t,e,r,n,i,a,o,s,l,u,c,p,h){var f=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(f<<1)+(l?1:0),d,16*u,16*c,256*p,256*h)}function su(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function lu(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Wn(r[e].text))return!0;return!1}var uu=function(t){this.layoutVertexArray=new Ei,this.indexArray=new Fi,this.programConfigurations=t,this.segments=new ia,this.dynamicLayoutVertexArray=new Ii,this.opacityVertexArray=new zi,this.placedSymbolArray=new Ki};uu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},uu.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Os.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Rs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,au,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},uu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},On("SymbolBuffers",uu);var cu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ia,this.collisionVertexArray=new Ri};cu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Fs.members,!0)},cu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},On("CollisionBuffers",cu);var pu=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=eo([]),this.placementViewportMatrix=eo([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=El(this.zoom,e["text-size"]),this.iconSizeData=El(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ml[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};pu.prototype.createArrays=function(){this.text=new uu(new Ia(Os.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new uu(new Ia(Os.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new $i,this.lineVertexArray=new ta,this.symbolInstances=new Qi},pu.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=js[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},pu.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof te&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new ii(this.zoom),m=0,g=t;m<g.length;m+=1){var y=g[m],v=y.feature,_=y.id,x=y.index,b=y.sourceLayerIndex,w=n._featureFilter.needGeometry,T={type:v.type,id:_,properties:v.properties,geometry:w?Oa(v):[]};if(n._featureFilter.filter(d,T,r)){w||(T.geometry=Oa(v));var k=void 0;if(l){var A=n.getValueAndResolveTokens("text-field",T,r,f),M=te.factory(A);lu(M)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ei()||this.hasRTLText&&ni.isParsed())&&(k=Us(M,n,T))}var S=void 0;if(u){var C=n.getValueAndResolveTokens("icon-image",T,r,f);S=C instanceof ee?C:ee.fromString(C)}if(k||S){var L=this.sortFeaturesByKey?c.evaluate(T,{},r):void 0,E={id:_,text:k,icon:S,index:x,sourceLayerIndex:b,geometry:Oa(v),properties:v.properties,type:iu[v.type],sortKey:L};if(this.features.push(E),S&&(p[S.name]=!0),k){var I=a.evaluate(T,{},r).join(","),z="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ml.vertical)>=0;for(var P=0,D=k.sections;P<D.length;P+=1){var O=D[P];if(O.image)p[O.image.name]=!0;else{var R=qn(k.toString()),F=O.fontStack||I,B=h[F]=h[F]||{};this.calculateGlyphDependencies(O.text,B,z,this.allowVerticalPlacement,R)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.text?c.text.toString():null;if(h){var f=l(h,p),d=l(h,p,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,p),g=o(f,d,n[m].geometry);delete e[f],delete r[d],r[l(h,n[g].geometry,!0)]=g,n[m].geometry=null}else f in r?o(f,d,p):d in e?s(f,d,p):(a(u),e[f]=i-1,r[d]=i-1)}else a(u)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},pu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},pu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},pu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},pu.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},pu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},pu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},pu.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},pu.prototype.addSymbols=function(t,e,r,n,i,a,o,s,l,u,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,h,a.sortKey),m=this.glyphOffsetArray.length,g=d.vertexLength,y=this.allowVerticalPlacement&&o===ml.vertical?Math.PI/2:0,v=a.text&&a.text.sections,_=0;_<e.length;_++){var x=e[_],b=x.tl,w=x.tr,T=x.bl,k=x.br,A=x.tex,M=x.pixelOffsetTL,S=x.pixelOffsetBR,C=x.minFontScaleX,L=x.minFontScaleY,E=x.glyphOffset,I=x.isSDF,z=x.sectionIndex,P=d.vertexLength,D=E[1];ou(f,s.x,s.y,b.x,D+b.y,A.x,A.y,r,I,M.x,M.y,C,L),ou(f,s.x,s.y,w.x,D+w.y,A.x+A.w,A.y,r,I,S.x,M.y,C,L),ou(f,s.x,s.y,T.x,D+T.y,A.x,A.y+A.h,r,I,M.x,S.y,C,L),ou(f,s.x,s.y,k.x,D+k.y,A.x+A.w,A.y+A.h,r,I,S.x,S.y,C,L),su(t.dynamicLayoutVertexArray,s,y),h.emplaceBack(P,P+1,P+2),h.emplaceBack(P+1,P+2,P+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),_!==e.length-1&&z===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},p,v&&v[z])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,u,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,c)},pu.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},pu.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s){var l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),u=l.vertexLength,c=a.layoutVertexArray,p=a.collisionVertexArray,h=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(c,p,o,h,f,new i(t,e)),this._addCollisionDebugVertex(c,p,o,h,f,new i(r,e)),this._addCollisionDebugVertex(c,p,o,h,f,new i(r,n)),this._addCollisionDebugVertex(c,p,o,h,f,new i(t,n)),l.vertexLength+=4;var d=a.indexArray;d.emplaceBack(u,u+1),d.emplaceBack(u+1,u+2),d.emplaceBack(u+2,u+3),d.emplaceBack(u+3,u),l.primitiveLength+=4},pu.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},pu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new cu(Di,Bs.members,qi),this.iconCollisionBox=new cu(Di,Bs.members,qi);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},pu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,l){for(var u={},c=e;c<r;c++){var p=t.get(c);u.textBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},u.textFeatureIndex=p.featureIndex;break}for(var h=n;h<i;h++){var f=t.get(h);u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}for(var d=a;d<o;d++){var m=t.get(d);u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=t.get(g);u.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},u.verticalIconFeatureIndex=y.featureIndex;break}return u},pu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},pu.prototype.hasTextData=function(){return this.text.segments.get().length>0},pu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},pu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},pu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},pu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},pu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},pu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),a},pu.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},pu.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},On("SymbolBucket",pu,{omit:["layers","collisionBoxArray","features","compareText"]}),pu.MAX_GLYPHS=65535,pu.addDynamicAttributes=su;var hu=new vi({"symbol-placement":new fi(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new fi(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new fi(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new di(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new fi(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new fi(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new fi(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new fi(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new fi(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new di(Mt.layout_symbol["icon-size"]),"icon-text-fit":new fi(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new fi(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new di(Mt.layout_symbol["icon-image"]),"icon-rotate":new di(Mt.layout_symbol["icon-rotate"]),"icon-padding":new fi(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new fi(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new di(Mt.layout_symbol["icon-offset"]),"icon-anchor":new di(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new fi(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new fi(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new fi(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new di(Mt.layout_symbol["text-field"]),"text-font":new di(Mt.layout_symbol["text-font"]),"text-size":new di(Mt.layout_symbol["text-size"]),"text-max-width":new di(Mt.layout_symbol["text-max-width"]),"text-line-height":new fi(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new di(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new di(Mt.layout_symbol["text-justify"]),"text-radial-offset":new di(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new fi(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new di(Mt.layout_symbol["text-anchor"]),"text-max-angle":new fi(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new fi(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new di(Mt.layout_symbol["text-rotate"]),"text-padding":new fi(Mt.layout_symbol["text-padding"]),"text-keep-upright":new fi(Mt.layout_symbol["text-keep-upright"]),"text-transform":new di(Mt.layout_symbol["text-transform"]),"text-offset":new di(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new fi(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new fi(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new fi(Mt.layout_symbol["text-optional"])}),fu={paint:new vi({"icon-opacity":new di(Mt.paint_symbol["icon-opacity"]),"icon-color":new di(Mt.paint_symbol["icon-color"]),"icon-halo-color":new di(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new di(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new di(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new fi(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new fi(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new di(Mt.paint_symbol["text-opacity"]),"text-color":new di(Mt.paint_symbol["text-color"],{runtimeType:Bt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new di(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new di(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new di(Mt.paint_symbol["text-halo-blur"]),"text-translate":new fi(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new fi(Mt.paint_symbol["text-translate-anchor"])}),layout:hu},du=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Dt,this.defaultValue=t};du.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},du.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},du.prototype.outputDefined=function(){return!1},du.prototype.serialize=function(){return null},On("FormatSectionOverride",du,{omit:["defaultValue"]});var mu=function(t){function e(e){t.call(this,e,fu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||Vr(a.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new pu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=fu.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new du(a),s=new jr(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new Hr("source",s):new Zr("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new pi(a.property,i,a.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=fu.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof te)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){i||(t instanceof oe&&ie(t.value)===Vt?a(t.value.sections):t instanceof ce?a(t.sections):t.eachChild(o))},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},e}(_i),gu={paint:new vi({"background-color":new fi(Mt.paint_background["background-color"]),"background-pattern":new gi(Mt.paint_background["background-pattern"]),"background-opacity":new fi(Mt.paint_background["background-opacity"])})},yu=function(t){function e(e){t.call(this,e,gu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(_i),vu={paint:new vi({"raster-opacity":new fi(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new fi(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new fi(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new fi(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new fi(Mt.paint_raster["raster-saturation"]),"raster-contrast":new fi(Mt.paint_raster["raster-contrast"]),"raster-resampling":new fi(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new fi(Mt.paint_raster["raster-fade-duration"])})},_u=function(t){function e(e){t.call(this,e,vu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(_i),xu=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(_i),bu={circle:oo,heatmap:yo,hillshade:_o,fill:as,"fill-extrusion":ws,line:Ps,symbol:mu,background:yu,raster:_u},wu=self.HTMLImageElement,Tu=self.HTMLCanvasElement,ku=self.HTMLVideoElement,Au=self.ImageData,Mu=self.ImageBitmap,Su=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};Su.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof wu||t instanceof Tu||t instanceof ku||t instanceof Au||Mu&&t instanceof Mu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof wu||t instanceof Tu||t instanceof ku||t instanceof Au||Mu&&t instanceof Mu?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Su.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Su.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Su.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Cu=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Cu.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Cu.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Lu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Cu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:self};function Eu(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Lu.prototype.send=function(t,e,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=S(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Nn(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Lu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Lu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Lu.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Un(e.error)):n(null,Un(e.data)))}else{var i=!1,a=S(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?Nn(e):null,data:Nn(n,a)},a)}:function(t){i=!0},s=null,l=Un(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Lu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Iu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Iu.prototype.setNorthEast=function(t){return this._ne=t instanceof zu?new zu(t.lng,t.lat):zu.convert(t),this},Iu.prototype.setSouthWest=function(t){return this._sw=t instanceof zu?new zu(t.lng,t.lat):zu.convert(t),this},Iu.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof zu)e=t,r=t;else{if(!(t instanceof Iu))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Iu.convert(t)):this.extend(zu.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new zu(e.lng,e.lat),this._ne=new zu(r.lng,r.lat)),this},Iu.prototype.getCenter=function(){return new zu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Iu.prototype.getSouthWest=function(){return this._sw},Iu.prototype.getNorthEast=function(){return this._ne},Iu.prototype.getNorthWest=function(){return new zu(this.getWest(),this.getNorth())},Iu.prototype.getSouthEast=function(){return new zu(this.getEast(),this.getSouth())},Iu.prototype.getWest=function(){return this._sw.lng},Iu.prototype.getSouth=function(){return this._sw.lat},Iu.prototype.getEast=function(){return this._ne.lng},Iu.prototype.getNorth=function(){return this._ne.lat},Iu.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Iu.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Iu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Iu.prototype.contains=function(t){var e=zu.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},Iu.convert=function(t){return!t||t instanceof Iu?t:new Iu(t)};var zu=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};zu.prototype.wrap=function(){return new zu(u(this.lng,-180,180),this.lat)},zu.prototype.toArray=function(){return[this.lng,this.lat]},zu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zu.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},zu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Iu(new zu(this.lng-r,this.lat-e),new zu(this.lng+r,this.lat+e))},zu.convert=function(t){if(t instanceof zu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new zu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new zu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Pu=2*Math.PI*6371008.8;function Du(t){return Pu*Math.cos(t*Math.PI/180)}function Ou(t){return(180+t)/360}function Ru(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Fu(t,e){return t/Du(e)}function Bu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Nu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Nu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=zu.convert(t);return new Nu(Ou(r.lng),Ru(r.lat),Fu(e,r.lat))},Nu.prototype.toLngLat=function(){return new zu(360*this.x-180,Bu(this.y))},Nu.prototype.toAltitude=function(){return this.z*Du(Bu(this.y))},Nu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Pu*(t=Bu(this.y),1/Math.cos(t*Math.PI/180));var t};var Uu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=qu(0,t,t,e,r)};Uu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Uu.prototype.url=function(t,e){var r,n,i,a,o,s=(n=this.y,i=this.z,a=Eu(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),o=Eu(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Uu.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Uu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ju=function(t,e){this.wrap=t,this.canonical=e,this.key=qu(t,e.z,e.z,e.x,e.y)},Vu=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Uu(r,+n,+i),this.key=qu(e,t,r,n,i)};function qu(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var a=1<<r;return(a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}Vu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Vu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Vu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Vu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Vu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?qu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):qu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Vu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Vu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Vu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Vu(e,this.wrap,e,r,n),new Vu(e,this.wrap,e,r+1,n),new Vu(e,this.wrap,e,r,n+1),new Vu(e,this.wrap,e,r+1,n+1)]},Vu.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Vu.prototype.wrapped=function(){return new Vu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Vu.prototype.unwrapTo=function(t){return new Vu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Vu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Vu.prototype.toUnwrapped=function(){return new ju(this.wrap,this.canonical)},Vu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Vu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Nu(t.x-this.wrap,t.y))},On("CanonicalTileID",Uu),On("OverscaledTileID",Vu,{omit:["posMatrix"]});var Hu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return b('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Hu.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Hu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Hu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Hu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Hu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Hu.prototype.getPixels=function(){return new fo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Hu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,u=a;u<o;u++)for(var c=n;c<i;c++)this.data[this._idx(c,u)]=t.data[this._idx(c+s,u+l)]},On("DEMData",Hu);var Zu=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Zu.prototype.encode=function(t){return this._stringToNumber[t]},Zu.prototype.decode=function(t){return this._numberToString[t]};var Gu=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},Xu={geometry:{configurable:!0}};Xu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Xu.geometry.set=function(t){this._geometry=t},Gu.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Gu.prototype,Xu);var Wu=function(){this.state={},this.stateChanges={},this.deletedStates={}};Wu.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},c(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o]},Wu.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},Wu.prototype.getState=function(t,e){var r=String(e),n=c({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return{};for(var a in i)delete n[a]}return n},Wu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Wu.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),c(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var u in this.deletedStates[o]){if(null===this.deletedStates[o][u])this.state[o][u]={};else for(var p=0,h=Object.keys(this.deletedStates[o][u]);p<h.length;p+=1)delete this.state[o][u][h[p]];s[u]=this.state[o][u]}r[o]=r[o]||{},c(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e)};var Yu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new En(8192,16,0),this.grid3D=new En(8192,16,0),this.featureIndexArray=new ra,this.promoteId=e};function Ku(t,e,r,n,i){return y(t,(function(t,a){var o=e instanceof hi?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Ju(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Qu(t,e){return e-t}Yu.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],p=0;p<u.length;p++){var h=u[p];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Yu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ms.VectorTile(new Hs(this.rawTileData)).layers,this.sourceLayerCoder=new Zu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Yu.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,l=rn(o.filter),u=t.queryGeometry,c=t.queryPadding*s,p=Ju(u),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=Ju(t.cameraQueryGeometry),d=0,m=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&r<=l.y&&n>=l.x&&a>=l.y)return!0}var u=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var c=0,p=u;c<p.length;c+=1)if(Xa(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(Wa(t[h],t[h+1],u))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,a+c)}));d<m.length;d+=1)h.push(m[d]);h.sort(Qu);for(var g,y={},v=function(i){var c=h[i];if(c!==g){g=c;var p=a.featureIndexArray.get(c),f=null;a.loadMatchingFeature(y,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,l,o.layers,o.availableImages,e,r,n,(function(e,r,n){return f||(f=Oa(e)),r.queryIntersectsFeature(u,e,n,f,a.z,t.transform,s,t.pixelPosMatrix)}))}},_=0;_<h.length;_++)v(_);return y},Yu.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,l,u,c){var p=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,p)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(i.filter(new ii(this.tileID.overscaledZ),f))for(var d=this.getId(f,h),m=0;m<p.length;m++){var g=p[m];if(!(a&&a.indexOf(g)<0)){var y=s[g];if(y){var v={};void 0!==d&&u&&(v=u.getState(y.sourceLayer||"_geojsonTileLayer",d));var _=l[g];_.paint=Ku(_.paint,y.paint,f,v,o),_.layout=Ku(_.layout,y.layout,f,v,o);var x=!c||c(f,y,v);if(x){var b=new Gu(f,this.z,this.x,this.y,d);b.layer=_;var w=t[g];void 0===w&&(w=t[g]=[]),w.push({featureIndex:n,feature:b,intersectionZ:x})}}}}}},Yu.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var u=rn(i),c=0,p=t;c<p.length;c+=1)this.loadMatchingFeature(l,r,n,p[c],u,a,o,s,e);return l},Yu.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},Yu.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},On("FeatureIndex",Yu,{omit:["rawTileData","sourceLayerCoder"]});var $u=function(t,e){this.tileID=t,this.uid=h(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};$u.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<R.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},$u.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},$u.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1)r[s[o].id]=t}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof pu){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof pu&&o.hasRTLText){this.hasRTLText=!0,ni.isLoading()||ni.isLoaded()||"deferred"!==ei()||ri();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Wi},$u.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},$u.prototype.getBucket=function(t){return this.buckets[t.id]},$u.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Su(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Su(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},$u.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},$u.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}},$u.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=rn(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,c=s.y,p={z:l,x:u,y:c},h=0;h<a.length;h++){var f=a.feature(h);if(o.filter(new ii(this.tileID.overscaledZ),f)){var d=r.getId(f,i),m=new Gu(f,l,u,c,d);m.tile=p,t.push(m)}}}},$u.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},$u.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},$u.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=A(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},$u.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},$u.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},$u.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},$u.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.now()},$u.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},$u.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=R.now()+t},$u.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r},$u.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=this.dependencies[n[r]];if(i)for(var a=0,o=e;a<o.length;a+=1)if(i[o[a]])return!0}return!1};var tc=self.performance,ec=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},tc.mark(this._marks.start)};ec.prototype.finish=function(){tc.mark(this._marks.end);var t=tc.getEntriesByName(this._marks.measure);return 0===t.length&&(tc.measure(this._marks.measure,this._marks.start,this._marks.end),t=tc.getEntriesByName(this._marks.measure),tc.clearMarks(this._marks.start),tc.clearMarks(this._marks.end),tc.clearMeasures(this._marks.measure)),t},t.Actor=Lu,t.AlphaImage=ho,t.CanonicalTileID=Uu,t.CollisionBoxArray=Wi,t.Color=Jt,t.DEMData=Hu,t.DataConstantProperty=fi,t.DictionaryCoder=Zu,t.EXTENT=8192,t.ErrorEvent=kt,t.EvaluationParameters=ii,t.Event=Tt,t.Evented=At,t.FeatureIndex=Yu,t.FillBucket=rs,t.FillExtrusionBucket=_s,t.ImageAtlas=dl,t.ImagePosition=hl,t.LineBucket=Ls,t.LngLat=zu,t.LngLatBounds=Iu,t.MercatorCoordinate=Nu,t.ONE_EM=24,t.OverscaledTileID=Vu,t.Point=i,t.Point$1=i,t.Properties=vi,t.Protobuf=Hs,t.RGBAImage=fo,t.RequestManager=q,t.RequestPerformance=ec,t.ResourceType=ht,t.SegmentVector=ia,t.SourceFeatureState=Wu,t.StructArrayLayout1ui2=Hi,t.StructArrayLayout2f1f2i16=Oi,t.StructArrayLayout2i4=Ai,t.StructArrayLayout3ui6=Fi,t.StructArrayLayout4i8=Mi,t.SymbolBucket=pu,t.Texture=Su,t.Tile=$u,t.Transitionable=si,t.Uniform1f=ya,t.Uniform1i=ga,t.Uniform2f=va,t.Uniform3f=_a,t.Uniform4f=xa,t.UniformColor=ba,t.UniformMatrix4f=Ta,t.UnwrappedTileID=ju,t.ValidationError=St,t.WritingMode=ml,t.ZoomHistory=jn,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=su,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)}))}))},t.bezier=o,t.bindAll=m,t.browser=R,t.cacheEntryPossiblyAdded=function(t){++ct>ot&&(t.getActor().send("enforceCacheSizeLimit",at),ct=0)},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Ul,t.clone=function(t){var e=new to(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=_,t.clone$2=function(t){var e=new to(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ns,t.config=F,t.create=function(){var t=new to(16);return to!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new to(9);return to!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new to(4);return to!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=qr,t.createLayout=Ti,t.createStyleLayer=function(t){return"custom"===t.type?new xu(t):new bu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=s,t.emitValidationErrors=Ln,t.endsWith=g,t.enforceCacheSizeLimit=function(t){st(),Q&&Q.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))},t.evaluateSizeForFeature=Il,t.evaluateSizeForZoom=zl,t.evaluateVariableOffset=$l,t.evented=ti,t.extend=c,t.featureFilter=rn,t.filterObject=v,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Ml,t.getAnchorJustification=tu,t.getArrayBuffer=vt,t.getImage=xt,t.getJSON=function(t,e){return yt(c(t,{type:"json"}),e)},t.getRTLTextPluginStatus=ei,t.getReferrer=gt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o)}return{cancel:function(){}}},t.identity=eo,t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,_=r*l-i*o,x=r*u-a*o,b=n*l-i*s,w=n*u-a*s,T=i*u-a*l,k=c*m-p*d,A=c*g-h*d,M=c*y-f*d,S=p*g-h*m,C=p*y-f*m,L=h*y-f*g,E=v*L-_*C+x*S+b*M-w*A+T*k;return E?(t[0]=(s*L-l*C+u*S)*(E=1/E),t[1]=(i*C-n*L-a*S)*E,t[2]=(m*T-g*w+y*b)*E,t[3]=(h*w-p*T-f*b)*E,t[4]=(l*M-o*L-u*A)*E,t[5]=(r*L-i*M+a*A)*E,t[6]=(g*x-d*T-y*_)*E,t[7]=(c*T-h*x+f*_)*E,t[8]=(o*C-s*M+u*k)*E,t[9]=(n*M-r*C-a*k)*E,t[10]=(d*w-m*x+y*v)*E,t[11]=(p*x-c*w-f*v)*E,t[12]=(s*A-o*S-l*k)*E,t[13]=(r*S-n*A+i*k)*E,t[14]=(m*_-d*b-g*v)*E,t[15]=(c*b-p*_+h*v)*E,t):null},t.isChar=Vn,t.isMapboxURL=H,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=yt,t.mapObject=y,t.mercatorXfromLng=Ou,t.mercatorYfromLat=Ru,t.mercatorZfromAltitude=Fu,t.mul=io,t.multiply=ro,t.mvt=ms,t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=je,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Hs(t).readFields(ll,[])},t.pbf=Hs,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,p=c.maxZoom;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new ii(c.minZoom),o),l["text-size"].possiblyEvaluate(new ii(p),o)]}if("composite"===t.iconSizeData.kind){var h=t.iconSizeData,f=h.maxZoom;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new ii(h.minZoom),o),l["icon-size"].possiblyEvaluate(new ii(f),o)]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new ii(t.zoom+1),o),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new ii(t.zoom+1),o),u.textMaxSize=l["text-size"].possiblyEvaluate(new ii(18));for(var d=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),g=s.get("text-keep-upright"),y=s.get("text-size"),v=function(){var a=x[_],l=s.get("text-font").evaluate(a,{},o).join(","),c=y.evaluate(a,{},o),p=u.layoutTextSize.evaluate(a,{},o),h=u.layoutIconSize.evaluate(a,{},o),f={horizontal:{},vertical:void 0},v=a.text,w=[0,0];if(v){var T=v.toString(),k=24*s.get("text-letter-spacing").evaluate(a,{},o),A=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),Vn.Arabic(n)||Vn["Arabic Supplement"](n)||Vn["Arabic Extended-A"](n)||Vn["Arabic Presentation Forms-A"](n)||Vn["Arabic Presentation Forms-B"](n))return!1;var n;return!0}(T)?k:0,M=s.get("text-anchor").evaluate(a,{},o),S=s.get("text-variable-anchor");if(!S){var C=s.get("text-radial-offset").evaluate(a,{},o);w=C?$l(M,[24*C,Ql]):s.get("text-offset").evaluate(a,{},o).map((function(t){return 24*t}))}var L=m?"center":s.get("text-justify").evaluate(a,{},o),E=s.get("symbol-placement"),I="point"===E?24*s.get("text-max-width").evaluate(a,{},o):0,z=function(){t.allowVerticalPlacement&&qn(T)&&(f.vertical=vl(v,e,r,i,l,I,d,M,"left",A,w,ml.vertical,!0,E,p,c))};if(!m&&S){for(var P="auto"===L?S.map((function(t){return tu(t)})):[L],D=!1,O=0;O<P.length;O++){var R=P[O];if(!f.horizontal[R])if(D)f.horizontal[R]=f.horizontal[0];else{var F=vl(v,e,r,i,l,I,d,"center",R,A,w,ml.horizontal,!1,E,p,c);F&&(f.horizontal[R]=F,D=1===F.positionedLines.length)}}z()}else{"auto"===L&&(L=tu(M));var B=vl(v,e,r,i,l,I,d,M,L,A,w,ml.horizontal,!1,E,p,c);B&&(f.horizontal[L]=B),z(),qn(T)&&m&&g&&(f.vertical=vl(v,e,r,i,l,I,d,M,L,A,w,ml.vertical,!1,E,p,c))}}var N=void 0,U=!1;if(a.icon&&a.icon.name){var j=n[a.icon.name];j&&(N=function(t,e,r){var n=Ml(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,a=e[1]-t.displaySize[1]*n.verticalAlign;return{image:t,top:a,bottom:a+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(i[a.icon.name],s.get("icon-offset").evaluate(a,{},o),s.get("icon-anchor").evaluate(a,{},o)),U=j.sdf,void 0===t.sdfIcons?t.sdfIcons=j.sdf:t.sdfIcons!==j.sdf&&b("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(j.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var V=ru(f.horizontal)||f.vertical;t.iconsInText=!!V&&V.iconsInText,(V||N)&&function(t,e,r,n,i,a,o,s,l,u,c){var p=a.textMaxSize.evaluate(e,{});void 0===p&&(p=o);var h,f=t.layers[0].layout,d=f.get("icon-offset").evaluate(e,{},c),m=ru(r.horizontal),g=o/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*p/24,_=t.tilePixelRatio*s,x=t.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*t.tilePixelRatio,T=f.get("icon-padding")*t.tilePixelRatio,k=f.get("text-max-angle")/180*Math.PI,A="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),M="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),S=f.get("symbol-placement"),C=x/2,L=f.get("icon-text-fit");n&&"none"!==L&&(t.allowVerticalPlacement&&r.vertical&&(h=Cl(n,r.vertical,L,f.get("icon-text-fit-padding"),d,g)),m&&(n=Cl(n,m,L,f.get("icon-text-fit-padding"),d,g)));var E=function(s,p){p.x<0||p.x>=8192||p.y<0||p.y>=8192||function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,g,y,v,_,x,w,T,k,A){var M,S,C,L,E,I=t.addToLineVertexArray(e,r),z=0,P=0,D=0,O=0,R=-1,F=-1,B={},N=ua(""),U=0,j=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(M=s.layout.get("text-offset").evaluate(x,{},k).map((function(t){return 24*t})))[0],j=M[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},k),j=Ql),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(x,{},k)+90;L=new Gl(l,e,u,c,p,n.vertical,h,f,d,V),o&&(E=new Gl(l,e,u,c,p,o,g,y,d,V))}if(i){var q=s.layout.get("icon-rotate").evaluate(x,{}),H="none"!==s.layout.get("icon-text-fit"),Z=jl(i,q,T,H),G=o?jl(o,q,T,H):void 0;C=new Gl(l,e,u,c,p,i,g,y,!1,q),z=4*Z.length;var X=t.iconSizeData,W=null;"source"===X.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((W=[128*w.compositeIconSizes[0].evaluate(x,{},k),128*w.compositeIconSizes[1].evaluate(x,{},k)])[0]>32640||W[1]>32640)&&b(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Z,W,_,v,x,!1,e,I.lineStartIndex,I.lineLength,-1,k),R=t.icon.placedSymbolArray.length-1,G&&(P=4*G.length,t.addSymbols(t.icon,G,W,_,v,x,ml.vertical,e,I.lineStartIndex,I.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1)}for(var Y in n.horizontal){var K=n.horizontal[Y];if(!S){N=ua(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},k);S=new Gl(l,e,u,c,p,K,h,f,d,J)}var Q=1===K.positionedLines.length;if(D+=eu(t,e,K,a,s,d,x,m,I,n.vertical?ml.horizontal:ml.horizontalOnly,Q?Object.keys(n.horizontal):[Y],B,R,w,k),Q)break}n.vertical&&(O+=eu(t,e,n.vertical,a,s,d,x,m,I,ml.vertical,["vertical"],B,F,w,k));var $=S?S.boxStartIndex:t.collisionBoxArray.length,tt=S?S.boxEndIndex:t.collisionBoxArray.length,et=L?L.boxStartIndex:t.collisionBoxArray.length,rt=L?L.boxEndIndex:t.collisionBoxArray.length,nt=C?C.boxStartIndex:t.collisionBoxArray.length,it=C?C.boxEndIndex:t.collisionBoxArray.length,at=E?E.boxStartIndex:t.collisionBoxArray.length,ot=E?E.boxEndIndex:t.collisionBoxArray.length,st=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=lt(S,st),st=lt(L,st),st=lt(C,st);var ut=(st=lt(E,st))>-1?1:0;ut&&(st*=A/24),t.glyphOffsetArray.length>=pu.MAX_GLYPHS&&b("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,N,$,tt,et,rt,nt,it,at,ot,u,D,O,z,P,ut,0,h,U,j,st)}(t,p,s,r,n,i,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,w,A,l,_,T,M,d,e,a,u,c,o)};if("line"===S)for(var I=0,z=Ul(e.geometry,0,0,8192,8192);I<z.length;I+=1)for(var P=z[I],D=0,O=Nl(P,x,k,r.vertical||m,n,24,v,t.overscaling,8192);D<O.length;D+=1){var R=O[D];m&&nu(t,m.text,C,R)||E(P,R)}else if("line-center"===S)for(var F=0,B=e.geometry;F<B.length;F+=1){var N=B[F];if(N.length>1){var U=Bl(N,k,r.vertical||m,n,24,v);U&&E(N,U)}}else if("Polygon"===e.type)for(var j=0,V=Qo(e.geometry,0);j<V.length;j+=1){var q=V[j],H=Yl(q,16);E(q[0],new Ll(H.x,H.y,0))}else if("LineString"===e.type)for(var Z=0,G=e.geometry;Z<G.length;Z+=1){var X=G[Z];E(X,new Ll(X[0].x,X[0].y,0))}else if("Point"===e.type)for(var W=0,Y=e.geometry;W<Y.length;W+=1)for(var K=0,J=Y[W];K<J.length;K+=1){var Q=J[K];E([Q],new Ll(Q.x,Q.y,0))}}(t,a,f,N,n,u,p,h,w,U,o)},_=0,x=t.features;_<x.length;_+=1)v();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=ni,t.polygonIntersectsPolygon=Ba,t.postMapLoadEvent=it,t.postTurnstileEvent=rt,t.potpack=pl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=On,t.registerForPluginStateChange=function(t){return t({pluginStatus:Kn,pluginURL:Jn}),ti.on("pluginStateChange",t),t},t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+p*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=p*i-s*n,t[11]=h*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],p=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+p*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=p*i-s*n,t[7]=h*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){at=t,ot=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Kn||"loading"===Kn||"loaded"===Kn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Jn=R.resolveURL(t),Kn="deferred",Yn=e,$n(),r||ri()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Mt,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Pl,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=ao,t.translate=function(t,e,r){var n,i,a,o,s,l,u,c,p,h,f,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*g+p*y+e[12],t[13]=i*m+l*g+h*y+e[13],t[14]=a*m+u*g+f*y+e[14],t[15]=o*m+c*g+d*y+e[15]),t},t.triggerPluginCompletionEvent=Qn,t.uniqueId=h,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Mn,t.validateStyle=An,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=ms,t.version="1.10.1",t.warnOnce=b,t.webpSupported=B,t.window=self,t.wrap=u})),n(0,(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,a=t;i<a.length;i+=1)n+=e(a[i])+",";return n+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=t.refProperties;i<a.length;i+=1)n+="/"+e(r[a[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=n;u<c.length;u+=1){var p=c[u];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var h=0,f=function(t,e){for(var n={},i=0;i<t.length;i++){var a=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(t[i])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache);h<f.length;h+=1){var d=f[h].map((function(t){return i._layers[t.id]})),m=d[0];if("none"!==m.visibility){var g=m.source||"",y=this.familiesBySource[g];y||(y=this.familiesBySource[g]={});var v=m.sourceLayer||"_geojsonTileLayer",_=y[v];_||(_=y[v]=[]),_.push(d)}}};var i=function(e){var r={},n=[];for(var i in e){var a=e[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),o[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(n),p=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var h in e){var f=e[h];for(var d in f){var m=f[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var g=r[h][d].rect;t.AlphaImage.copy(m.bitmap,p,{x:0,y:0},{x:g.x+1,y:g.y+1},m.bitmap)}}}this.image=p,this.positions=r};t.register("GlyphAtlas",i);var a=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function o(e,r,n){for(var i=new t.EvaluationParameters(r),a=0,o=e;a<o.length;a+=1)o[a].recalculate(i,n)}function s(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,i,a){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:a})}));return function(){n.cancel(),r()}}a.prototype.parse=function(e,r,n,a,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var u=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var p,h,f,d,m={},g={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},y=r.familiesBySource[this.source];for(var v in y){var _=e.layers[v];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=u.encode(v),b=[],w=0;w<_.length;w++){var T=_.feature(w),k=c.getId(T,v);b.push({feature:T,id:k,index:w,sourceLayerIndex:x})}for(var A=0,M=y[v];A<M.length;A+=1){var S=M[A],C=S[0];C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||"none"!==C.visibility&&(o(S,this.zoom,n),(m[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,g,this.tileID.canonical),c.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var L=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(L).length?a.send("getGlyphs",{uid:this.uid,stacks:L},(function(t,e){p||(p=t,h=e,z.call(l))})):h={};var E=Object.keys(g.iconDependencies);E.length?a.send("getImages",{icons:E,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,z.call(l))})):f={};var I=Object.keys(g.patternDependencies);function z(){if(p)return s(p);if(h&&f&&d){var e=new i(h),r=new t.ImageAtlas(f,d);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,h,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,z.call(l))})):d={},z.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var c={};if(o){var p=o.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};function p(t,e){if(0!==t.length){h(t[0],e);for(var r=1;r<t.length;r++)h(t[r],!e)}}function h(t,e){for(var r=0,n=0,i=t.length,a=i-1;n<i;a=n++)r+=(t[n][0]-t[a][0])*(t[a][1]+t[n][1]);r>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=u&&a instanceof u?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],u=0,c=s[o];u<c.length;u+=1){var p=c[u];l.push(new t.Point$1(p[0],p[1]))}a.push(l)}return a},d.prototype.toGeoJSON=function(t,e,r){return f.call(this,t,e,r)};var m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new d(this._features[t])};var g=t.vectorTile.VectorTileFeature,y=v;function v(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}v.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<n.length;a++)i.push(new t.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},_.prototype.toGeoJSON=g.prototype.toGeoJSON;var x=w,b=y;function w(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,T,t.layers[r])}(e,r),r.finish()}function T(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,k,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,L,a[r])}function k(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,A,t),e.writeVarintField(3,r.type),e.writeMessage(4,C,r)}function A(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=a[s];void 0===l&&(n.push(s),a[s]=l=n.length-1),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var p=c+":"+u,h=o[p];void 0===h&&(i.push(u),o[p]=h=i.length-1),e.writeVarint(h)}}function M(t,e){return(e<<3)+(7&t)}function S(t){return t<<1^t>>31}function C(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(M(1,u));for(var c=3===n?l.length-1:l.length,p=0;p<c;p++){1===p&&1!==n&&e.writeVarint(M(2,c-1));var h=l[p].x-i,f=l[p].y-a;e.writeVarint(S(h)),e.writeVarint(S(f)),i+=h,a+=f}3===n&&e.writeVarint(M(7,1))}}function L(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function E(t,e,r,n){I(t,r,n),I(e,2*r,2*n),I(e,2*r+1,2*n+1)}function I(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function z(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}x.fromVectorTileJs=w,x.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new y(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return w({layers:r})},x.GeoJSONWrapper=b;var P=function(t){return t[0]},D=function(t){return t[1]},O=function(t,e,r,n,i){void 0===e&&(e=P),void 0===r&&(r=D),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,n,i,a,o){if(!(a-i<=n)){var s=i+a>>1;!function t(e,r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=n-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-l*c/s+p)),Math.min(a,Math.floor(n+(s-l)*c/s+p)),o)}var h=r[2*n+o],f=i,d=a;for(E(e,r,i,n),r[2*a+o]>h&&E(e,r,i,a);f<d;){for(E(e,r,f,d),f++,d--;r[2*f+o]<h;)f++;for(;r[2*d+o]>h;)d--}r[2*i+o]===h?E(e,r,i,d):E(e,r,++d,a),d<=n&&(i=d+1),n<=d&&(a=d-1)}}(e,r,s,i,a,o%2),t(e,r,n,i,s-1,o+1),t(e,r,n,s+1,a,o+1)}}(o,s,n,0,o.length-1,0)};O.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var p=u.pop(),h=u.pop(),f=u.pop();if(h-f<=o)for(var d=f;d<=h;d++)l=e[2*d+1],(s=e[2*d])>=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var m=Math.floor((f+h)/2);l=e[2*m+1],(s=e[2*m])>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var g=(p+1)%2;(0===p?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(g)),(0===p?i>=s:a>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},O.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),p=o.pop();if(c-p<=a)for(var h=p;h<=c;h++)z(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];z(d,m,r,n)<=l&&s.push(t[f]);var g=(u+1)%2;(0===u?r-i<=d:n-i<=m)&&(o.push(p),o.push(f-1),o.push(g)),(0===u?r+i>=d:n+i>=m)&&(o.push(f+1),o.push(c),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var R={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},F=function(t){this.options=H(Object.create(R),t),this.trees=new Array(this.options.maxZoom+1)};function B(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function N(t,e){var r=t.geometry.coordinates,n=r[1];return{x:V(r[0]),y:q(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:j(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function j(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return H(H({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function V(t){return t/360+.5}function q(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function H(t,e){for(var r in e)t[r]=e[r];return t}function Z(t){return t.x}function G(t){return t.y}function X(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function W(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Y(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)Y(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)Y(t,e[n][i])}(i),i}function Y(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function K(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)J(i,s);else if("MultiPoint"===a)for(var u=0;u<i.length;u++)J(i[u],s);else if("LineString"===a)Q(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<i.length;u++)Q(i[u],s=[],o,!1),t.push(W(l,"LineString",s,e.properties));return}$(i,s,o,!1)}else if("Polygon"===a)$(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<e.geometry.geometries.length;u++)K(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<i.length;u++){var c=[];$(i[u],c,o,!0),s.push(c)}}t.push(W(l,a,s,e.properties))}}function J(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Q(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var l=tt(t[s][0]),u=et(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],p=e[n],h=e[n+1],f=r+3;f<n;f+=3){var d=X(e[f],e[f+1],u,c,p,h);if(d>o)a=f,o=d;else if(d===o){var m=Math.abs(f-s);m<l&&(a=f,l=m)}}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function $(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];Q(t[i],a,r,n),e.push(a)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function rt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=r&&d<n)l.push(c);else if(!(d<r||f>=n)){var m=[];if("Point"===h||"MultiPoint"===h)nt(p,m,r,n,i);else if("LineString"===h)it(p,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)ot(p,m,r,n,i,!1);else if("Polygon"===h)ot(p,m,r,n,i,!0);else if("MultiPolygon"===h)for(var g=0;g<p.length;g++){var y=[];ot(p[g],y,r,n,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===h){for(g=0;g<m.length;g++)l.push(W(c.id,h,m[g],c.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),l.push(W(c.id,h,m,c.tags))}}}return l.length?l:null}function nt(t,e,r,n,i){for(var a=0;a<t.length;a+=3){var o=t[a+i];o>=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function it(t,e,r,n,i,a,o){for(var s,l,u=at(t),c=0===i?lt:ut,p=t.start,h=0;h<t.length-3;h+=3){var f=t[h],d=t[h+1],m=t[h+2],g=t[h+3],y=t[h+4],v=0===i?f:d,_=0===i?g:y,x=!1;o&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(d-y,2))),v<r?_>r&&(l=c(u,f,d,g,y,r),o&&(u.start=p+s*l)):v>n?_<n&&(l=c(u,f,d,g,y,n),o&&(u.start=p+s*l)):st(u,f,d,m),_<r&&v>=r&&(l=c(u,f,d,g,y,r),x=!0),_>n&&v<=n&&(l=c(u,f,d,g,y,n),x=!0),!a&&x&&(o&&(u.end=p+s*l),e.push(u),u=at(t)),o&&(p+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(v=0===i?f:d)>=r&&v<=n&&st(u,f,d,m),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&st(u,u[0],u[1],u[2]),u.length&&e.push(u)}function at(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ot(t,e,r,n,i,a){for(var o=0;o<t.length;o++)it(t[o],e,r,n,i,a,!1)}function st(t,e,r,n){t.push(e),t.push(r),t.push(n)}function lt(t,e,r,n,i,a){var o=(a-e)/(n-e);return t.push(a),t.push(r+(i-r)*o),t.push(1),o}function ut(t,e,r,n,i,a){var o=(a-r)/(i-r);return t.push(e+(n-e)*o),t.push(a),t.push(1),o}function ct(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=pt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(pt(a.geometry[s],e))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],u=0;u<a.geometry[s].length;u++)l.push(pt(a.geometry[s][u],e));i.push(l)}r.push(W(a.id,o,i,a.tags))}return r}function pt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function ht(t,e){if(t.transformed)return t;var r,n,i,a=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(ft(u[n],u[n+1],e,a,o,s));else for(n=0;n<u.length;n++){var p=[];for(i=0;i<u[n].length;i+=2)p.push(ft(u[n][i],u[n][i+1],e,a,o,s));l.geometry.push(p)}}return t.transformed=!0,t}function ft(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function dt(t,e,r,n,i){for(var a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,mt(o,t[s],a,i);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,p=t[s].maxY;l<o.minX&&(o.minX=l),u<o.minY&&(o.minY=u),c>o.maxX&&(o.maxX=c),p>o.maxY&&(o.maxY=p)}return o}function mt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)gt(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)gt(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)gt(o,u[s],t,r,!0,0===s)}if(o.length){var c=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var p in c={},e.tags)c[p]=e.tags[p];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var h={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==e.id&&(h.id=e.id),t.features.push(h)}}function gt(t,e,r,n,i,a){var o=n*n;if(n>0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=s}}(s,a),t.push(s)}}function yt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)K(r,t.features[n],e,n);else K(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=rt(t,1,-1-r,r,0,-1,2,e),a=rt(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=rt(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=ct(i,1).concat(n)),a&&(n=n.concat(ct(a,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function vt(t,e,r){return 32*((1<<t)*r+e)+t}function _t(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new m(n.features),a=x(i);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:i,rawData:a.buffer})}F.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,a=e.nodeSize;r&&console.time("total time");var o="prepare "+t.length+" points";r&&console.time(o),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(N(t[l],l));this.trees[i+1]=new O(s,Z,G,a,Float32Array),r&&console.timeEnd(o);for(var u=i;u>=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new O(s,Z,G,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,p=l.range(V(r),q(a),V(i),q(n));c<p.length;c+=1){var h=l.points[p[c]];u.push(h.numPoints?U(h):this.points[h.index])}return u},F.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[e];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=i.within(a.x,a.y,o);l<u.length;l+=1){var c=i.points[u[l]];c.parentId===t&&s.push(c.numPoints?U(c):this.points[c.index])}if(0===s.length)throw new Error(n);return s},F.prototype.getLeaves=function(t,e,r){var n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n},F.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options,o=a.radius/a.extent,s=(r-o)/i,l=(r+1+o)/i,u={features:[]};return this._addTileFeatures(n.range((e-o)/i,s,(e+1+o)/i,l),n.points,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-o/i,s,1,l),n.points,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,s,o/i,l),n.points,-1,r,i,u),u.features.length?u:null},F.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},F.prototype._appendLeaves=function(t,e,r,n,i){for(var a=0,o=this.getChildren(e);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},F.prototype._addTileFeatures=function(t,e,r,n,i,a){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],u=l.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:u?j(l):this.points[l.index].properties},p=void 0;u?p=l.id:this.options.generateId?p=l.index:this.points[l.index].id&&(p=this.points[l.index].id),void 0!==p&&(c.id=p),a.features.push(c)}},F.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},F.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.reduce,a=n.radius/(n.extent*Math.pow(2,e)),o=0;o<t.length;o++){var s=t[o];if(!(s.zoom<=e)){s.zoom=e;for(var l=this.trees[e+1],u=l.within(s.x,s.y,a),c=s.numPoints||1,p=s.x*c,h=s.y*c,f=i&&c>1?this._map(s,!0):null,d=(o<<5)+(e+1)+this.points.length,m=0,g=u;m<g.length;m+=1){var y=l.points[g[m]];if(!(y.zoom<=e)){y.zoom=e;var v=y.numPoints||1;p+=y.x*v,h+=y.y*v,c+=v,y.parentId=d,i&&(f||(f=this._map(s,!0)),i(f,this._map(y)))}}1===c?r.push(s):(s.parentId=d,r.push(B(p/c,h/c,d,c,f)))}}return r},F.prototype._getOriginId=function(t){return t-this.points.length>>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?H({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?H({},n):n},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,p=vt(e,r,n),h=this.tiles[p];if(!h&&(u>1&&console.time("creation"),h=this.tiles[p]=dt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<<i-e;if(r!==Math.floor(a/d)||n!==Math.floor(o/d))continue}else if(e===l.indexMaxZoom||h.numPoints<=l.indexMaxPoints)continue;if(h.source=null,0!==t.length){u>1&&console.time("clipping");var m,g,y,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=g=y=v=null,_=rt(t,c,r-b,r+T,0,h.minX,h.maxX,l),x=rt(t,c,r+w,r+k,0,h.minX,h.maxX,l),t=null,_&&(m=rt(_,c,n-b,n+T,1,h.minY,h.maxY,l),g=rt(_,c,n+w,n+k,1,h.minY,h.maxY,l),_=null),x&&(y=rt(x,c,n-b,n+T,1,h.minY,h.maxY,l),v=rt(x,c,n+w,n+k,1,h.minY,h.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},yt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<<t,s=vt(t,e=(e%o+o)%o,r);if(this.tiles[s])return ht(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,p=r;!l&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),l=this.tiles[vt(u,c,p)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,p),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,p,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ht(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)p(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)p(e.coordinates[n],r);return e}(o,!0);try{e._geoJSONIndex=n.cluster?new F(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u<c.length;u+=1){var p=c[u],h=n[p],f=h[0],d=t.createExpression(h[1]),m=t.createExpression("string"==typeof f?[f,["accumulated"],["get",p]]:f);i[p]=d.value,a[p]=m.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var a=n[r];e[a]=i[a].evaluate(o,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=t[i],t[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):function(t,e){return new yt(t,e)}(o,n.geojsonVtOptions)}catch(a){return r(a)}e.loaded={};var s={};if(i){var l=i.finish();l&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(l)))}r(null,s)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded;return n&&n[t.uid]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},r}(l),bt=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:xt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,r){for(var n in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][n];for(var a in i)i[a].availableImages=e}r()},bt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},bt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},bt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},bt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},bt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},bt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},bt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},bt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},bt.prototype.syncRTLPluginState=function(e,r,n){try{t.plugin.setState(r);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var a=t.plugin.isParsed();n(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),a)}}catch(t){n(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},bt.prototype.getWorkerSource=function(t,e,r){var n=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,i){n.actor.send(e,r,i,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new bt(t.window)),bt})),n(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(void 0===n[r=t&&t.failIfMajorPerformanceCaveat]&&(n[r]=function(t){var r=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(r)),n[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),t.addEventListener(e,r,"passive"in n&&l?n:n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),t.removeEventListener(e,r,"passive"in n&&l?n:n.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function p(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect();return new t.Point(r.clientX-n.left-e.clientLeft,r.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],a=0;a<r.length;a++)i.push(new t.Point(r[a].clientX-n.left-e.clientLeft,r[a].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e];this._notify(n.ids,n.callback)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];if(a[0]<r||a[1]<a[0]||e<a[1])return!1;r=a[1]}return!0},r.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},r.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1)this.images[i[n]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,p=this.images[s].data,h=p.width,f=p.height;t.RGBAImage.copy(p,o,{x:0,y:0},{x:u,y:c},{width:h,height:f}),t.RGBAImage.copy(p,o,{x:0,y:f-1},{x:u,y:c-1},{width:h,height:1}),t.RGBAImage.copy(p,o,{x:0,y:0},{x:u,y:c+f},{width:h,height:1}),t.RGBAImage.copy(p,o,{x:h-1,y:0},{x:u-1,y:c},{width:1,height:f}),t.RGBAImage.copy(p,o,{x:0,y:0},{x:u+h,y:c},{width:1,height:f})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];p(i)&&this.updateImage(n,i)}}},r}(t.Evented),f=g,d=g,m=1e20;function g(t,e,r,n,i,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(v(n,i,a,o,r),l=0;l<r;l++)t[l*e+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(v(n,i,a,o,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(i[s])}}function v(t,e,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;e[a]=(a-r[o])*(a-r[o])+t[r[o]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++)r[n]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[n]-this.gridInner[n])/this.radius+this.cutoff))));return r},f.default=d;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var a in e)for(var o=0,s=e[a];o<s.length;o+=1)i.push({stack:a,id:s[o]});t.asyncAll(i,(function(t,e){var r=t.stack,i=t.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void e(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(t,e);delete a.requests[s]}))),l.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})}))}}else e(null,{stack:r,id:i,glyph:o})}),(function(t,e){if(t)r(t);else if(e){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,u=o.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,n)}}))},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=e.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new _.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)a(e);else if(r){for(var n={},i=0,o=t.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}}))},_.TinySDF=f;var x=function(){this.specification=t.styleSpec.light.position};x.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},x.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),T=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};T.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},T.prototype.getDashRanges=function(t,e,r){var n=[],i=t.length%2==1?-t[t.length-1]*r:0,a=t[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var u=t[l];n.push({left:i=s*r,right:a=(s+=u)*r,isDash:o=!o,zeroLength:0===u})}return n},T.prototype.addRoundDash=function(t,e,r){for(var n=e/2,i=-r;i<=r;i++)for(var a=this.width*(this.nextRow+r+i),o=0,s=t[o],l=0;l<this.width;l++){l/s.right>1&&(s=t[++o]);var u=Math.abs(l-s.left),c=Math.abs(l-s.right),p=Math.min(u,c),h=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);h=Math.sqrt(p*p+d*d)}else h=n-Math.sqrt(p*p+f*f);this.data[a+l]=Math.max(0,Math.min(255,h+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),p=Math.abs(u-l.right),h=Math.min(c,p);this.data[o+u]=Math.max(0,Math.min(255,(l.isDash?h:-h)+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<e.length;o++)a+=e[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var u={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,u},T.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var k=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=new e.Actor(i[a],n,this.id);o.name="Worker "+a,this.actors.push(o)}};function A(e,r,n){var i=function(i,a){if(i)return n(i);if(a){var o=t.pick(t.extend(a,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(t){return t.id}))),o.tiles=r.canonicalizeTileset(o,e.url),n(null,o)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}k.prototype.broadcast=function(e,r,n){t.asyncAll(this.actors,(function(t,n){t.send(e,r,n)}),n=n||function(){})},k.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},k.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},k.Actor=t.Actor;var M=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};M.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},M.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o};var S=function(e){function r(r,n,i,a){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,a.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),C=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),(function(i,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;e.texture=n.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.Texture(o,a,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=t.window.ImageBitmap&&a instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?a:t.browser.getImageData(a,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:o,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(C),E=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(a),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties},n.workerOptions)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var u=Math.max(i-r,a-n),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),p=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((r+i)/2*p),Math.floor((n+a)/2*p))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1)this.urls.push(this.map._requestManager.transformRequest(i[n],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),D=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(z),O={vector:S,raster:C,"raster-dem":L,geojson:E,video:P,image:z,canvas:D};function R(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function F(t,e,r,n,i,a){var o=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var a=e[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in e){var s=e[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(B);for(var u=[],c=0,p=l;c<p.length;c+=1){var h=p[c];u.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,r,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,i,a,s,R(t.transform,h.tileID))})}var f=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var u in o)for(var c=o[u],p=l[u]=l[u]||{},h=e[u]=e[u]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];p[m.featureIndex]||(p[m.featureIndex]=!0,h.push(m))}}return e}(u);for(var d in f)f[d].forEach((function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return f}function B(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var N=function(t,e){this.max=t,this.onRemove=e,this.reset()};N.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},N.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:e,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout((function(){n.remove(t,a)}),r)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var a=i[n];t(a.value)||e.push(a)}for(var o=0,s=e;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var U=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var j={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=e.attributes[this.attributes[r].name];void 0!==n&&t.enableVertexAttribArray(n)}},V.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[j[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var q=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(t){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var H=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(q),G=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(q),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(q),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(q),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(q),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(q),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(q),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(q),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(q),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(q),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),it=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(q),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(q),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(q),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(q),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(q),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(q),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(q),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(q),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(q),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(q),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(q),yt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(q),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(q),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),bt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(q),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),kt=function(t,e,r,n){this.context=t,this.width=e,this.height=r;var i=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new wt(t,i),n&&(this.depthAttachment=new Tt(t,i))};kt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var At=function(t,e,r){this.func=t,this.mask=e,this.range=r};At.ReadOnly=!1,At.ReadWrite=!0,At.disabled=new At(519,At.ReadOnly,[0,1]);var Mt=function(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Mt.disabled=new Mt({func:519,mask:0},0,0,7680,7680,7680);var St=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};St.disabled=new St(St.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),St.unblended=new St(St.Replace,t.Color.transparent,[!0,!0,!0,!0]),St.alphaBlended=new St([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Ct=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Ct.disabled=new Ct(!1,1029,2305),Ct.backCCW=new Ct(!0,1029,2305);var Lt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new H(this),this.clearDepth=new Z(this),this.clearStencil=new G(this),this.colorMask=new X(this),this.depthMask=new W(this),this.stencilMask=new Y(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new Q(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new nt(this),this.blendColor=new it(this),this.blendEquation=new at(this),this.cullFace=new ot(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new pt(this),this.bindFramebuffer=new ht(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new vt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new xt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};Lt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Lt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Lt.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Lt.prototype.createVertexBuffer=function(t,e,r){return new V(this,t,e,r)},Lt.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Lt.prototype.createFramebuffer=function(t,e,r){return new kt(this,t,e,r)},Lt.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Lt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Lt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Lt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Lt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,St.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Lt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Et=function(e){function r(r,n,i){var a=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))})),this.on("error",(function(){a._sourceErrored=!0})),this._source=function(e,r,n,i){var a=new O[r.type](e,r,n,i);if(a.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+a.id);return t.bindAll(["load","abort","unload","serialize","prepare"],a),a}(r,n,i,this),this._tiles={},this._cache=new N(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(It).map((function(t){return t.key}))},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&n.push(this._tiles[i]);return e?n.sort((function(e,n){var i=e.tileID,a=n.tileID,o=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(It).map((function(t){return t.key}))},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);a(t,i),a(i,t)}}function a(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(zt(this._source.type)){for(var u={},c={},p=0,h=Object.keys(l);p<h.length;p+=1){var f=h[p],d=l[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(d,o);g&&(this._addTile(g.tileID),u[g.tileID.key]=g.tileID),c[f]=d}}for(var y in this._retainLoadedChildren(c,a,s,l),u)l[y]||(this._coveredTiles[y]=!0,l[y]=u[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var _=0,x=t.keysDifference(this._tiles,l);_<x.length;_+=1){var b=x[_],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},a=Math.max(e-r.maxOverzooming,this._source.minzoom),o=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],p=this._addTile(c);n[c.key]=c,p.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,o,n);for(var h=0,f=t;h<f.length;h+=1){var d=f[h],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=a;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a<o.length;a+=1)this._loadedParentTiles[o[a]]=r}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),u=s.map((function(t){return o.pointCoordinate(t)})),c=this.getIds(),p=1/0,h=1/0,f=-1/0,d=-1/0,m=0,g=u;m<g.length;m+=1){var y=g[m];p=Math.min(p,y.x),h=Math.min(h,y.y),f=Math.max(f,y.x),d=Math.max(d,y.y)}for(var v=function(e){var n=i._tiles[c[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*t.EXTENT/n.tileSize/m,y=[s.getTilePoint(new t.MercatorCoordinate(p,h)),s.getTilePoint(new t.MercatorCoordinate(f,d))];if(y[0].x-g<t.EXTENT&&y[0].y-g<t.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)v(_);return a},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(zt(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function It(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function zt(t){return"raster"===t||"image"===t||"video"===t}function Pt(){return new t.window.Worker(Gi.workerUrl)}Et.maxOverzooming=10,Et.maxUnderzooming=3;var Dt="mapboxgl_preloaded_worker_pool",Ot=function(){this.active={}};Ot.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ot.workerCount;)this.workers.push(new Pt);return this.active[t]=!0,this.workers.slice()},Ot.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Ot.prototype.isPreloaded=function(){return!!this.active[Dt]},Ot.prototype.numActive=function(){return Object.keys(this.active).length};var Rt,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Bt(){return Rt||(Rt=new Ot),Rt}function Nt(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}function Ut(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Nt(t[n],e[t[n].ref]));return t}Ot.workerCount=Math.max(Math.min(Ft,6),1);var jt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Vt(t,e,r){r.push({command:jt.addSource,args:[t,e[t]]})}function qt(t,e,r){e.push({command:jt.removeSource,args:[t]}),r[t]=!0}function Ht(t,e,r,n){qt(t,r,n),Vt(t,e,r)}function Zt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Gt(e,r,n,i,a,o){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}))}function Xt(t){return t.id}function Wt(t,e){return t[e.id]=e,t}var Yt=function(t,e){this.reset(t,e)};Yt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Yt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,n=this._distances[r],i=e*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Jt(e,r,n,i,a){var o=t.create();return r?(t.scale(o,o,[1/a,1/a,1]),n||t.rotateZ(o,o,i.angle)):t.multiply(o,i.labelPlaneMatrix,e),o}function Qt(e,r,n,i,a){if(r){var o=t.clone(e);return t.scale(o,o,[a,a,1]),n||t.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function $t(e,r){var n=[e.x,e.y,0,1];ce(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function te(t,e){return.5+t/e*.5}function ee(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<d.length;y++){var v=d.get(y);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!g)ue(v.numGlyphs,h);else{g=!1;var _=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(_,_,r),ee(_,p)){var x=te(n.transform.cameraToCenterDistance,_[3]),b=t.evaluateSizeForFeature(u,c,v),w=s?b/x:b*x,T=new t.Point(v.anchorX,v.anchorY),k=$t(T,a).point,A={},M=ae(v,w,!1,l,r,a,o,e.glyphOffsetArray,f,h,k,T,A,m);g=M.useVertical,(M.notEnoughRoom||g||M.needsFlipping&&ae(v,w,!0,l,r,a,o,e.glyphOffsetArray,f,h,k,T,A,m).notEnoughRoom)&&ue(v.numGlyphs,h)}else ue(v.numGlyphs,h)}}i?e.text.dynamicLayoutVertexBuffer.updateData(h):e.icon.dynamicLayoutVertexBuffer.updateData(h)}function ne(t,e,r,n,i,a,o,s,l,u,c){var p=s.glyphStartIndex+s.numGlyphs,h=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),g=se(t*d,r,n,i,a,o,s.segment,h,f,l,u,c);if(!g)return null;var y=se(t*m,r,n,i,a,o,s.segment,h,f,l,u,c);return y?{first:g,last:y}:null}function ie(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function ae(e,r,n,i,a,o,s,l,u,c,p,h,f,d){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(g,l,y,v,n,p,h,e,u,o,f);if(!w)return{notEnoughRoom:!0};var T=$t(w.first.point,s).point,k=$t(w.last.point,s).point;if(i&&!n){var A=ie(e.writingMode,T,k,d);if(A)return A}m=[w.first];for(var M=e.glyphStartIndex+1;M<_-1;M++)m.push(se(g*l.getoffsetX(M),y,v,n,p,h,e.segment,x,b,u,o,f));m.push(w.last)}else{if(i&&!n){var S=$t(h,a).point,C=e.lineStartIndex+e.segment+1,L=new t.Point(u.getx(C),u.gety(C)),E=$t(L,a),I=E.signedDistanceFromCamera>0?E.point:oe(h,L,S,1,a),z=ie(e.writingMode,S,I,d);if(z)return z}var P=se(g*l.getoffsetX(e.glyphStartIndex),y,v,n,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f);if(!P)return{notEnoughRoom:!0};m=[P]}for(var D=0,O=m;D<O.length;D+=1){var R=O[D];t.addDynamicAttributes(c,R.point,R.angle)}return{}}function oe(t,e,r,n,i){var a=$t(t.add(t.sub(e)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function se(e,r,n,i,a,o,s,l,u,c,p,h){var f=i?e-r:e+r,d=f>0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((g+=d)<l||g>=u)return null;if(v=y,w.push(y),void 0===(y=h[g])){var T=new t.Point(c.getx(g),c.gety(g)),k=$t(T,p);if(k.signedDistanceFromCamera>0)y=h[g]=k.point;else{var A=g-d;y=oe(0===_?o:new t.Point(c.getx(A),c.gety(A)),T,v,b-_+1,p)}}_+=x,x=v.dist(y)}var M=(b-_)/x,S=y.sub(v),C=S.mult(M)._add(v);C._add(S._unit()._perp()._mult(n*d));var L=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(C),{point:C,angle:L,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Kt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],p=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:u-p,y1:c-p,x2:u+p,y2:c+p})}return a?o.filter(a):o}return this._forEachCell(t,e,r,n,this._queryCell,o,{hitTest:i,seenUids:{box:{},circle:{}}},a),i?o.length>0:o},Kt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,u,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?u.length>0:u},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,p=0,h=u;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var _=v[y];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(g[x],g[x+1],g[x+2],t,e,r,n)&&(!s||s(this.circleKeys[_]))){if(o.hitTest)return a.push(!0),!0;var b=g[x],w=g[x+1],T=g[x+2];a.push({key:this.circleKeys[_],x1:b-T,y1:w-T,x2:b+T,y2:w+T})}}}},Kt.prototype._queryCellCircle=function(t,e,r,n,i,a,o,s){var l=o.circle,u=o.seenUids,c=this.boxCells[i];if(null!==c)for(var p=this.bboxes,h=0,f=c;h<f.length;h+=1){var d=f[h];if(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,p[m+0],p[m+1],p[m+2],p[m+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,_=g;v<_.length;v+=1){var x=_[v];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(y[b],y[b+1],y[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return a.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),p=this._convertToYCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++)if(i.call(this,t,e,r,n,this.xCellCount*f+h,a,o,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,r,n,i,a){var o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(le,3*n)}}function ce(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var pe=function(t,e,r){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===r&&(r=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function he(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}pe.prototype.placeCollisionBox=function(t,e,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),o=r*a.perspectiveRatio,s=t.x1*o+a.point.x,l=t.y1*o+a.point.y,u=t.x2*o+a.point.x,c=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,i)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},pe.prototype.placeCollisionCircles=function(e,r,n,i,a,o,s,l,u,c,p,h,f){var d=[],m=new t.Point(r.anchorX,r.anchorY),g=$t(m,o),y=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(c?a/y:a*y)/t.ONE_EM,_=$t(m,s).point,x=ne(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,_,m,r,n,s,{}),b=!1,w=!1,T=!0;if(x){for(var k=.5*h*y+f,A=new t.Point(-100,-100),M=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new Yt,C=x.first,L=x.last,E=[],I=C.path.length-1;I>=1;I--)E.push(C.path[I]);for(var z=1;z<L.path.length;z++)E.push(L.path[z]);var P=2.5*k;if(l){var D=E.map((function(t){return $t(t,l)}));E=D.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:D.map((function(t){return t.point}))}var O=[];if(E.length>0){for(var R=E[0].clone(),F=E[0].clone(),B=1;B<E.length;B++)R.x=Math.min(R.x,E[B].x),R.y=Math.min(R.y,E[B].y),F.x=Math.max(F.x,E[B].x),F.y=Math.max(F.y,E[B].y);O=R.x>=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[E]:F.x<A.x||R.x>M.x||F.y<A.y||R.y>M.y?[]:t.clipLine([E],A.x,A.y,M.x,M.y)}for(var N=0,U=O;N<U.length;N+=1){var j;S.reset(U[N],.25*k),j=S.length<=.5*k?1:Math.ceil(S.paddedLength/P)+1;for(var V=0;V<j;V++){var q=V/Math.max(j-1,1),H=S.lerp(q),Z=H.x+100,G=H.y+100;d.push(Z,G,k,0);var X=Z-k,W=G-k,Y=Z+k,K=G+k;if(T=T&&this.isOffscreen(X,W,Y,K),w=w||this.isInsideGrid(X,W,Y,K),!e&&this.grid.hitTestCircle(Z,G,k,p)&&(b=!0,!u))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!u&&b||!w?[]:d,offscreen:T,collisionDetected:b}},pe.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+100,u.y+100);n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y),r.push(c)}for(var p={},h={},f=0,d=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));f<d.length;f+=1){var m=d[f],g=m.key;if(void 0===p[g.bucketInstanceId]&&(p[g.bucketInstanceId]={}),!p[g.bucketInstanceId][g.featureIndex]){var y=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,y)&&(p[g.bucketInstanceId][g.featureIndex]=!0,void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]=[]),h[g.bucketInstanceId].push(g.featureIndex))}}return h},pe.prototype.insertCollisionBox=function(t,e,r,n,i){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:i},t[0],t[1],t[2],t[3])},pe.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var a=e?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)a.insertCircle(o,t[s],t[s+1],t[s+2])},pe.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return ce(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},pe.prototype.isOffscreen=function(t,e,r,n){return r<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},pe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},pe.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var fe=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};fe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,r,n,i){this.text=new fe(t?t.text:null,e,r,i),this.icon=new fe(t?t.icon:null,e,n,i)};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var me=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ye=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},ve=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function _e(e,r,n,i,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,i);return new t.Point(s+u[0]*a,l+u[1]*a)}function xe(e,r,n,i,a,o){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,p=e.anchorPointX,h=e.anchorPointY,f=new t.Point(r,n);return i&&f._rotate(a?o:-o),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:p,anchorPointY:h}}ve.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new pe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ve(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function we(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}be.prototype.getBucketParts=function(e,r,n,i){var a=n.getBucket(r),o=n.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=n.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),c=n.tileSize/t.EXTENT,p=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),h="map"===l.get("text-pitch-alignment"),f="map"===l.get("text-rotation-alignment"),d=he(n,1,this.transform.zoom),m=Jt(p,h,f,this.transform,d),g=null;if(h){var y=Qt(p,h,f,this.transform,d);g=t.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new ye(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:p,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:u,textPixelRatio:c,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var _=0,x=a.sortKeyRanges;_<x.length;_+=1){var b=x[_];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},be.prototype.attemptAnchorPlacement=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d){var m,g=[p.textOffset0,p.textOffset1],y=_e(t,r,n,g,i),v=this.collisionIndex.placeCollisionBox(xe(e,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(xe(d,y.x,y.y,a,o,this.transform.angle),c,s,l,u.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:y,placedGlyphBoxes:v}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,u=a.textLabelPlaneMatrix,c=a.labelToScreenMatrix,p=a.textPixelRatio,h=a.holdingForFade,f=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(_||!o.hasIconData()||y),A=_&&(v||!o.hasTextData()||g);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var M=function(e,a){if(!r[e.crossTileID])if(h)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var f,T=!1,M=!1,S=!0,C=null,L={box:null,offscreen:null},E={box:null,offscreen:null},I=null,z=null,P=0,D=0,O=0;a.textFeatureIndex?P=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(P=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,i.markUsedOrientation(o,n=a,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(L=n(),E=L):L=r(),!(L&&L.box&&L.box.length));i+=1);else L=r()};if(s.get("text-variable-anchor")){var N=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var U=i.prevPlacement.variableOffsets[e.crossTileID];N.indexOf(U.anchor)>0&&(N=N.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var j=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!_?r:null,h={box:[],offscreen:!1},f=v?2*N.length:N.length,d=0;d<f;++d){var g=i.attemptAnchorPlacement(N[d%N.length],t,a,s,u,x,b,p,l,m,d>=N.length,e,o,n,c);if(g&&(h=g.placedGlyphBoxes)&&h.box&&h.box.length){T=!0,C=g.shift;break}}return h};B((function(){return j(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&!(L&&L.box&&L.box.length)&&e.numVerticalGlyphVertices>0&&r?j(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),L&&(T=L.box,S=L.offscreen);var V=F(L&&L.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,p,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(L&&L.box&&L.box.length)}}if(T=(f=L)&&f.box&&f.box.length>0,S=f&&f.offscreen,e.useRuntimeCollisionCircles){var Z=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),G=t.evaluateSizeForFeature(o.textSizeData,d,Z),X=s.get("text-padding");I=i.collisionIndex.placeCollisionCircles(v,Z,o.lineVertexArray,o.glyphOffsetArray,G,l,u,c,n,b,m.predicate,e.collisionCircleDiameter,X),T=v||I.circles.length>0&&!I.collisionDetected,S=S&&I.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var W=function(t){var e=w&&C?xe(t,C.x,C.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,p,l,m.predicate)};M=E&&E.box&&E.box.length&&a.verticalIconBox?(z=W(a.verticalIconBox)).box.length>0:(z=W(a.iconBox)).box.length>0,S=S&&z.offscreen}var Y=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(Y||K?K?Y||(M=M&&T):T=M&&T:M=T=M&&T,T&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,E&&E.box&&D?D:P,m.ID),M&&z&&i.collisionIndex.insertCollisionBox(z.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),I&&(T&&i.collisionIndex.insertCollisionCircles(I.circles,s.get("text-ignore-placement"),o.bucketInstanceId,P,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new ge);for(var $=0;$<I.circles.length;$+=4)Q.circles.push(I.circles[$+0]),Q.circles.push(I.circles[$+1]),Q.circles.push(I.circles[$+2]),Q.circles.push(I.collisionDetected?1:0)}i.placements[e.crossTileID]=new me(T||k,M||A,S||o.justReloaded),r[e.crossTileID]=!0}};if(T)for(var S=o.getSortedSymbolIndexes(this.transform.angle),C=S.length-1;C>=0;--C){var L=S[C];M(o.symbolInstances.get(L),o.collisionArrays[L])}else for(var E=e.symbolInstanceStart;E<e.symbolInstanceEnd;E++)M(o.symbolInstances.get(E),o.collisionArrays[E]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var I=this.collisionCircleArrays[o.bucketInstanceId];t.invert(I.invProjMatrix,l),I.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},be.prototype.markUsedJustification=function(e,r,n,i){var a;a=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)];for(var o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];o<s.length;o+=1){var l=s[o];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=a>=0&&l!==a?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1)e.text.placedSymbolArray.get(s[o]).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=i[s];u?(this.opacities[s]=new de(u,n,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new de(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in i){var p=i[c];if(!this.opacities[c]){var h=new de(p,n,!1,!1);h.isHidden()||(this.opacities[c]=h,r=r||p.text.placed||p.icon.placed)}}for(var f in a)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=a[f]);for(var d in o)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=o[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.getBucket(t);o&&a.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,r,n){var i=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var a=e.layers[0].layout,o=new de(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=a.get("text-variable-anchor"),c="map"===a.get("text-rotation-alignment"),p="map"===a.get("text-pitch-alignment"),h="none"!==a.get("icon-text-fit"),f=new de(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);for(var d=function(t,e,r){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r)},m=function(n){var a=e.symbolInstances.get(n),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,g=i.opacities[m];r[m]?g=o:g||(i.opacities[m]=g=f),r[m]=!0;var y=a.numIconVertices>0,v=i.placedOrientations[a.crossTileID],_=v===t.WritingMode.vertical,x=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Ee(g.text);d(e.text,s,_?Ie:b),d(e.text,l,x?Ie:b);var w=g.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var T=i.variableOffsets[a.crossTileID];T&&i.markUsedJustification(e,T.anchor,a,v);var k=i.placedOrientations[a.crossTileID];k&&(i.markUsedJustification(e,"left",a,k),i.markUsedOrientation(e,k,a))}if(y){var A=Ee(g.icon),M=!(h&&a.verticalPlacedIconSymbolIndex&&_);a.placedIconSymbolIndex>=0&&(d(e.icon,a.numIconVertices,M?A:Ie),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=g.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,a.numVerticalIconVertices,M?Ie:A),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var S=e.collisionArrays[n];if(S){var C=new t.Point(0,0);if(S.textBox||S.verticalTextBox){var L=!0;if(u){var E=i.variableOffsets[m];E?(C=_e(E.anchor,E.width,E.height,E.textOffset,E.textBoxScale),c&&C._rotate(p?i.transform.angle:-i.transform.angle)):L=!1}S.textBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!L||_,C.x,C.y),S.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,g.text.placed,!L||x,C.x,C.y)}var I=Boolean(!x&&S.verticalIconBox);S.iconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,I,h?C.x:0,h?C.y:0),S.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!I,h?C.x:0,h?C.y:0)}}},g=0;g<e.symbolInstances.length;g++)m(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=y.invProjMatrix,e.placementViewportMatrix=y.viewportMatrix,e.collisionCircleArray=y.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},be.prototype.setStale=function(){this.stale=!0};var Te=Math.pow(2,25),ke=Math.pow(2,24),Ae=Math.pow(2,17),Me=Math.pow(2,16),Se=Math.pow(2,9),Ce=Math.pow(2,8),Le=Math.pow(2,1);function Ee(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Te+e*ke+r*Ae+e*Me+r*Se+e*Ce+r*Le+e}var Ie=0,ze=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ze.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(a,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<a.length;)if(e.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1};var Pe=function(t,e,r,n,i,a,o){this.placement=new be(t,i,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Pe.prototype.isDone=function(){return this._done},Pe.prototype.continuePlacement=function(e,r,n){for(var i=this,a=t.browser.now(),o=function(){var e=t.browser.now()-a;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ze(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Pe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var De=512/t.EXTENT/2,Oe=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Oe.prototype.getScaledCoordinates=function(e,r){var n=De/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*n),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*n)}},Oe.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var a=t.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,e),l=0,u=o;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!r[c.crossTileID]){r[c.crossTileID]=!0,a.crossTileID=c.crossTileID;break}}}}};var Re=function(){this.maxCrossTileID=0};Re.prototype.generate=function(){return++this.maxCrossTileID};var Fe=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Fe.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=t},Fe.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var u=o[t.scaledTo(Number(a)).key];u&&u.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=r.generate(),i[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Oe(t,e.symbolInstances,e.bucketInstanceId),!0},Fe.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1)delete this.usedCrossTileIDs[t][i[n].crossTileID]},Fe.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Be=function(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Be.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Fe);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(i=!0),a[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Be.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var Ne=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Ue=t.pick(jt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),je=t.pick(jt,["setCenter","setZoom","setBearing","setPitch"]),Ve=function(){var e={},r=t.styleSpec.$version;for(var n in t.styleSpec.$root){var i,a=t.styleSpec.$root[n];a.required&&null!=(i="version"===n?r:"array"===a.type?[]:{})&&(e[n]=i)}return e}(),qe=function(e){function r(n,i){var a=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new k(Bt(),this),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new _(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new Be,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var n in o.sourceCaches)o.sourceCaches[n].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=a.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}}))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,(function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ve,!1)},r.prototype._load=function(e,r){if(!r||!Ne(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(n,e.sources[n],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Ut(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var a=0,o=i;a<o.length;a+=1){var s=o[a];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,n){var i,a,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,o||(o=t,a=e,c())}));function c(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,p=l.x,h=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,v,{x:p,y:h},{x:0,y:0},{width:u,height:c}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=this._layers[n[r]];"custom"!==i.type&&e.push(i.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var u=0,c=this._order;u<c.length;u+=1){var p=this._layers[c[u]];p.recalculate(e,this._availableImages),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),Ne(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Ut(e.layers);var n=function(e,r){if(!e)return[{command:jt.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:jt.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:jt.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:jt.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:jt.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:jt.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:jt.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:jt.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:jt.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:jt.setLight,args:[r.light]});var i={},a=[];!function(e,r,n,i){var a;for(a in r=r||{},e=e||{})e.hasOwnProperty(a)&&(r.hasOwnProperty(a)||qt(a,n,i));for(a in r)r.hasOwnProperty(a)&&(e.hasOwnProperty(a)?t.deepEqual(e[a],r[a])||("geojson"===e[a].type&&"geojson"===r[a].type&&Zt(e,r,a)?n.push({command:jt.setGeoJSONSourceData,args:[a,r[a].data]}):Ht(a,r,n,i)):Vt(a,r,n))}(e.sources,r.sources,a,i);var o=[];e.layers&&e.layers.forEach((function(t){i[t.source]?n.push({command:jt.removeLayer,args:[t.id]}):o.push(t)})),n=n.concat(a),function(e,r,n){r=r||[];var i,a,o,s,l,u,c,p=(e=e||[]).map(Xt),h=r.map(Xt),f=e.reduce(Wt,{}),d=r.reduce(Wt,{}),m=p.slice(),g=Object.create(null);for(i=0,a=0;i<p.length;i++)d.hasOwnProperty(o=p[i])?a++:(n.push({command:jt.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<h.length;i++)m[m.length-1-i]!==(o=h[h.length-1-i])&&(f.hasOwnProperty(o)?(n.push({command:jt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,n.push({command:jt.addLayer,args:[d[o],u=m[m.length-i]]}),m.splice(m.length-i,0,o),g[o]=!0);for(i=0;i<h.length;i++)if(s=f[o=h[i]],l=d[o],!g[o]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Gt(s.layout,l.layout,n,o,null,jt.setLayoutProperty),Gt(s.paint,l.paint,n,o,null,jt.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:jt.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:jt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Gt(s[c],l[c],n,o,c.slice(6),jt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:jt.setLayerProperty,args:[o,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Gt(s[c],l[c],n,o,c.slice(6),jt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:jt.setLayerProperty,args:[o,c,l[c]]}))}else n.push({command:jt.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],n.push({command:jt.addLayer,args:[l,u]})}(o,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:jt.setStyle,args:[r]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in je)}));if(0===n.length)return!1;var i=n.filter((function(t){return!(t.command in Ue)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Et(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(Ne(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][o];if(u)for(var c=0,p=u;c<p.length;c+=1)i.push(p[c])}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var h=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(r(d))for(var m=i.length-1;m>=0;m--){var g=i[m].feature;if(n[g.layer.id]<f)break;h.push(g),i.pop()}else for(var y=0,v=t;y<v.length;y+=1){var _=v[y][d];if(_)for(var x=0,b=_;x<b.length;x+=1)h.push(b[x].feature)}}return h},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var u=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[c]||u.push(F(this.sourceCaches[c],this._layers,this._serializedLayers,e,r,n));return this.placement&&u.push(function(t,e,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),u=[],c=0,p=Object.keys(l).map(Number);c<p.length;c+=1)u.push(o[p[c]]);u.sort(B);for(var h=function(){var r=d[f],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var a in n){var o=s[a]=s[a]||[],u=n[a];u.sort((function(t,e){var n=r.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(var c=0,p=u;c<p.length;c+=1)o.push(p[c])}},f=0,d=u;f<d.length;f+=1)h();var m=function(e){s[e].forEach((function(n){var i=n.feature,a=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}))};for(var g in s)m(g);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in e)if(!t.deepEqual(e[a],n[a])){i=!0;break}if(i){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}},r.prototype._validate=function(e,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Ne(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},u=0,c=this._order;u<c.length;u+=1){var p=this._layers[c[u]];if("symbol"===p.type){if(!l[p.source]){var h=this.sourceCaches[p.source];l[p.source]=h.getRenderableIds(!0).map((function(t){return h.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(p,l[p.source],e.center.lng);o=o||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Pe(e,this._order,a,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var d=0,m=this._order;d<m.length;d+=1){var g=this._layers[m[d]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,l[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);qe.getSourceType=function(t){return O[t]},qe.setSourceType=function(t,e){O[t]=e},qe.registerForPluginStateChange=t.registerForPluginStateChange;var He=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ze=yr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Ge=yr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Xe=yr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),We=yr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ye=yr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ke=yr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Je=yr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),Qe=yr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),$e=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),ar=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),or=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),lr=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}))}}var vr=Object.freeze({__proto__:null,prelude:Ze,background:Ge,backgroundPattern:Xe,circle:We,clippingMask:Ye,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:ar,fillExtrusionPattern:or,hillshadePrepare:sr,hillshade:lr,line:ur,lineGradient:cr,linePattern:pr,lineSDF:hr,raster:fr,symbolIcon:dr,symbolSDF:mr,symbolTextAndIcon:gr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};_r.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!l&&this.boundIndexBuffer===i&&this.boundVertexOffset===a&&this.boundDynamicVertexBuffer===o&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind()):this.freshBind(e,r,n,i,a,o,s)},_r.prototype.freshBind=function(t,e,r,n,i,a,o){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var p=l;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;h<f.length;h+=1)f[h].enableAttributes(c,t);a&&a.enableAttributes(c,t),o&&o.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=r;d<m.length;d+=1){var g=m[d];g.bind(),g.setVertexAttribPointers(c,t,i)}a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),u.currentNumAttributes=l},_r.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xr=function(t,e,r,n,i){var a=t.gl;this.program=a.createProgram();var o=r?r.defines():[];i&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(Ze.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(Ze.vertexSource,e.vertexSource).join("\n"),u=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(u,s),a.compileShader(u),a.attachShader(this.program,u);var c=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(c,l),a.compileShader(c),a.attachShader(this.program,c);for(var p=r?r.layoutAttributes:[],h=0;h<p.length;h++)a.bindAttribLocation(this.program,h,p[h].name);a.linkProgram(this.program),a.deleteShader(c),a.deleteShader(u),this.numAttributes=a.getProgramParameter(this.program,a.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var m=a.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=a.getAttribLocation(this.program,m.name))}for(var g=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),y=0;y<g;y++){var v=a.getActiveUniform(this.program,y);v&&(f[v.name]=a.getUniformLocation(this.program,v.name))}this.fixedUniforms=n(t,f),this.binderUniforms=r?r.getUniforms(t,f):[]}}};function br(t,e,r){var n=1/he(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}xr.prototype.draw=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],T=w.vaos||(w.vaos={});(T[s]||(T[s]=new _r)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),y.drawElements(e,w.primitiveLength*_,y.UNSIGNED_SHORT,w.primitiveOffset*_*2)}}};var wr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Tr=function(e,r,n,i,a,o,s){return t.extend(wr(e,r,n,i),br(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},kr=function(t){return{u_matrix:t}},Ar=function(e,r,n,i){return t.extend(kr(e),br(n,r,i))},Mr=function(t,e){return{u_matrix:t,u_world:e}},Sr=function(e,r,n,i,a){return t.extend(Ar(e,r,n,i),{u_world:a})},Cr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=he(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},Lr=function(t,e,r){var n=he(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Er=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Ir=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},zr=function(t){return{u_matrix:t}},Pr=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:he(e,1,r),u_intensity:n}},Dr=function(e,r,n){var i=e.transform;return{u_matrix:Nr(e,r,n),u_ratio:1/he(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Or=function(e,r,n){return t.extend(Dr(e,r,n),{u_image:0})},Rr=function(e,r,n,i){var a=e.transform,o=Br(r,a);return{u_matrix:Nr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/he(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Fr=function(e,r,n,i,a){var o=e.lineAtlas,s=Br(r,e.transform),l="round"===n.layout.get("line-cap"),u=o.getDash(i.from,l),c=o.getDash(i.to,l),p=u.width*a.fromScale,h=c.width*a.toScale;return t.extend(Dr(e,r,n),{u_patternscale_a:[s/p,-u.height/2],u_patternscale_b:[s/h,-c.height/2],u_sdfgamma:o.width/(256*Math.min(p,h)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:c.y,u_mix:a.t})};function Br(t,e){return 1/he(t,1,e.tileZoom)}function Nr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Ur=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:jr(i.paint.get("raster-hue-rotate"))};var a,o};function jr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Vr,qr=function(t,e,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Hr=function(e,r,n,i,a,o,s,l,u,c,p){var h=a.transform;return t.extend(qr(e,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Zr=function(e,r,n,i,a,o,s,l,u,c){return t.extend(Hr(e,r,n,i,a,o,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Gr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,p=c*(n.tileID.canonical.x+n.tileID.wrap*u),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/he(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},Wr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Yr(e,r,n,i,a,o,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),p=[],h=0,f=0,d=0;d<i.length;d++){var m=i[d],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;0===a[0]&&0===a[1]||(v=e.translatePosMatrix(m.posMatrix,g,a,o));var _=s?y.textCollisionBox:y.iconCollisionBox,x=y.collisionCircleArray;if(x.length>0){var b=t.create(),w=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),p.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=h+=x.length/4}_&&c.draw(l,u.LINES,At.disabled,Mt.disabled,e.colorModeForRenderPass(),Ct.disabled,Lr(v,e.transform,g),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&p.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var A=0,M=0,S=p;M<S.length;M+=1)for(var C=S[M],L=0;L<C.circleArray.length/4;L++){var E=4*L,I=C.circleArray[E+0],z=C.circleArray[E+1],P=C.circleArray[E+2],D=C.circleArray[E+3];k.emplace(A++,I,z,P,D,0),k.emplace(A++,I,z,P,D,1),k.emplace(A++,I,z,P,D,2),k.emplace(A++,I,z,P,D,3)}(!Vr||Vr.length<2*h)&&(Vr=function(e){var r=2*e,n=new t.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var a=6*i;n.uint16[a+0]=4*i+0,n.uint16[a+1]=4*i+1,n.uint16[a+2]=4*i+2,n.uint16[a+3]=4*i+2,n.uint16[a+4]=4*i+3,n.uint16[a+5]=4*i+0}return n}(h));for(var O=l.createIndexBuffer(Vr,!0),R=l.createVertexBuffer(k,t.collisionCircleLayout.members,!0),F=0,B=p;F<B.length;F+=1){var N=B[F],U=Er(N.transform,N.invTransform,e.transform);T.draw(l,u.TRIANGLES,At.disabled,Mt.disabled,e.colorModeForRenderPass(),Ct.disabled,U,n.id,R,O,t.SegmentVector.simpleSegment(0,2*N.circleOffset,N.circleArray.length,N.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),O.destroy()}}var Kr=t.identity(new Float32Array(16));function Jr(e,r,n,i,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point((l/a+c[0])*o,(u/a+c[1])*o)}function Qr(e,r,n,i,a,o,s,l,u,c,p){var h=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};f.clear();for(var g=0;g<h.length;g++){var y=h.get(g),v=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:i[y.crossTileID];if(v){var _=new t.Point(y.anchorX,y.anchorY),x=$t(_,n?l:s),b=te(o.cameraToCenterDistance,x.signedDistanceFromCamera),w=a.evaluateSizeForFeature(e.textSizeData,c,y)*b/t.ONE_EM;n&&(w*=e.tilePixelRatio/u);for(var T=Jr(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,w),k=n?$t(_.add(T),s).point:x.point.add(r?T.rotate(-o.angle):T),A=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,M=0;M<y.numGlyphs;M++)t.addDynamicAttributes(f,k,A);p&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:k,angle:A})}else ue(y.numGlyphs,f)}if(p){d.clear();for(var S=e.icon.placedSymbolArray,C=0;C<S.length;C++){var L=S.get(C);if(L.hidden)ue(L.numGlyphs,d);else{var E=m[C];if(E)for(var I=0;I<L.numGlyphs;I++)t.addDynamicAttributes(d,E.shiftedAnchor,E.angle);else ue(L.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function $r(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function tn(e,r,n,i,a,o,s,l,u,c,p,h){for(var f=e.context,d=f.gl,m=e.transform,g="map"===l,y="map"===u,v=g&&"point"!==n.layout.get("symbol-placement"),_=g&&!y&&!v,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1),b=e.depthModeForSublayer(0,At.ReadOnly),w=n.layout.get("text-variable-anchor"),T=[],k=0,A=i;k<A.length;k+=1){var M=A[k],S=r.getTile(M),C=S.getBucket(n);if(C){var L=a?C.text:C.icon;if(L&&L.segments.get().length){var E=L.programConfigurations.get(n.id),I=a||C.sdfIcons,z=a?C.textSizeData:C.iconSizeData,P=y||0!==m.pitch,D=e.useProgram($r(I,a,C),E),O=t.evaluateSizeForZoom(z,m.zoom),R=void 0,F=[0,0],B=void 0,N=void 0,U=null,j=void 0;if(a)B=S.glyphAtlasTexture,N=d.LINEAR,R=S.glyphAtlasTexture.size,C.iconsInText&&(F=S.imageAtlasTexture.size,U=S.imageAtlasTexture,j=P||e.options.rotating||e.options.zooming||"composite"===z.kind||"camera"===z.kind?d.LINEAR:d.NEAREST);else{var V=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;B=S.imageAtlasTexture,N=I||e.options.rotating||e.options.zooming||V||P?d.LINEAR:d.NEAREST,R=S.imageAtlasTexture.size}var q=he(S,1,e.transform.zoom),H=Jt(M.posMatrix,y,g,e.transform,q),Z=Qt(M.posMatrix,y,g,e.transform,q),G=w&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&G&&C.hasIconData();v&&re(C,M.posMatrix,e,a,H,Z,y,c);var W=e.translatePosMatrix(M.posMatrix,S,o,s),Y=v||a&&w||X?Kr:H,K=e.translatePosMatrix(Z,S,o,s,!0),J=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:D,buffers:L,uniformValues:I?C.iconsInText?Zr(z.kind,O,_,y,e,W,Y,K,R,F):Hr(z.kind,O,_,y,e,W,Y,K,a,R,!0):qr(z.kind,O,_,y,e,W,Y,K,a,R),atlasTexture:B,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:j,isSDF:I,hasHalo:J};if(x)for(var $=0,tt=L.segments.get();$<tt.length;$+=1){var et=tt[$];T.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q})}else T.push({segments:L.segments,sortKey:0,state:Q})}}}x&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var rt=0,nt=T;rt<nt.length;rt+=1){var it=nt[rt],at=it.state;if(f.activeTexture.set(d.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,d.CLAMP_TO_EDGE),at.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),at.isSDF){var ot=at.uniformValues;at.hasHalo&&(ot.u_is_halo=1,en(at.buffers,it.segments,n,e,at.program,b,p,h,ot)),ot.u_is_halo=0}en(at.buffers,it.segments,n,e,at.program,b,p,h,at.uniformValues)}}function en(t,e,r,n,i,a,o,s,l){var u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Ct.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function rn(t,e,r,n,i,a,o){var s,l,u,c,p,h=t.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=d?"fillPattern":"fill",s=h.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],_=e.getTile(v);if(!d||_.patternsLoaded()){var x=_.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(h.TEXTURE0),_.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var T=f.constantOr(null);if(T&&_.imageAtlas){var k=_.imageAtlas,A=k.patternPositions[T.to.toString()],M=k.patternPositions[T.from.toString()];A&&M&&b.setConstantPatternPositions(A,M)}var S=t.translatePosMatrix(v.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=x.indexBuffer2,p=x.segments2;var C=[h.drawingBufferWidth,h.drawingBufferHeight];u="fillOutlinePattern"===l&&d?Sr(S,t,m,_,C):Mr(S,C)}else c=x.indexBuffer,p=x.segments,u=d?Ar(S,t,m,_):kr(S);w.draw(t.context,s,i,t.stencilModeForClipping(v),a,Ct.disabled,u,r.id,x.layoutVertexBuffer,c,p,r.paint,t.transform.zoom,b)}}}}function nn(t,e,r,n,i,a,o){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),p=r.getCrossfadeParameters(),h=r.paint.get("fill-extrusion-opacity"),f=0,d=n;f<d.length;f+=1){var m=d[f],g=e.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(p));var x=u.constantOr(null);if(x&&g.imageAtlas){var b=g.imageAtlas,w=b.patternPositions[x.to.toString()],T=b.patternPositions[x.from.toString()];w&&T&&v.setConstantPatternPositions(w,T)}var k=t.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),A=r.paint.get("fill-extrusion-vertical-gradient"),M=c?Tr(k,t,A,h,m,p,g):wr(k,t,A,h);_.draw(s,s.gl.TRIANGLES,i,a,o,Ct.backCCW,M,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,v)}}}function an(e,r,n,i,a,o){var s=e.context,l=s.gl,u=r.fbo;if(u){var c=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get());var p=function(e,r,n){var i=n.paint.get("hillshade-shadow-color"),a=n.paint.get("hillshade-highlight-color"),o=n.paint.get("hillshade-accent-color"),s=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,u,c,p=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),p),u_image:0,u_latrange:(l=r.tileID,u=Math.pow(2,l.canonical.z),c=l.canonical.y,[new t.MercatorCoordinate(0,c/u).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/u).toLngLat().lat]),u_light:[n.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}}(e,r,n);c.draw(s,l.TRIANGLES,i,a,o,Ct.disabled,p,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function on(e,r,n,i,a,o,s){var l=e.context,u=l.gl,c=r.dem;if(c&&c.data){var p=c.dim,h=c.stride,f=c.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){var d=r.demTexture;d.update(f,{premultiply:!1}),d.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(l,f,u.RGBA,{premultiply:!1}),r.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);var m=r.fbo;if(!m){var g=new t.Texture(l,{width:p,height:p,data:null},u.RGBA);g.bind(u.LINEAR,u.CLAMP_TO_EDGE),(m=r.fbo=l.createFramebuffer(p,p,!0)).colorAttachment.set(g.texture)}l.bindFramebuffer.set(m.framebuffer),l.viewport.set([0,0,p,p]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,a,o,s,Ct.disabled,function(e,r,n){var i=r.stride,a=t.create();return t.ortho(a,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(a,a,[0,-t.EXTENT,0]),{u_matrix:a,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_maxzoom:n,u_unpack:r.getUnpackVector()}}(r.tileID,c,i),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function sn(e,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),p=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),f=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),un=new t.Color(0,1,0,1),cn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),hn=new t.Color(0,1,1,1);function fn(t,e,r,n){mn(t,0,e+r/2,t.transform.width,r,n)}function dn(t,e,r,n){mn(t,e-r/2,0,r,t.transform.height,n)}function mn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function gn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=At.disabled,u=Mt.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,u,c,Ct.disabled,Ir(o,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,h=Math.floor((p&&p.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,m=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(m+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,m+" "+h+"kb"),s.draw(i,a.TRIANGLES,l,u,St.alphaBlended,Ct.disabled,Ir(o,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Mt.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,u="map"===a,c="map"===o,p=0,h=e;p<h.length;p+=1){var f=h[p],d=i.getTile(f),m=d.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=t.evaluateSizeForZoom(m.textSizeData,l.zoom),y=he(d,1,r.transform.zoom),v=Jt(f.posMatrix,c,u,r.transform,y),_="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(g){var x=Math.pow(2,l.zoom-d.tileID.overscaledZ);Qr(m,u,c,s,t.symbolSize,l,v,f.posMatrix,x,g,_)}}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&tn(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&tn(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Yr(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Yr(e,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,c=u.gl,p=e.depthModeForSublayer(0,At.ReadOnly),h=Mt.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var g=i[m],y=r.getTile(g),v=y.getBucket(n);if(v){var _=v.programConfigurations.get(n.id),x={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Cr(e,g,y,n)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var T=w[b];d.push({segments:new t.SegmentVector([T]),sortKey:T.sortKey,state:x})}else d.push({segments:v.segments,sortKey:0,state:x})}}l&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var k=0,A=d;k<A.length;k+=1){var M=A[k],S=M.state;S.program.draw(u,c.TRIANGLES,p,h,f,Ct.disabled,S.uniformValues,n.id,S.layoutVertexBuffer,S.indexBuffer,M.segments,n.paint,e.transform.zoom,S.programConfiguration)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var a=e.context,o=a.gl,s=Mt.disabled,l=new St([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,n){var i=t.gl;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE,null),n.colorAttachment.set(r)}(t,e,a,i)}}(a,e,n),a.clear({color:t.Color.transparent});for(var u=0;u<i.length;u++){var c=i[u];if(!r.hasRenderableParent(c)){var p=r.getTile(c),h=p.getBucket(n);if(h){var f=h.programConfigurations.get(n.id);e.useProgram("heatmap",f).draw(a,o.TRIANGLES,At.disabled,s,l,Ct.disabled,Pr(c.posMatrix,p,e.transform.zoom,n.paint.get("heatmap-intensity")),n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,e.transform.zoom,f)}}}a.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,At.disabled,Mt.disabled,e.colorModeForRenderPass(),Ct.disabled,function(e,r,n,i){var a=t.create();t.ortho(a,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=e.depthModeForSublayer(0,At.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),p=c.constantOr(1),h=n.paint.get("line-gradient"),f=n.getCrossfadeParameters(),d=p?"linePattern":u?"lineSDF":h?"lineGradient":"line",m=e.context,g=m.gl,y=!0;if(h){m.activeTexture.set(g.TEXTURE0);var v=n.gradientTexture;if(!n.gradient)return;v||(v=n.gradientTexture=new t.Texture(m,n.gradient,g.RGBA)),v.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var _=0,x=i;_<x.length;_+=1){var b=x[_],w=r.getTile(b);if(!p||w.patternsLoaded()){var T=w.getBucket(n);if(T){var k=T.programConfigurations.get(n.id),A=e.context.program.get(),M=e.useProgram(d,k),S=y||M.program!==A,C=c.constantOr(null);if(C&&w.imageAtlas){var L=w.imageAtlas,E=L.patternPositions[C.to.toString()],I=L.patternPositions[C.from.toString()];E&&I&&k.setConstantPatternPositions(E,I)}var z=p?Rr(e,w,n,f):u?Fr(e,w,n,u,f):h?Or(e,w,n):Dr(e,w,n);p?(m.activeTexture.set(g.TEXTURE0),w.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),k.updatePaintBuffers(f)):u&&(S||e.lineAtlas.dirty)&&(m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m)),M.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(b),l,Ct.disabled,z,n.id,T.layoutVertexBuffer,T.indexBuffer,T.segments,n.paint,e.transform.zoom,k),y=!1}}}}}},fill:function(e,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?At.ReadWrite:At.ReadOnly);rn(e,r,n,i,c,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var p=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,At.ReadOnly);rn(e,r,n,i,p,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var a=new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))nn(t,e,r,n,a,Mt.disabled,St.disabled),nn(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();nn(t,e,r,n,a,Mt.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,a=e.getSource().maxzoom,o=t.depthModeForSublayer(0,At.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],u=l[0],c=0,p=l[1];c<p.length;c+=1){var h=p[c],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?on(t,f,r,a,o,Mt.disabled,s):"translucent"===t.renderPass&&an(t,f,r,o,u[h.overscaledZ],s)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=o instanceof z?[{},n]:t.stencilConfigForOverlap(n),c=u[0],p=u[1],h=p[p.length-1].overscaledZ,f=!t.options.moving,d=0,m=p;d<m.length;d+=1){var g=m[d],y=t.depthModeForSublayer(g.overscaledZ-h,1===r.paint.get("raster-opacity")?At.ReadWrite:At.ReadOnly,a.LESS),v=e.getTile(g),_=t.transform.calculatePosMatrix(g.toUnwrapped(),f);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var x=e.findLoadedParent(g,0),b=sn(v,x,e,r,t.transform),w=void 0,T=void 0,k="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),x?(x.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-v.tileID.overscaledZ),T=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(k,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var A=Ur(_,T||[0,0],w||1,b,r);o instanceof z?s.draw(i,a.TRIANGLES,y,Mt.disabled,l,Ct.disabled,A,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,c[g.overscaledZ],l,Ct.disabled,A,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=t.context,o=a.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var p=Mt.disabled,h=t.depthModeForSublayer(0,"opaque"===c?At.ReadWrite:At.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var _=v[y],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=u?Xr(x,i,t,u,{tileID:_,tileSize:l},g):Gr(x,i,n);d.draw(a,o.TRIANGLES,h,p,f,Ct.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)gn(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var a=i.prerender;a&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),a.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Mt.disabled);var o="3d"===i.renderingMode?new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,At.ReadOnly);n.setDepthMode(o),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},vn=function(t,e){this.context=new Lt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Et.maxUnderzooming+Et.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Be,this.gpuTimers={}};vn.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1)this.style._layers[i[n]].resize()},vn.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,He.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,He.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,I.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,He.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Mt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},vn.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,At.disabled,this.stencilClearMode,St.disabled,Ct.disabled,zr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(At.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,At.disabled,new Mt({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),St.disabled,Ct.disabled,zr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Mt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+i]=new Mt({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=a,[o,n]}return[(e={},e[i]=Mt.disabled,e),n]},vn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new St([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?St.unblended:St.alphaBlended},vn.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return At.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new At(r||this.context.gl.LEQUAL,e,[n,n])},vn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vn.prototype.render=function(e,r){var n=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var i=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var l,u,c={},p={},h={};for(var f in a){var d=a[f];c[f]=d.getVisibleCoordinates(),p[f]=c[f].slice().reverse(),h[f]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++)if(this.style._layers[i[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var g=0,y=i;g<y.length;g+=1){var v=this.style._layers[y[g]];if(v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)){var _=p[v.source];("custom"===v.type||_.length)&&this.renderLayer(this,a[v.source],v,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=a[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var T=this.style._layers[i[this.currentLayer]],k=a[T.source],A=("symbol"===T.type?h:p)[T.source];this._renderTileClippingMasks(T,c[T.source]),this.renderLayer(this,k,T,A)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(u&&u.id)&&(u=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<u.getSource().maxzoom)&&(l=u))})),l&&yn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;fn(t,t.transform.height-(e.top||0),3,ln),fn(t,e.bottom||0,3,un),dn(t,e.left||0,3,cn),dn(t,t.transform.width-(e.right||0),3,pn);var r=t.transform.centerPoint;!function(t,e,r,n){mn(t,e-1,r-10,2,20,n),mn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,hn)}(this),this.context.setDefault()},vn.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),yn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},vn.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},vn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},vn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},vn.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var n=t[r],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),e[r]=a}return e},vn.prototype.translatePosMatrix=function(e,r,n,i,a){if(!n[0]&&!n[1])return e;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var u=[a?n[0]:he(r,n[0],this.transform.zoom),a?n[1]:he(r,n[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},vn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},vn.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},vn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},vn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new xr(this.context,vr[t],e,Wr[t],this._showOverdrawInspector)),this.cache[r]},vn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},vn.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _n=function(t,e){this.points=t,this.planes=e};_n.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new _n(a,o)};var xn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a<r.length;a++)n[a]=r[a]?this.min[a]:this.center[a],i[a]=r[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new xn(n,i)},xn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},xn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},xn.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,i=0;i<e.planes.length;i++){for(var a=e.planes[i],o=0,s=0;s<r.length;s++)o+=t.dot$1(a,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p<e.points.length;p++){var h=e.points[p][l]-this.min[l];u=Math.min(u,h),c=Math.max(c,h)}if(c<0||u>this.max[l]-this.min[l])return 0}return 1};var bn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};bn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},bn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},bn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},bn.prototype.clone=function(){return new bn(this.top,this.bottom,this.left,this.right)},bn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new bn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Tn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wn.prototype.clone=function(){var t=new wn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Tn.minZoom.get=function(){return this._minZoom},Tn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Tn.maxZoom.get=function(){return this._maxZoom},Tn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Tn.minPitch.get=function(){return this._minPitch},Tn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Tn.maxPitch.get=function(){return this._maxPitch},Tn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Tn.renderWorldCopies.get=function(){return this._renderWorldCopies},Tn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Tn.worldSize.get=function(){return this.tileSize*this.scale},Tn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Tn.size.get=function(){return new t.Point(this.width,this.height)},Tn.bearing.get=function(){return-this.angle/Math.PI*180},Tn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Tn.pitch.get=function(){return this._pitch/Math.PI*180},Tn.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Tn.fov.get=function(){return this._fov/Math.PI*180},Tn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Tn.zoom.get=function(){return this._zoom},Tn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Tn.center.get=function(){return this._center},Tn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Tn.padding.get=function(){return this._edgeInsets.toJSON()},Tn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Tn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},wn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},wn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=_n.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new xn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],p=[],h=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var m=c.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var _=m.aabb.intersects(s);if(0===_)continue;v=2===_}var x=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(x),Math.abs(b));if(m.zoom===h||w>3+(1<<h-m.zoom)-2&&m.zoom>=l)p.push({tileID:new t.OverscaledTileID(m.zoom===h?f:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var T=0;T<4;T++){var k=(g<<1)+T%2,A=(y<<1)+(T>>1);c.push({aabb:m.aabb.quadrant(T),zoom:m.zoom+1,x:k,y:A,wrap:m.wrap,fullyVisible:v})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Tn.unmodified.get=function(){return this._unmodified},wn.prototype.zoomScale=function(t){return Math.pow(2,t)},wn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},wn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Tn.point.get=function(){return this.project(this.center)},wn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},wn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wn.prototype.coordinateLocation=function(t){return t.toLngLat()},wn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[1]/i,s=n[1]/a,l=r[2]/i,u=n[2]/a,c=l===u?0:(0-l)/(u-l);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/a,c)/this.worldSize,t.number(o,s,c)/this.worldSize)},wn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},wn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},wn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;a=t.mercatorYfromLat(p[1])*this.worldSize,e=(o=t.mercatorYfromLat(p[0])*this.worldSize)-a<u.y?u.y/(o-a):0}if(this.lngRange){var h=this.lngRange;s=t.mercatorXfromLng(h[0])*this.worldSize,r=(l=t.mercatorXfromLng(h[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var f=this.point,d=Math.max(r||0,e||0);if(d)return this.center=this.unproject(new t.Point(r?(l+s)/2:f.x,e?(o+a)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,g=u.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=f.x,v=u.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},wn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),a=this.point,o=a.x,s=a.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,l),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-o,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,h=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=o-Math.round(o)+f*p+d*h,g=s-Math.round(s)+f*h+d*p,y=new Float64Array(c);if(t.translate(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},wn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y)}return[new t.Point(n,i),new t.Point(a,i),new t.Point(a,o),new t.Point(n,o),new t.Point(n,i)]},Object.defineProperties(wn.prototype,Tn);var kn=function(e){var r,n,i,a;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),n=!1,i=null,a=function(){i=null,n&&(r(),i=setTimeout(a,300),n=!1)},function(){return n=!0,i||a(),i})};kn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},kn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},kn.prototype.getHashString=function(e){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(r.lng*a)/a,s=Math.round(r.lat*a)/a,l=this._map.getBearing(),u=this._map.getPitch(),c="";if(c+=e?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||u)&&(c+="/"+Math.round(10*l)/10),u&&(c+="/"+Math.round(u)),this._hashName){var p=this._hashName,h=!1,f=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===p?(h=!0,e+"="+c):t})).filter((function(t){return t}));return h||f.push(p+"="+c),"#"+f.join("&")}return"#"+c},kn.prototype._getCurrentHash=function(){var e,r=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):n.split("/")},kn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},kn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var An={linearity:.3,easing:t.bezier(0,0,.3,1)},Mn=t.extend({deceleration:2500,maxSpeed:1400},An),Sn=t.extend({deceleration:20,maxSpeed:1400},An),Cn=t.extend({deceleration:1e3,maxSpeed:360},An),Ln=t.extend({deceleration:1e3,maxSpeed:90},An),En=function(t){this._map=t,this.clear()};function In(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function zn(e,r,n){var i=n.maxSpeed,a=n.linearity,o=n.deceleration,s=t.clamp(e*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}En.prototype.clear=function(){this._inertiaBuffer=[]},En.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},En.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},En.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var a=i[n].settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=zn(r.pan.mag(),o,t.extend({},Mn,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,In(s,l)}if(r.zoom){var u=zn(r.zoom,o,Sn);s.zoom=this._map.transform.zoom+u.amount,In(s,u)}if(r.bearing){var c=zn(r.bearing,o,Cn);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),In(s,c)}if(r.pitch){var p=zn(r.pitch,o,Ln);s.pitch=this._map.transform.pitch+p.amount,In(s,p)}if(s.zoom||s.bearing){var h=void 0===r.pinchAround?r.around:r.pinchAround;s.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var Pn=function(e){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),Dn=function(e){function n(n,i,a){var o="touchend"===n?a.changedTouches:a.touches,s=r.touchPos(i.getCanvasContainer(),o),l=s.map((function(t){return i.unproject(t)})),u=s.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),c=i.unproject(u);e.call(this,n,{points:s,point:u,lngLats:l,lngLat:c,originalEvent:a}),this._defaultPrevented=!1}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),On=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Rn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Rn.prototype.reset=function(){delete this._mousedownPos},Rn.prototype.wheel=function(t){return this._firePreventable(new On(t.type,this._map,t))},Rn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Pn(t.type,this._map,t))},Rn.prototype.mouseup=function(t){this._map.fire(new Pn(t.type,this._map,t))},Rn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Pn(t.type,this._map,t))},Rn.prototype.dblclick=function(t){return this._firePreventable(new Pn(t.type,this._map,t))},Rn.prototype.mouseover=function(t){this._map.fire(new Pn(t.type,this._map,t))},Rn.prototype.mouseout=function(t){this._map.fire(new Pn(t.type,this._map,t))},Rn.prototype.touchstart=function(t){return this._firePreventable(new Dn(t.type,this._map,t))},Rn.prototype.touchmove=function(t){this._map.fire(new Dn(t.type,this._map,t))},Rn.prototype.touchend=function(t){this._map.fire(new Dn(t.type,this._map,t))},Rn.prototype.touchcancel=function(t){this._map.fire(new Dn(t.type,this._map,t))},Rn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Rn.prototype.isEnabled=function(){return!0},Rn.prototype.isActive=function(){return!1},Rn.prototype.enable=function(){},Rn.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new Pn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Pn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Pn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Nn(t,e){for(var r={},n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}Bn.prototype.isEnabled=function(){return!!this._enabled},Bn.prototype.isActive=function(){return!!this._active},Bn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Bn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Bn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Bn.prototype.mousemoveWindow=function(t,e){if(this._active){var n=e;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var a=Math.min(i.x,n.x),o=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+a+"px,"+s+"px)"),this._box.style.width=o-a+"px",this._box.style.height=l-s+"px"}}},Bn.prototype.mouseupWindow=function(e,n){var i=this;if(this._active&&0===e.button){var a=this._startPos,o=n;if(this.reset(),r.suppressClick(),a.x!==o.x||a.y!==o.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Bn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Bn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Bn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Un=function(t){this.reset(),this.numTouches=t.numTouches};Un.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Un.prototype.touchstart=function(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n<i.length;n+=1)r._add(i[n]);return r.div(e.length)}(r),this.touches=Nn(n,r)))},Un.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var n=Nn(r,e);for(var i in this.touches){var a=n[i];(!a||a.dist(this.touches[i])>30)&&(this.aborted=!0)}}},Un.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var jn=function(t){this.singleTap=new Un(t),this.numTaps=t.numTaps,this.reset()};jn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},jn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Vn=function(){this._zoomIn=new jn({numTouches:1,numTaps:2}),this._zoomOut=new jn({numTouches:2,numTaps:1}),this.reset()};Vn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Vn.prototype.touchcancel=function(){this.reset()},Vn.prototype.enable=function(){this._enabled=!0},Vn.prototype.disable=function(){this._enabled=!1,this.reset()},Vn.prototype.isEnabled=function(){return this._enabled},Vn.prototype.isActive=function(){return this._active};var qn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};qn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qn.prototype._correctButton=function(t,e){return!1},qn.prototype._move=function(t,e){return{}},qn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},qn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r&&(t.preventDefault(),this._moved||!(e.dist(r)<this._clickTolerance)))return this._moved=!0,this._lastPoint=e,this._move(r,e)},qn.prototype.mouseupWindow=function(t){r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},qn.prototype.enable=function(){this._enabled=!0},qn.prototype.disable=function(){this._enabled=!1,this.reset()},qn.prototype.isEnabled=function(){return this._enabled},qn.prototype.isActive=function(){return this._active};var Hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(qn),Zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(qn),Gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(qn),Xn=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Xn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Xn.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Xn.prototype.touchmove=function(t,e,r){if(this._active)return t.preventDefault(),this._calculateTransform(t,e,r)},Xn.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype._calculateTransform=function(e,r,n){n.length>0&&(this._active=!0);var i=Nn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(a._add(u),o._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(s<this._minTouches)&&o.mag()){var p=o.div(s);if(this._sum._add(p),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:p}}},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var Wn=function(){this.reset()};function Yn(t,e,r){for(var n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function Kn(t,e){return Math.log(t/e)/Math.LN2}Wn.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Wn.prototype._start=function(t){},Wn.prototype._move=function(t,e,r){return{}},Wn.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Wn.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,i=n[1],a=Yn(r,e,n[0]),o=Yn(r,e,i);if(a&&o){var s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}}},Wn.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[1],o=Yn(n,e,i[0]),s=Yn(n,e,a);o&&s||(this._active&&r.suppressClick(),this.reset())}},Wn.prototype.touchcancel=function(){this.reset()},Wn.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Wn.prototype.disable=function(){this._enabled=!1,this.reset()},Wn.prototype.isEnabled=function(){return this._enabled},Wn.prototype.isActive=function(){return this._active};var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Kn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Kn(this._distance,r),pinchAround:e}},e}(Wn);function Qn(t,e){return 180*t.angleWith(e)/Math.PI}var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Qn(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=Qn(t,this._startVector);return Math.abs(r)<e},e}(Wn);function ti(t){return Math.abs(t.y)>Math.abs(t.x)}var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ti(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ti(t)&&ti(e)&&a}},e}(Wn),ri={panStep:100,bearingStep:15,pitchStep:10},ni=function(){var t=ri;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function ii(t){return t*(2-t)}ni.prototype.reset=function(){this._active=!1},ni.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ii,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},ni.prototype.enable=function(){this._enabled=!0},ni.prototype.disable=function(){this._enabled=!1,this.reset()},ni.prototype.isEnabled=function(){return this._enabled},ni.prototype.isActive=function(){return this._active};var ai=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};ai.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ai.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ai.prototype.isEnabled=function(){return!!this._enabled},ai.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ai.prototype.isZooming=function(){return!!this._zooming},ai.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ai.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ai.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},ai.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ai.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ai.prototype.renderFrame=function(){return this._onScrollFrame()},ai.prototype._onScrollFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(p);o=t.number(l,s,h),p<1?this._frameId||(this._frameId=!0):c=!0}else o=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ai.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},ai.prototype.reset=function(){this._active=!1};var oi=function(t,e){this._clickZoom=t,this._tapZoom=e};oi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},oi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},oi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},oi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var si=function(){this.reset()};si.prototype.reset=function(){this._active=!1},si.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},si.prototype.enable=function(){this._enabled=!0},si.prototype.disable=function(){this._enabled=!1,this.reset()},si.prototype.isEnabled=function(){return this._enabled},si.prototype.isActive=function(){return this._active};var li=function(){this._tap=new jn({numTouches:1,numTaps:1}),this.reset()};li.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},li.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},li.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},li.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},li.prototype.touchcancel=function(){this.reset()},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ui=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};ui.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ui.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ui.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ui.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ci=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};ci.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ci.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ci.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ci.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};pi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},pi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var hi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function di(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new En(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!1}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;a<o.length;a+=1){var s=o[a],l=s[0];r.addEventListener(l,s[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};mi.prototype.destroy=function(){for(var e=0,n=this._listeners;e<n.length;e+=1){var i=n[e],a=i[0];r.removeEventListener(a,i[1],a===t.window.document?this.handleWindowEvent:this.handleEvent,i[2])}},mi.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Rn(e,t));var n=e.boxZoom=new Bn(e,t);this._add("boxZoom",n);var i=new Vn,a=new si;e.doubleClickZoom=new oi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new li;this._add("tapDragZoom",o);var s=e.touchPitch=new ei;this._add("touchPitch",s);var l=new Zn(t),u=new Gn(t);e.dragRotate=new ci(t,l,u),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]);var c=new Hn(t),p=new Xn(t);e.dragPan=new ui(r,c,p),this._add("mousePan",c),this._add("touchPan",p,["touchZoom","touchRotate"]);var h=new $n,f=new Jn;e.touchZoomRotate=new pi(r,f,h,o),this._add("touchRotate",h,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new ai(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new ni;this._add("keyboard",m),this._add("blockableMapEvent",new Fn(e));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];t.interactive&&t[v]&&e[v].enable(t[v])}},mi.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},mi.prototype.stop=function(){if(!this._updatingCamera){for(var t=0,e=this._handlers;t<e.length;t+=1)e[t].handler.reset();this._inertia.clear(),this._fireEvents({},{}),this._changes=[]}},mi.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},mi.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},mi.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},mi.prototype.isMoving=function(){return Boolean(hi(this._eventsInProgress))||this.isZooming()},mi.prototype._blockedByActive=function(t,e,r){for(var n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1},mi.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},mi.prototype._getMapTouches=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r];this._el.contains(i.target)&&e.push(i)}return e},mi.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var n="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},a={},o={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),u=0,c=this._handlers;u<c.length;u+=1){var p=c[u],h=p.handlerName,f=p.handler,d=p.allowed;if(f.isEnabled()){var m=void 0;this._blockedByActive(o,d,h)?f.reset():f[e||t.type]&&(m=f[e||t.type](t,l,s),this.mergeHandlerResult(i,a,m,h,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||f.isActive())&&(o[h]=f)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||di(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||di(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{}),this._changes=[],v(this._map))}else this.stop()},mi.prototype.mergeHandlerResult=function(e,r,n,i,a){if(n){t.extend(e,n);var o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},mi.prototype._applyChanges=function(){for(var e={},r={},n={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],u=o[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(n,u)}this._updateMapTransform(e,r,n),this._changes=[]},mi.prototype._updateMapTransform=function(t,e,r){var n=this._map,i=n.transform;if(!di(t))return this._fireEvents(e,r);var a=t.panDelta,o=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,u=t.around,c=t.pinchAround;void 0!==c&&(u=c),n._stop(!0),u=u||n.transform.centerPoint;var p=i.pointLocation(a?u.sub(a):u);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(p,u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r)},mi.prototype._fireEvents=function(e,r){var n=this,i=hi(this._eventsInProgress),a=hi(e),o={};for(var s in e)this._eventsInProgress[s]||(o[s+"start"]=e[s].originalEvent),this._eventsInProgress[s]=e[s];for(var l in!i&&a&&this._fireEvent("movestart",a.originalEvent),o)this._fireEvent(l,o[l]);for(var u in e.rotate&&(this._bearingChanged=!0),a&&this._fireEvent("move",a.originalEvent),e)this._fireEvent(u,e[u].originalEvent);var c,p={};for(var h in this._eventsInProgress){var f=this._eventsInProgress[h],d=f.handlerName,m=f.originalEvent;this._handlersById[d].isActive()||(delete this._eventsInProgress[h],p[h+"end"]=c=r[d]||m)}for(var g in p)this._fireEvent(g,p[g]);var y=hi(this._eventsInProgress);if((i||a)&&!y){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(t){return 0!==t&&-n._bearingSnap<t&&t<n._bearingSnap};v?(_(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:c})):(this._map.fire(new t.Event("moveend",{originalEvent:c})),_(this._map.getBearing())&&this._map.resetNorth()),this._bearingChanged=!1,this._updatingCamera=!1}},mi.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},mi.prototype._triggerRenderFrame=function(){var t=this;void 0===this._frameId&&(this._frameId=this._map._requestRenderFrame((function(e){delete t._frameId,t.handleEvent(new fi("renderFrame",{timeStamp:e})),t._applyChanges()})))};var gi=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){var a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}i.padding=t.extend(a,i.padding);var s=this.transform,l=s.padding,u=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(r)),p=u.rotate(-n*Math.PI/180),h=c.rotate(-n*Math.PI/180),f=new t.Point(Math.max(p.x,h.x),Math.max(p.y,h.y)),d=new t.Point(Math.min(p.x,h.x),Math.min(p.y,h.y)),m=f.sub(d),g=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),i.maxZoom),_=t.Point.convert(i.offset),x=new t.Point(_.x+(i.padding.left-i.padding.right)/2,_.y+(i.padding.top-i.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return{center:s.unproject(u.add(c).div(2).sub(x)),zoom:v,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(e,r,n){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in e?+e.zoom:a,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,p="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:i.padding,f=t.Point.convert(e.offset),d=i.centerPoint.add(f),m=i.pointLocation(d),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);var y,v,_=i.project(m),x=i.project(g).sub(_),b=i.zoomScale(u-a);e.around&&(y=t.LngLat.convert(e.around),v=i.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||u!==a,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||p!==s,this._padding=!i.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(n._zooming&&(i.zoom=t.number(a,u,e)),n._rotating&&(i.bearing=t.number(o,c,e)),n._pitching&&(i.pitch=t.number(s,p,e)),n._padding&&(i.interpolatePadding(l,h,e),d=i.centerPoint.add(f)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-a),g=u>a?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-e),T=i.unproject(_.add(x.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:a.padding,d=a.zoomScale(c-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var _=a.project(y),x=a.project(v).sub(_),b=e.curve,w=Math.max(a.width,a.height),T=w/d,k=x.mag();if("minZoom"in e){var A=t.clamp(Math.min(e.minZoom,o,c),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);b=Math.sqrt(M/k*2)}var S=b*b;function C(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function L(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}var I=C(0),z=function(t){return E(I)/E(I+b*t)},P=function(t){return w*((E(I)*(L(e=I+b*t)/E(e))-L(I))/S)/k;var e},D=(C(1)-I)/b;if(Math.abs(k)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=T<w?-1:1;D=Math.abs(Math.log(T/w))/b,P=function(){return 0},z=function(t){return Math.exp(O*b*t)}}return e.duration="duration"in e?+e.duration:1e3*D/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=h!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*D,d=1/z(i);a.zoom=1===e?c:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,p,e)),n._pitching&&(a.pitch=t.number(l,h,e)),n._padding&&(a.interpolatePadding(u,f,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(_.add(x.mult(P(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),yi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};yi.prototype.getDefaultPosition=function(){return"bottom-right"},yi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},yi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},yi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},yi.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},yi.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t.sort((function(t,e){return t.length-e.length}));var o=(t=t.filter((function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},yi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var vi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};vi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},vi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},vi.prototype.getDefaultPosition=function(){return"bottom-left"},vi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},vi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},vi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var _i=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};_i.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},_i.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},_i.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=e;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},_i.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var xi={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},bi=t.window.HTMLImageElement,wi=t.window.HTMLElement,Ti=t.window.ImageBitmap,ki={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ai=function(n){function i(e){var r=this;if(null!=(e=t.extend({},ki,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new wn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new _i,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xi,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof wi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),this.handlers=new mi(this,e),this._hash=e.hash&&new kn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new yi({customAttribution:e.customAttribution})),this.addControl(new vi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Pn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Pn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Pn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o<a.length;o++){var s=a[o];if(s.layer===e&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),a=t.Point.convert(e[1]);n=[i,new t.Point(a.x,i.y),a,new t.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new qe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new qe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),a=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(a,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;void 0===a&&(a=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof bi||Ti&&r instanceof Ti){var u=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r;this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof bi||Ti&&r instanceof Ti?t.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;return void 0===a||void 0===o?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):a!==n.data.width||o!==n.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(n.data.replace(s,!(r instanceof bi||Ti&&r instanceof Ti)),void this.style.updateImage(e,n))},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){a[t]=r.create("div","mapboxgl-ctrl-"+t,i)}))},i.prototype._resizeCanvas=function(e,r){var n=t.browser.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new vn(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(e){var r,n=this,i=0,a=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var u=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(o=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var p=t.browser.now()-i;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),n.fire(new t.Event("gpu-timing-frame",{cpuTime:p,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var h=this.painter.collectGpuTimers();setTimeout((function(){var e=n.painter.queryGpuTimers(h);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new t.Event("idle"))),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Mi(this._canvasContainer),Mi(this._controlContainer),Mi(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},a.version.get=function(){return t.version},Object.defineProperties(i.prototype,a),i}(gi);function Mi(t){t.parentNode&&t.parentNode.removeChild(t)}var Si={showCompass:!0,showZoom:!0,visualizePitch:!1},Ci=function(e){var n=this;this.options=t.extend({},Si,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return n._map.zoomIn({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return n._map.zoomOut({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ci.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Ci.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ci.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Li(this._map,this._compass,this.options.visualizePitch)),this._container},Ci.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ci.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Ci.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Li=function(e,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Zn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new Gn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function Ei(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Li.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Li.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Ii={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function zi(t,e,r){var n=t.classList;for(var i in Ii)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Pi,Di=function(e){function n(n,i){var a=this;if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var o=r.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var u=r.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var c=0,p=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<p.length;c+=1){var h=p[c],f=r.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",h.rx),f.setAttributeNS(null,"ry",h.ry),u.appendChild(f)}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var m=r.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(m);var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");var y=r.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),g.appendChild(y);var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var _=r.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),_.appendChild(x),_.appendChild(b),l.appendChild(u),l.appendChild(d),l.appendChild(g),l.appendChild(v),l.appendChild(_),o.appendChild(l),this._element.appendChild(o),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),this._element.addEventListener("focus",(function(){var t=a._map.getContainer();t.scrollTop=0,t.scrollLeft=0})),zi(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Ei(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,Ii[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Oi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ri=0,Fi=!1,Bi=function(e){function n(r){e.call(this),this.options=t.extend({},Oi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Pi?n(Pi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Pi="denied"!==t.state)})):n(Pi=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Ri=0,Fi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Fi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Di(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Di({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ri--,Fi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Ri>1?(e={maximumAge:6e5,timeout:0},Fi=!0):(e=this.options.positionOptions,Fi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Ni={maxWidth:100,unit:"metric"},Ui=function(e){this.options=t.extend({},Ni,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Vi(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Vi(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Vi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Vi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Vi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Vi(t,e,r,n){var i,a,o,s=(i=r,(a=Math.pow(10,(""+Math.floor(i)).length-1))*(o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o)));t.style.width=e*(s/r)+"px",t.innerHTML=s+"&nbsp;"+n}Ui.prototype.getDefaultPosition=function(){return"bottom-left"},Ui.prototype._onMove=function(){ji(this._map,this._container,this.options)},Ui.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ui.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ui.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var qi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};qi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},qi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},qi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},qi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},qi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},qi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},qi.prototype._isFullscreen=function(){return this._fullscreen},qi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},qi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Hi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Zi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Hi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ei(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+o.bottom.y<u?["top"]:i.y>this._map.transform.height-u?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var c=i.add(o[a]).round();r.setTransform(this._container,Ii[a]+" translate("+c.x+"px,"+c.y+"px)"),zi(this._container,a,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Gi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ai,NavigationControl:Ci,GeolocateControl:Bi,AttributionControl:yi,ScaleControl:Ui,FullscreenControl:qi,Popup:Zi,Marker:Di,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(Dt)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Dt),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ot.workerCount},set workerCount(t){Ot.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Gi})),r}))},{}],55:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],56:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,(function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length<n[o])throw new Error("malformed path data");e.push([r].concat(i.splice(0,n[o])))}})),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],57:[function(t,e,r){
/*
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*/
var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,p=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=i():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return p.epsilon(t)},segments:function(t){var e=o(!0,p,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,p,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,p,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,p,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":58,"./lib/epsilon":59,"./lib/geojson":60,"./lib/intersecter":61,"./lib/segment-chainer":63,"./lib/segment-selector":64}],58:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],59:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<t)&&!(l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],u=a*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],p=e[1]-n[1],h=(s*p-l*c)/u,f=(a*p-o*c)/u,d={alongA:0,alongB:0,pt:[e[0]+h*a,e[1]+h*o]};return d.alongA=h<=-t?-2:h<t?-1:h-1<=-t?0:h-1<t?1:2,d.alongB=f<=-t?-2:f<t?-1:f-1<=-t?0:f-1<t?1:2,d},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-i>t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],60:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(s=t.children[r]).region))return void o(s,e)}var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var c=[];function p(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(h(t.children[r]))}function h(t){for(var e=0;e<t.children.length;e++)p(t.children[e]);return u(t.region,!0)}for(s=0;s<a.children.length;s++)p(a.children[s]);return c.length<=0?{type:"Polygon",coordinates:[]}:1==c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}};e.exports=n},{}],61:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function i(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var a=n.create();function o(t,r){a.insertBefore(t,(function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var i=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=i,o(i,t.pt)}(r,t,e),r}function l(t,e){var n=i(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(n,t.primary)}function u(i,o){var s=n.create();function u(t){return s.findTransition((function(r){var n,i,a,o,s,l;return(n=t,i=r.ev,a=n.seg.start,o=n.seg.end,s=i.seg.start,l=i.seg.end,e.pointsCollinear(a,s,l)?e.pointsCollinear(o,s,l)||e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(a,s,l)?1:-1)>0}))}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function g(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var y,v=g();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:y,below:y};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}a.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l<t.length;l++){n=o,o=t[l];var u=e.pointsCompare(n,o);0!==u&&s((i=u<0?n:o,a=u<0?o:n,{id:r?r.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return u(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach((function(t){s(i(t.start,t.end,t),!0)})),r.forEach((function(t){s(i(t.start,t.end,t),!1)})),u(e,n)}}}},{"./linked-list":62}],62:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],63:[function(t,e,r){e.exports=function(t,e,r){var n=[],i=[];return t.forEach((function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var p=(g=n[c])[0],h=(g[1],g[g.length-1]);g[g.length-2];if(e.pointsSame(p,a)){if(k(c,!0,!0))break}else if(e.pointsSame(p,o)){if(k(c,!0,!1))break}else if(e.pointsSame(h,a)){if(k(c,!1,!0))break}else if(e.pointsSame(h,o)&&k(c,!1,!1))break}if(u===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(u===l){r&&r.chainMatch(s.index);var f=s.index,d=s.matches_pt1?o:a,m=s.matches_head,g=n[f],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],_=m?g[g.length-1]:g[0],x=m?g[g.length-2]:g[1];return e.pointsCollinear(v,y,d)&&(m?(r&&r.chainRemoveHead(s.index,d),g.shift()):(r&&r.chainRemoveTail(s.index,d),g.pop()),y=v),e.pointsSame(_,d)?(n.splice(f,1),e.pointsCollinear(x,_,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void i.push(g)):void(m?(r&&r.chainAddHead(s.index,d),g.unshift(d)):(r&&r.chainAddTail(s.index,d),g.push(d)))}var b=s.index,w=l.index;r&&r.chainConnect(b,w);var T=n[b].length<n[w].length;s.matches_head?l.matches_head?T?(A(b),M(b,w)):(A(w),M(w,b)):M(w,b):l.matches_head?M(b,w):T?(A(b),M(w,b)):(A(w),M(b,w))}function k(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function A(t){r&&r.chainReverse(t),n[t].reverse()}function M(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(i,u),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}})),i}},{}],64:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach((function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})})),r&&r.selected(n),n}var i={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=i},{}],65:[function(t,e,r){var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,c=[],p=!1,h=-1;function f(){p&&u&&(p=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!p){var t=l(f);p=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,p=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function g(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new m(t,e)),1!==c.length||p||l(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],66:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var i={r:0,g:0,b:0},a=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=U.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=U.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=U.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=U.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=U.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=U.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=U.hex8.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=U.hex6.exec(t))return{r:z(e[1]),g:z(e[2]),b:z(e[3]),format:i?"name":"hex"};if(e=U.hex4.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=U.hex3.exec(t))return{r:z(e[1]+""+e[1]),g:z(e[2]+""+e[2]),b:z(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(j(e.r)&&j(e.g)&&j(e.b)?(f=e.r,d=e.g,m=e.b,i={r:255*E(f,255),g:255*E(d,255),b:255*E(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):j(e.h)&&j(e.s)&&j(e.v)?(l=D(e.s),u=D(e.v),i=function(e,r,n){e=6*E(e,360),r=E(r,100),n=E(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):j(e.h)&&j(e.s)&&j(e.l)&&(l=D(e.s),c=D(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var f,d,m;return a=L(a),{ok:p,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,l:u}}function p(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=a,c=a-l;if(i=0===a?0:c/a,a==l)n=0;else{switch(a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,v:u}}function h(t,e,r,n){var i=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function f(t,e,r,n){return[P(O(n)),P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=I(r.s),u(r)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=I(r.s),u(r)}function g(t){return u(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=I(r.l),u(r)}function v(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=s(0,o(255,r.r-a(-e/100*255))),r.g=s(0,o(255,r.g-a(-e/100*255))),r.b=s(0,o(255,r.b-a(-e/100*255))),u(r)}function _(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=I(r.l),u(r)}function x(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function b(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function T(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),i=360/r,a=[u(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(O(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*E(this._r,255))+"%",g:a(100*E(this._g,255))+"%",b:a(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%)":"rgba("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function E(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function I(t){return o(1,s(0,t))}function z(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return z(t)/255}var F,B,N,U=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!U.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],67:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],68:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":186,"../../plot_api/plot_template":247,"../../plots/cartesian/constants":264,"../../plots/font_attributes":286,"./arrow_paths":67}],69:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],p=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,g=3*t.startarrowsize*t.arrowwidth||0,y=g+h,v=g-h;if(u===l){var _=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,y),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,y),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":212,"../../plots/cartesian/axes":258,"./draw":74}],70:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r<c.length;r++)if(a=(i=c[r]).clicktoshow){for(n=0;n<d;n++)if(l=(o=e[n]).xaxis,u=o.yaxis,l._id===i.xref&&u._id===i.yref&&l.d2r(o.x)===s(i._xclick,l)&&u.d2r(o.y)===s(i._yclick,u)){(i.visible?"onout"===a?h:f:p).push(r);break}n===d&&i.visible&&"onout"===a&&h.push(r)}return{on:p,off:h,explicitOff:f}}function s(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r<u.length;r++)(s=a(t.layout,"annotations",h[u[r]])).modifyItem("visible",!0),n.extendFlat(p,s.getUpdateObj());for(r=0;r<c.length;r++)(s=a(t.layout,"annotations",h[c[r]])).modifyItem("visible",!1),n.extendFlat(p,s.getUpdateObj());return i.call("update",t,{},p)}}},{"../../lib":212,"../../plot_api/plot_template":247,"../../registry":308}],71:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color");e.exports=function(t,e,r,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=i.opacity(s);a("borderpad");var u=a("borderwidth"),c=a("showarrow");if(a("text",c?" ":r._dfltTitle.annotation),a("textangle"),n.coerceFont(a,"font",r.font),a("width"),a("align"),a("height")&&a("valign"),c){var p,h,f=a("arrowside");-1!==f.indexOf("end")&&(p=a("arrowhead"),h=a("arrowsize")),-1!==f.indexOf("start")&&(a("startarrowhead",p),a("startarrowsize",h)),a("arrowcolor",l?e.bordercolor:i.defaultLine),a("arrowwidth",2*(l&&u||1)),a("standoff"),a("startstandoff")}var d=a("hovertext"),m=r.hoverlabel||{};if(d){var g=a("hoverlabel.bgcolor",m.bgcolor||(i.opacity(o)?i.rgb(o):i.defaultLine)),y=a("hoverlabel.bordercolor",m.bordercolor||i.contrast(g));n.coerceFont(a,"hoverlabel.font",{family:m.font.family,size:m.font.size,color:m.font.color||y})}a("captureevents",!!d)}},{"../../lib":212,"../color":83}],72:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,p=e._id.charAt(0),h=0;h<c.length;h++)l=c[h],u="annotations["+h+"].",l[p+"ref"]===e._id&&f(p),l["a"+p+"ref"]===e._id&&f("a"+p);function f(t){var r=l[t],s=null;s=o?i(r,e.range):Math.pow(10,r),n(s)||(s=null),a(u+t,s)}}},{"../../lib/to_log_range":236,"fast-isnumeric":18}],73:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./common_defaults"),s=t("./attributes");function l(t,e,r){function a(r,i){return n.coerce(t,e,s,r,i)}var l=a("visible"),u=a("clicktoshow");if(l||u){o(t,e,r,a);for(var c=e.showarrow,p=["x","y"],h=[-10,-30],f={_fullLayout:r},d=0;d<2;d++){var m=p[d],g=i.coerceRef(t,e,f,m,"","paper");if("paper"!==g)i.getFromId(f,g)._annIndices.push(e._index);if(i.coercePosition(e,f,a,g,m,.5),c){var y="a"+m,v=i.coerceRef(t,e,f,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=e[y]="pixel");var _="pixel"===v?h[d]:.4;i.coercePosition(e,f,a,v,y,_)}a(m+"anchor"),a(m+"shift")}if(n.noneOrAll(t,e,["x","y"]),c&&n.noneOrAll(t,e,["ax","ay"]),u){var x=a("xclick"),b=a("yclick");e._xclick=void 0===x?e.x:i.cleanPosition(x,f,e.xref),e._yclick=void 0===b?e.y:i.cleanPosition(b,f,e.yref)}}}e.exports=function(t,e){a(t,e,{name:"annotations",handleItemDefaults:l})}},{"../../lib":212,"../../plots/array_container_defaults":253,"../../plots/cartesian/axes":258,"./attributes":68,"./common_defaults":71}],74:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../../lib"),s=o.strTranslate,l=t("../../plots/cartesian/axes"),u=t("../color"),c=t("../drawing"),p=t("../fx"),h=t("../../lib/svg_text_utils"),f=t("../../lib/setcursor"),d=t("../dragelement"),m=t("../../plot_api/plot_template").arrayEditor,g=t("./draw_arrow_head");function y(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),i=l.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),_(t,r,e,!1,n,i)}function v(t,e,r,n,i){var a=i[r],o=i[r+"ref"],s=-1!==r.indexOf("y"),u="domain"===l.getRefType(o),c=s?n.h:n.w;return t?u?a+(s?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(s?-e:e)/c}function _(t,e,r,a,y,_){var x,b,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;a?(x="annotation-"+a,b=a+".annotations"):(x="annotation",b="annotations");var A=m(t.layout,b,e),M=A.modifyBase,S=A.modifyItem,C=A.getUpdateObj;w._infolayer.selectAll("."+x+'[data-index="'+r+'"]').remove();var L="clip"+w._uid+"_ann"+r;if(e._input&&!1!==e.visible){var E={x:{},y:{}},I=+e.textangle||0,z=w._infolayer.append("g").classed(x,!0).attr("data-index",String(r)).style("opacity",e.opacity),P=z.append("g").classed("annotation-text-g",!0),D=k[e.showarrow?"annotationTail":"annotationPosition"],O=e.captureevents||k.annotationText||D,R=P.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",G(n.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();p.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){p.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,B=e.borderpad,N=F+B,U=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),j=e.width||e.height,V=w._topclips.selectAll("#"+L).data(j?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",L).append("rect"),V.exit().remove();var q=e.font,H=w._meta?o.templateString(e.text,w._meta):e.text,Z=R.append("text").classed("annotation-text",!0).text(H);k.annotationText?Z.call(h.makeEditable,{delegate:R,gd:t}).call(X).on("edit",(function(r){e.text=r,this.call(X),S("text",r),y&&y.autorange&&M(y._name+".autorange",!0),_&&_.autorange&&M(_._name+".autorange",!0),i.call("_guiRelayout",t,C())})):Z.call(X)}else n.selectAll("#"+L).remove();function G(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return a&&(n.subplotId=a),n}function X(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,W),r}function W(){var r=Z.selectAll("a");1===r.size()&&r.text()===Z.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(U.node());var n=R.select(".annotation-text-math-group"),p=!n.empty(),m=c.bBox((p?n:Z).node()),x=m.width,b=m.height,A=e.width||x,O=e.height||b,B=Math.round(A+2*N),q=Math.round(O+2*N);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var X=!1,W=["x","y"],Y=0;Y<W.length;Y++){var K,J,Q,$,tt,et=W[Y],rt=e[et+"ref"]||et,nt=e["a"+et+"ref"],it={x:y,y:_}[et],at=(I+("x"===et?0:-90))*Math.PI/180,ot=B*Math.cos(at),st=q*Math.sin(at),lt=Math.abs(ot)+Math.abs(st),ut=e[et+"anchor"],ct=e[et+"shift"]*("x"===et?1:-1),pt=E[et],ht=l.getRefType(rt);if(it&&"domain"!==ht){var ft=it.r2fraction(e[et]);(ft<0||ft>1)&&(nt===rt?((ft=it.r2fraction(e["a"+et]))<0||ft>1)&&(X=!0):X=!0),K=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],K=dt?it._offset+it._length*Q:K=T.l+T.w*Q):(Q=1-e[et],K=dt?it._offset+it._length*Q:K=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){pt.head=K;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),pt.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=it._offset+it.r2p(mt),J=tt}else pt.tail=K+mt,J=tt+mt;pt.text=pt.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),_t=Math.min(pt.tail+3,pt.text)-yt;vt>0?(pt.tail+=vt,pt.text+=vt):_t>0&&(pt.tail-=_t,pt.text-=_t)}pt.tail+=ct,pt.head+=ct}else J=tt=lt*H($,ut),pt.text=K+tt;pt.text+=ct,tt+=ct,J+=ct,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(X)R.remove();else{var xt=0,bt=0;if("left"!==e.align&&(xt=(A-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:N+xt-1,y:N+bt}).call(c.setClipUrl,j?L:null,t);else{var wt=N+bt-m.top,Tt=N+xt-m.left;Z.call(h.positionText,Tt,wt).call(c.setClipUrl,j?L:null,t)}V.select("rect").call(c.setRect,N,N,A,O),U.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(E.x.text-B/2),Math.round(E.y.text-q/2)),P.attr({transform:"rotate("+I+","+E.x.text+","+E.y.text+")"});var kt,At=function(r,n){z.selectAll(".annotation-arrow-g").remove();var l=E.x.head,p=E.y.head,h=E.x.tail+r,f=E.y.tail+n,m=E.x.text+r,x=E.y.text+n,b=o.rotationXYMatrix(I,m,x),w=o.apply2DTransform(b),A=o.apply2DTransform2(b),L=+U.attr("width"),D=+U.attr("height"),O=m-.5*L,F=O+L,B=x-.5*D,N=B+D,j=[[O,B,O,N],[O,N,F,N],[F,N,F,B],[F,B,O,B]].map(A);if(!j.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){j.forEach((function(t){var e=o.segmentsIntersect(h,f,l,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,Z=z.append("g").style({opacity:u.opacity(q)}).classed("annotation-arrow-g",!0),G=Z.append("path").attr("d","M"+h+","+f+"L"+l+","+p).style("stroke-width",V+"px").call(u.stroke,u.rgb(q));if(g(G,H,e),k.annotationPosition&&G.node().parentNode&&!a){var X=l,W=p;if(e.standoff){var Y=Math.sqrt(Math.pow(l-h,2)+Math.pow(p-f,2));X+=e.standoff*(h-l)/Y,W+=e.standoff*(f-p)/Y}var K,J,Q=Z.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-X)+","+(f-W),transform:s(X,W)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);K=t.x,J=t.y,y&&y.autorange&&M(y._name+".autorange",!0),_&&_.autorange&&M(_._name+".autorange",!0)},moveFn:function(t,r){var n=w(K,J),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",v(y,t,"x",T,e)),S("y",v(_,r,"y",T,e)),e.axref===e.xref&&S("ax",v(y,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(_,r,"ay",T,e)),Z.attr("transform",s(t,r)),P.attr({transform:"rotate("+I+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),D)d.init({element:R.node(),gd:t,prepFn:function(){kt=P.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(y,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(_,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(y)i=v(y,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(u+t/T.w,l,0,1,e.xanchor)}if(_)o=v(_,r,"y",T,e);else{var c=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(p-r/T.h,c,0,1,e.yanchor)}S("x",i),S("y",o),y&&_||(n=d.getCursor(y?.5:i,_?.5:o,e.xanchor,e.yanchor))}P.attr({transform:s(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",G(n))},doneFn:function(){f(R),i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&y(t,r);return a.previousPromises(t)},drawOne:y,drawRaw:_}},{"../../lib":212,"../../lib/setcursor":232,"../../lib/svg_text_utils":234,"../../plot_api/plot_template":247,"../../plots/cartesian/axes":258,"../../plots/plots":299,"../../registry":308,"../color":83,"../dragelement":102,"../drawing":105,"../fx":123,"./draw_arrow_head":75,d3:16}],75:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color"),a=t("./arrow_paths"),o=t("../../lib"),s=o.strScale,l=o.strRotate,u=o.strTranslate;e.exports=function(t,e,r){var o,c,p,h,f=t.node(),d=a[r.arrowhead||0],m=a[r.startarrowhead||0],g=(r.arrowwidth||1)*(r.arrowsize||1),y=(r.arrowwidth||1)*(r.startarrowsize||1),v=e.indexOf("start")>=0,_=e.indexOf("end")>=0,x=d.backoff*g+r.standoff,b=m.backoff*y+r.startstandoff;if("line"===f.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(p=Math.atan2(T,w))+Math.PI,x&&b&&x+b>Math.sqrt(w*w+T*T))return void D();if(x){if(x*x>w*w+T*T)return void D();var k=x*Math.cos(p),A=x*Math.sin(p);c.x+=k,c.y+=A,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(p),S=b*Math.sin(p);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),L="";if(C<x+b)return void D();var E=f.getPointAtLength(0),I=f.getPointAtLength(.1);p=Math.atan2(E.y-I.y,E.x-I.x),o=f.getPointAtLength(Math.min(b,C)),L="0px,"+b+"px,";var z=f.getPointAtLength(C),P=f.getPointAtLength(C-.1);h=Math.atan2(z.y-P.y,z.x-P.x),c=f.getPointAtLength(Math.max(0,C-x)),L+=C-(L?b+x:x)+"px,"+C+"px",t.style("stroke-dasharray",L)}function D(){t.style("stroke-dasharray","0px,100px")}function O(e,a,o,c){e.path&&(e.noRotate&&(o=0),n.select(f.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:u(a.x,a.y)+l(180*o/Math.PI)+s(c)}).style({fill:i.rgb(r.arrowcolor),"stroke-width":0}))}v&&O(m,o,p,y),_&&O(d,c,h,g)}},{"../../lib":212,"../color":83,"./arrow_paths":67,d3:16}],76:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":270,"./attributes":68,"./calc_autorange":69,"./click":70,"./convert_coords":72,"./defaults":73,"./draw":74}],77:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../plot_api/edit_types").overrideAll,a=t("../../plot_api/plot_template").templatedArray;e.exports=i(a("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":240,"../../plot_api/plot_template":247,"../annotations/attributes":68}],78:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes");function a(t,e){var r=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),i.setConvert(t._xa),t._xa._offset=a.l+r.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),i.setConvert(t._ya),t._ya._offset=a.t+(1-r.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)a(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":212,"../../plots/cartesian/axes":258}],79:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),s=t("./attributes");function l(t,e,r,a){function l(r,i){return n.coerce(t,e,s,r,i)}function u(t){var n=t+"axis",a={_fullLayout:{}};return a._fullLayout[n]=r[n],i.coercePosition(e,a,l,t,t,.5)}l("visible")&&(o(t,e,a.fullLayout,l),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){a(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":212,"../../plots/array_container_defaults":253,"../../plots/cartesian/axes":258,"../annotations/common_defaults":71,"./attributes":77}],80:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,i=t("../../plots/gl3d/project"),a=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],u=!1,c=0;c<3;c++){var p=a[c],h=l[p],f=e[p+"axis"].r2fraction(h);if(f<0||f>1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":289,"../annotations/draw":74}],81:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(t[l].annotations||[]).length&&(i.pushUnique(e._basePlotModules,r),i.pushUnique(e._subplots.gl3d,l))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":212,"../../registry":308,"./attributes":77,"./convert":78,"./defaults":79,"./draw":80}],82:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],83:[function(t,e,r){"use strict";var n=t("tinycolor2"),i=t("fast-isnumeric"),a=e.exports={},o=t("./attributes");a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function u(t){if(i(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e<o.length;e++)if(i=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]=u(i[r]);else t[n]=u(i);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(i))for(r=0;r<i.length;r++)Array.isArray(i[r])&&(i[r][1]=u(i[r][1]));else if(Array.isArray(i)){var s=i[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<i.length;r++)a.clean(i[r])}else i&&"object"==typeof i&&a.clean(i)}}},{"./attributes":82,"fast-isnumeric":18,tinycolor2:66}],84:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:""}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside bottom","inside bottom"],dflt:"outside"},ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:i({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:"string"},font:i({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:i({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":204,"../../plot_api/edit_types":240,"../../plots/cartesian/layout_attributes":272,"../../plots/font_attributes":286}],85:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],86:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),s=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){var u=i.newContainer(e,"colorbar"),c=t.colorbar||{};function p(t,e){return n.coerce(c,u,l,t,e)}var h=p("thicknessmode");p("thickness","fraction"===h?30/(r.width-r.margin.l-r.margin.r):30);var f=p("lenmode");p("len","fraction"===f?1:r.height-r.margin.t-r.margin.b),p("x"),p("xanchor"),p("xpad"),p("y"),p("yanchor"),p("ypad"),n.noneOrAll(c,u,["x","y"]),p("outlinecolor"),p("outlinewidth"),p("bordercolor"),p("borderwidth"),p("bgcolor");var d=p("ticklabelposition");a(c,u,p,"linear");var m={outerTicks:!1,font:r.font};-1!==d.indexOf("inside")&&(m.bgColor="black"),s(c,u,p,"linear",m),o(c,u,p,"linear",m),p("title.text",r._dfltTitle.colorbar),n.coerceFont(p,"title.font",r.font),p("title.side")}},{"../../lib":212,"../../plot_api/plot_template":247,"../../plots/cartesian/tick_label_defaults":279,"../../plots/cartesian/tick_mark_defaults":280,"../../plots/cartesian/tick_value_defaults":281,"./attributes":84}],87:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../plots/cartesian/axes"),l=t("../dragelement"),u=t("../../lib"),c=u.strTranslate,p=t("../../lib/extend").extendFlat,h=t("../../lib/setcursor"),f=t("../drawing"),d=t("../color"),m=t("../titles"),g=t("../../lib/svg_text_utils"),y=t("../colorscale/helpers").flipScale,v=t("../../plots/cartesian/axis_defaults"),_=t("../../plots/cartesian/position_defaults"),x=t("../../plots/cartesian/layout_attributes"),b=t("../../constants/alignment"),w=b.LINE_SPACING,T=b.FROM_TL,k=b.FROM_BR,A=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return p(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?y(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var c=0;c<o.length;c++){var h=o[c],f=(n=h[0].trace)._module.colorbar;if(!0===n.visible&&f)for(var d=Array.isArray(f),m=d?f:[f],g=0;g<m.length;g++){var v=(i=m[g]).container;(r=v?n[v]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(d&&v?"-"+v:""),e._traceIndex=n.index,e._propPrefix=(v?v+".":"")+"colorbar.",e._meta=n._meta,u(),s.push(e))}}for(var _ in a._colorAxes)if((r=a[_]).showscale){var x=a._colorAxes[_];(e=l(r.colorbar))._id="cb"+_,e._propPrefix=_+".colorbar.",e._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==x[0]&&(n=x[1],i.calc=n._module.colorbar.calc),u(),s.push(e)}return s}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(A.colorbar,!0),e.each((function(e){var r=n.select(this);u.ensureSingle(r,"rect",A.cbbg),u.ensureSingle(r,"g",A.cbfills),u.ensureSingle(r,"g",A.cblines),u.ensureSingle(r,"g",A.cbaxis,(function(t){t.classed(A.crisp,!0)})),u.ensureSingle(r,"g",A.cbtitleunshift,(function(t){t.append("g").classed(A.cbtitle,!0)})),u.ensureSingle(r,"rect",A.cboutline);var y=function(t,e,r){var o=r._fullLayout,l=o._size,h=e._fillcolor,y=e._line,b=e.title,M=b.side,S=e._zrange||n.extent(("function"==typeof h?h:y.color).domain()),C="function"==typeof y.color?y.color:function(){return y.color},L="function"==typeof h?h:function(){return h},E=e._levels,I=function(t,e,r){var n,i,a=e._levels,o=[],s=[],l=a.end+a.size/100,u=a.size,c=1.001*r[0]-.001*r[1],p=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*u,!(u>0?n>=l:n<=l));i++)n>c&&n<p&&o.push(n);if(e._fillgradient)s=[0];else if("function"==typeof e._fillcolor){var h=e._filllevels;if(h)for(l=h.end+h.size/100,u=h.size,i=0;i<1e5&&(n=h.start+i*u,!(u>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(t){return t-a.size/2}))).push(s[s.length-1]+a.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(s=[0]);a.size<0&&(o.reverse(),s.reverse());return{line:o,fill:s}}(0,e,S),z=I.fill,P=I.line,D=Math.round(e.thickness*("fraction"===e.thicknessmode?l.w:1)),O=D/l.w,R=Math.round(e.len*("fraction"===e.lenmode?l.h:1)),F=R/l.h,B=e.xpad/l.w,N=(e.borderwidth+e.outlinewidth)/2,U=e.ypad/l.h,j=Math.round(e.x*l.w+e.xpad),V=e.x-O*({middle:.5,right:1}[e.xanchor]||0),q=e.y+F*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),H=Math.round(l.h*(1-q)),Z=H-R;e._lenFrac=F,e._thickFrac=O,e._xLeftFrac=V,e._yBottomFrac=q;var G=e._axis=function(t,e,r){var n=t._fullLayout,i={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,ticklabelposition:e.ticklabelposition,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:"right",position:1},a={type:"linear",_id:"y"+e._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,noTicklabelmode:!0,calendar:n.calendar};function s(t,e){return u.coerce(i,a,x,t,e)}return v(i,a,s,o,n),_(i,a,s,o),a}(r,e,S);G.position=e.x+B+O,-1!==["top","bottom"].indexOf(M)&&(G.title.side=M,G.titlex=e.x+B,G.titley=q+("top"===b.side?F-U:U));if(y.color&&"auto"===e.tickmode){G.tickmode="linear",G.tick0=E.start;var X=E.size,W=u.constrain((H-Z)/50,4,15)+1,Y=(S[1]-S[0])/((e.nticks||W)*X);if(Y>1){var K=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));X*=K*u.roundUp(Y/K,[2,5,10]),(Math.abs(E.start)/E.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=X}G.domain=[q+U,q+F-U],G.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var J,Q=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),$=t.select("."+A.cbaxis),tt=0;function et(n,i){var a={propContainer:G,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),m.draw(r,n,p(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var t,r=l.l+(e.x+B)*l.w,n=G.title.font.size;t="top"===M?(1-(q+F-U))*l.h+l.t+3+.75*n:(1-(q+U))*l.h+l.t-3-.25*n,et(G._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var a=t.select("."+A.cbtitle),o=a.select("text"),p=[-e.outlinewidth/2,e.outlinewidth/2],h=a.select(".h"+G._id+"title-math-group").node(),d=15.6;if(o.node()&&(d=parseInt(o.node().style.fontSize,10)*w),h?(tt=f.bBox(h).height)>d&&(p[1]-=(tt-d)/2):o.node()&&!o.classed(A.jsPlaceholder)&&(tt=f.bBox(o.node()).height),tt){if(tt+=5,"top"===M)G.domain[1]-=tt/l.h,p[1]*=-1;else{G.domain[0]+=tt/l.h;var m=g.lineCount(o);p[1]+=(1-m)*d}a.attr("transform",c(p[0],p[1])),G.setScale()}}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",c(0,Math.round(l.h*(1-G.domain[1])))),$.attr("transform",c(0,Math.round(-l.t)));var v=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(z);v.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),v.exit().remove();var _=S.map(G.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,a){var o=[0===a?S[0]:(z[a]+z[a-1])/2,a===z.length-1?S[1]:(z[a]+z[a+1])/2].map(G.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,_[0],_[1]);var s=n.select(this).attr({x:j,width:Math.max(D,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)f.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}}));var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(y.color&&y.width?P:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+j+","+(Math.round(G.c2p(t))+y.width/2%1)+"h"+D).call(f.lineGroupStyle,y.width,C(t),y.dash)})),$.selectAll("g."+G._id+"tick,path").remove();var b=j+D+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(G),k=s.getTickSigns(G)[2];return s.drawTicks(r,G,{vals:"inside"===G.ticks?s.clipEnds(G,T):T,layer:$,path:s.makeTickPath(G,b,k),transFn:s.makeTransTickFn(G)}),s.drawLabels(r,G,{vals:T,layer:$,transFn:s.makeTransTickLabelFn(G),labelFns:s.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var t=G.title.font.size,e=G._offset+G._length/2,i=l.l+(G.position||0)*l.w+("right"===G.side?10+t*(G.showticklabels?1:.5):-10-t*(G.showticklabels?.5:0));et("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=D+e.outlinewidth/2;if(-1===G.ticklabelposition.indexOf("inside")&&(n+=f.bBox($.node()).width),(J=Q.select("text")).node()&&!J.classed(A.jsPlaceholder)){var i,o=Q.select(".h"+G._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(M)?f.bBox(o).width:f.bBox(Q.node()).right-j-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=H-Z;t.select("."+A.cbbg).attr({x:j-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:Z-N,width:Math.max(s,2),height:Math.max(u+2*N,2)}).call(d.fill,e.bgcolor).call(d.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+A.cboutline).attr({x:j,y:Z+e.ypad+("top"===M?tt:0),width:Math.max(D,2),height:Math.max(u-2*e.ypad-tt,2)}).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var p=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-p,l.t));var h={},m=T[e.yanchor],g=k[e.yanchor];"pixels"===e.lenmode?(h.y=e.y,h.t=u*m,h.b=u*g):(h.t=h.b=0,h.yt=e.y+e.len*m,h.yb=e.y-e.len*g);var y=T[e.xanchor],v=k[e.xanchor];if("pixels"===e.thicknessmode)h.x=e.x,h.l=s*y,h.r=s*v;else{var _=s-D;h.l=_*y,h.r=_*v,h.xl=e.x-e.thickness*y,h.xr=e.x+e.thickness*v}a.autoMargin(r,e._id,h)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":185,"../../lib":212,"../../lib/extend":204,"../../lib/setcursor":232,"../../lib/svg_text_utils":234,"../../plots/cartesian/axes":258,"../../plots/cartesian/axis_defaults":260,"../../plots/cartesian/layout_attributes":272,"../../plots/cartesian/position_defaults":275,"../../plots/plots":299,"../../registry":308,"../color":83,"../colorscale/helpers":94,"../dragelement":102,"../drawing":105,"../titles":178,"./constants":85,d3:16,tinycolor2:66}],88:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":212}],89:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":84,"./defaults":86,"./draw":87,"./has_colorbar":88}],90:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var f=s+"auto",d=s+"min",m=s+"max",g=s+"mid",y=(o(h+f),o(h+d),o(h+m),{});y[d]=y[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":228,"../colorbar/attributes":84,"./scales.js":98}],91:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,p=a(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,g=function(){return i.aggNums(Math.min,null,l)},y=function(){return i.aggNums(Math.max,null,l)};(void 0===f?f=g():h&&(f=c._colorAx&&n(f)?Math.min(f,g()):g()),void 0===d?d=y():h&&(d=c._colorAx&&n(d)?Math.max(d,y()):y()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m<m-f&&(d=m+(m-f))),f===d&&(f-=.5,d+=.5),p._sync("min",f),p._sync("max",d),p.autocolorscale)&&(o=f*d<0?s.colorscale.diverging:f>=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":212,"./helpers":94,"fast-isnumeric":18}],92:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s<t.length;s++){var l=t[s],u=l._module.colorbar;if(u)if(Array.isArray(u))for(var c=0;c<u.length;c++)o(l,u[c]);else o(l,u);i(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var p in e._colorAxes)o(e[p],{min:"cmin",max:"cmax"})}},{"../../lib":212,"./helpers":94}],93:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./scales").isValid,l=t("../../registry").traceIs;function u(t,e){var r=e.slice(0,e.length-1);return e?i.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,c,p,h){var f=h.prefix,d=h.cLetter,m="_module"in r,g=u(e,f),y=u(r,f),v=u(r._template||{},f)||{},_=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,c,p,h)};if(m){var x=c._colorAxes||{},b=p(f+"coloraxis");if(b){var w=l(r,"contour")&&i.nestedProperty(r,"contours.coloring").get()||"heatmap",T=x[b];return void(T?(T[2].push(_),T[0]!==w&&(T[0]=!1,i.warn(["Ignoring coloraxis:",b,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[b]=[w,r,[_]])}}var k=g[d+"min"],A=g[d+"max"],M=n(k)&&n(A)&&k<A;p(f+d+"auto",!M)?p(f+d+"mid"):(p(f+d+"min"),p(f+d+"max"));var S,C,L=g.colorscale,E=v.colorscale;(void 0!==L&&(S=!s(L)),void 0!==E&&(S=!s(E)),p(f+"autocolorscale",S),p(f+"colorscale"),p(f+"reversescale"),"marker.line."!==f)&&(f&&m&&(C=a(g)),p(f+"showscale",C)&&(f&&v&&(y._template=v),o(g,y,c)))}},{"../../lib":212,"../../registry":308,"../colorbar/defaults":86,"../colorbar/has_colorbar":88,"./scales":98,"fast-isnumeric":18}],94:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("fast-isnumeric"),o=t("../../lib"),s=t("../color"),l=t("./scales").isValid;var u=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function p(t){var e,r,n,i=t._colorAx,a=i||t,o={};for(r=0;r<u.length;r++)o[n=u[r]]=a[n];if(i)for(e="c",r=0;r<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in a||(s="z"+n)in a)&&(o[n]=a[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==c.indexOf(t)?e+t:t;a[n]=a["_"+n]=r},o}function h(t){for(var e=p(t),r=e.min,n=e.max,i=e.reversescale?f(e.colorscale):e.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var u=i[l];o[l]=r+u[0]*(n-r),s[l]=u[1]}return{domain:o,range:s}}function f(t){for(var e=t.length,r=new Array(e),n=e-1,i=0;n>=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c<l;c++){var p=i(o[c]).toRgb();u[c]=[p.r,p.g,p.b,p.a]}var h,f=n.scale.linear().domain(r).range(u).clamp(!0),d=e.noNumericCheck,g=e.returnArray;return(h=d&&g?f:d?function(t){return m(f(t))}:g?function(t){return a(t)?f(t):i(t).isValid()?t:s.defaultLine}:function(t){return a(t)?m(f(t)):i(t).isValid()?t:s.defaultLine}).domain=f.domain,h.range=function(){return o},h}function m(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return i(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?o.nestedProperty(t,e).get()||{}:t,i=n[r||"color"],s=!1;if(o.isArrayOrTypedArray(i))for(var u=0;u<i.length;u++)if(a(i[u])){s=!0;break}return o.isPlainObject(n)&&(s||!0===n.showscale||a(n.cmin)&&a(n.cmax)||l(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:p,extractScale:h,flipScale:f,makeColorScaleFunc:d,makeColorScaleFuncFromTrace:function(t,e){return d(h(t),e)}}},{"../../lib":212,"../color":83,"./scales":98,d3:16,"fast-isnumeric":18,tinycolor2:66}],95:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}},{"./attributes":90,"./calc":91,"./cross_trace_defaults":92,"./defaults":93,"./helpers":94,"./layout_attributes":96,"./layout_defaults":97,"./scales":98}],96:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("./attributes"),a=t("./scales").scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:a.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:a.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:a.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},i("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":204,"./attributes":90,"./scales":98}],97:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("./layout_attributes"),o=t("./defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,u=e._colorAxes;function c(t,e){return n.coerce(s,l,a.coloraxis,t,e)}for(var p in u){var h=u[p];if(h[0])s=t[p]||{},(l=i.newContainer(e,p,"coloraxis"))._name=p,o(s,l,e,c,{prefix:"",cLetter:"c"});else{for(var f=0;f<h[2].length;f++)h[2][f]();delete e._colorAxes[p]}}}},{"../../lib":212,"../../plot_api/plot_template":247,"./defaults":93,"./layout_attributes":96}],98:[function(t,e,r){"use strict";var n=t("tinycolor2"),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=i.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var i=t[r];if(2!==i.length||+i[0]<e||!n(i[1]).isValid())return!1;e=+i[0]}return!0}e.exports={scales:i,defaultScale:a,get:function(t,e){if(e||(e=a),!t)return e;function r(){try{t=i[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==i[t]||o(t)}}},{tinycolor2:66}],99:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},{}],100:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":212}],101:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],102:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,_=t.element;g._mouseDownTime||(g._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function b(a){g._dragged=!1,g._dragging=!0;var o=p(a);e=o[0],r=o[1],d=a.target,f=a,m=2===a.buttons||a.ctrlKey,"undefined"==typeof a.clientX&&"undefined"==typeof a.clientY&&(a.clientX=e,a.clientY=r),(n=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=n),t.prepFn&&t.prepFn(a,e,r),i&&!m?(h=c()).style.cursor=window.getComputedStyle(_).cursor:i||(h=document,u=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mouseup",T),document.addEventListener("touchend",T),!1!==t.dragmode&&(a.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=p(n),a=t.minDrag||s.MINDRAG,o=x(i[0]-e,i[1]-r,a),u=o[0],c=o[1];(u||c)&&(g._dragged=!0,l.unhover(g)),g._dragged&&t.moveFn&&!m&&(g._dragdata={element:_,dx:u,dy:c},t.moveFn(u,c))}function T(e){if(delete g._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T),i?o(h):u&&(h.documentElement.style.cursor=u,u=null),g._dragging){if(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=c},{"../../lib":212,"../../plots/cartesian/constants":264,"./align":99,"./cursor":100,"./unhover":103,"has-hover":49,"has-passive-events":50,"mouse-event-offset":55}],103:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":202,"../../lib/events":203,"../../lib/throttle":235,"../fx/constants":117}],104:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],105:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=u.strTranslate,p=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),f=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,m=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,v=e.exports={};v.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform",c(a,o)),!0)},v.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);v.translatePoint(t,i,e,r)}))},v.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){v.hideOutsideRangePoint(t,n.select(this),r,i,s,l)}))}))}},v.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(v.dashLine,l,o)}))},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var _=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;v.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),v.symbolNames[r]=t,v.symbolFuncs[r]=e.f,e.needLine&&(v.symbolNeedLines[r]=!0),e.noDot?v.symbolNoDot[r]=!0:v.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(v.symbolNoFill[r]=!0)}));var x=v.symbolNames.length;function b(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.symbolNumber=function(t){if(i(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=n.format("~.1f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};v.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=A[i],h=new Array(c),f=0;f<c;f++)p.reversed?h[c-1-f]=[k(100*(1-o[f][0])),o[f][1]]:h[f]=[k(100*o[f][0]),o[f][1]];var d=e._fullLayout,m="g"+d._uid+"-"+r,g=d._defs.select(".gradients").selectAll("#"+m).data([i+h.join(";")],u.identity);g.exit().remove(),g.enter().append(p.node).each((function(){var t=n.select(this);p.attrs&&t.attr(p.attrs),t.attr("id",m);var e=t.selectAll("stop").data(h);e.exit().remove(),e.enter().append("stop"),e.each((function(t){var e=a(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}))})),t.style(l,D(m,e)).style(l+"-opacity",null);var y=function(t){return"."+t.attr("class").replace(/\s/g,".")},v=y(n.select(t.node().parentNode))+">"+y(t);d._gradientUrlQueryParts[v]=1},v.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},v.pointStyle=function(t,e,r){if(t.size()){var i=v.makePointStyleFns(e);t.each((function(t){v.singlePointStyle(t,n.select(this),e,i,r)}))}},v.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=v.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",b(c,l))}var p,h,f,d=!1;if(t.so)f=o.outlierwidth,h=o.outliercolor,p=a.outliercolor;else{var m=(o||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(p=s.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var g=a.gradient,y=t.mgt;if(y?d=!0:y=g&&g.type,Array.isArray(y)&&(y=y[0],A[y]||(y=0)),y&&"none"!==y){var _=t.mgc;_?d=!0:_=g.color;var x=r.uid;d&&(x+="-"+t.i),v.gradient(e,i,x,y,[[0,_],[1,p]],"fill")}else s.fill(e,p);f&&s.stroke(e,h)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,p=s.opacity,h=void 0!==c,f=void 0!==p;(u.isArrayOrTypedArray(l)||h||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:f?p:d*e});var m=i.color,g=a.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=i.size,_=a.size,x=s.size,b=void 0!==_,w=void 0!==x;return o.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",b(v.symbolNumber(n),a)),e.mrc2=a})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r<a.length;r++)a[r](e,t)}))}},v.tryColorscale=function(t,e){var r=e?u.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&u.isArrayOrTypedArray(n))return l.makeColorScaleFuncFromTrace(r)}return u.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function S(t,e,r,i){var a=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",s=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",l=i?i/.8+1:0,u=(p.lineCount(t)-1)*f+1,h=M[s]*l,d=.75*r+M[o]*l+(M[o]-1)*u*r/2;t.attr("text-anchor",s),a.attr("transform",c(h,d))}function C(t,e){var r=t.ts||e.textfont.size;return i(r)&&r>0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=v.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var c=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};y(h,e,t.i);var f=e._meta||{};l=u.texttemplateString(l,c,s._d3locale,h,t,f)}var d=t.tp||e.textposition,m=C(t,e),g=i?i(t):t.tc||e.textfont.color;a.call(v.font,t.tf||e.textfont.family,m,g).text(l).call(p.convertToTspans,r).call(S,d,m,t.mrc)}else a.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=C(t,e);s.fill(i,a),S(i,o,l,t.mrc2||t.mrc)}))}};function L(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),p=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(L(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,a=[L(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(L(t[r-1],t[r],t[r+1],e));for(a.push(L(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+t[0]+"Z"};var E={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},I=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};v.steps=function(t){var e=E[t]||I;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),i=1;i<t.length;i++)r+=e(t[i-1],t[i]);return r}},v.makeTester=function(){var t=u.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(t){t.attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),e=u.ensureSingle(t,"path","js-reference-point",(function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));v.tester=t,v.testref=e},v.savedBBoxes={};var z=0;function P(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function D(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}v.bBox=function(t,e,r){var i,a,o;if(r||(r=P(t)),r){if(i=v.savedBBoxes[r])return u.extendFlat({},i)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(r=P(s)){var l=+s.getAttribute("x")||0,c=+s.getAttribute("y")||0,h=s.getAttribute("transform");if(!h){var f=v.bBox(s,!1,r);return l&&(f.left+=l,f.right+=l),c&&(f.top+=c,f.bottom+=c),f}if(r+="~"+l+"~"+c+"~"+h,i=v.savedBBoxes[r])return u.extendFlat({},i)}}e?a=t:(o=v.tester.node(),a=t.cloneNode(!0),o.appendChild(a)),n.select(a).attr("transform",null).call(p.positionText,0,0);var d=a.getBoundingClientRect(),m=v.testref.node().getBoundingClientRect();e||o.removeChild(a);var g={height:d.height,width:d.width,left:d.left-m.left,top:d.top-m.top,right:d.right-m.left,bottom:d.bottom-m.top};return z>=1e4&&(v.savedBBoxes={},z=0),r&&(v.savedBBoxes[r]=g),z++,u.extendFlat({},g)},v.setClipUrl=function(t,e,r){t.attr("clip-path",D(e,r))},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=c(e,r)).trim(),t[i]("transform",a),a},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var O=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(O,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var R=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(R);t=1===e&&1===r?[]:[c(o,s),"scale("+e+","+r+")",c(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":119,"../../constants/alignment":185,"../../constants/interactions":188,"../../constants/xmlns_namespaces":190,"../../lib":212,"../../lib/svg_text_utils":234,"../../registry":308,"../../traces/scatter/make_bubble_size_func":356,"../../traces/scatter/subtypes":364,"../color":83,"../colorscale":95,"./symbol_defs":106,d3:16,"fast-isnumeric":18,tinycolor2:66}],106:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{d3:16}],107:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],108:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p<t.length;p++){var h=t[p],f=h.i;if(void 0===f)f=p;else if(null===f)continue;var d=h[i];if(n(r.c2l(d))){var m=c(d,f);if(n(m[0])&&n(m[1])){var g=h[i+"s"]=d-m[0],y=h[i+"h"]=d+m[1];u.push(g,y)}}}var v=r._id,_=e._extremes[v],x=a.findExtremes(r,u,o.extendFlat({tozero:_.opts.tozero},{padded:!0}));_.min=_.min.concat(x.min),_.max=_.max.concat(x.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&i.traceIs(o,"errorBarsOK")){var s=a.getFromId(t,o.xaxis),u=a.getFromId(t,o.yaxis);l(n,o,s,"x"),l(n,o,u,"y")}}}},{"../../lib":212,"../../plots/cartesian/axes":258,"../../registry":308,"./compute_error":109,"fast-isnumeric":18}],109:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var i=t.array||[];if(r)return function(t,e){var r=+i[e];return[r,r]};var a=t.arrayminus||[];return function(t,e){var r=+i[e],n=+a[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],110:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("../../plot_api/plot_template"),s=t("./attributes");e.exports=function(t,e,r,l){var u="error_"+l.axis,c=o.newContainer(e,u),p=t[u]||{};function h(t,e){return a.coerce(p,c,s,t,e)}if(!1!==h("visible",void 0!==p.array||void 0!==p.value||"sqrt"===p.type)){var f=h("type","array"in p?"data":"percent"),d=!0;"sqrt"!==f&&(d=h("symmetric",!(("data"===f?"arrayminus":"valueminus")in p))),"data"===f?(h("array"),h("traceref"),d||(h("arrayminus"),h("tracerefminus"))):"percent"!==f&&"constant"!==f||(h("value"),d||h("valueminus"));var m="copy_"+l.inherit+"style";if(l.inherit)(e["error_"+l.inherit]||{}).visible&&h(m,!(p.color||n(p.thickness)||n(p.width)));l.inherit&&c[m]||(h("color",r),h("thickness"),h("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":212,"../../plot_api/plot_template":247,"../../registry":308,"./attributes":107,"fast-isnumeric":18}],111:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/edit_types").overrideAll,a=t("./attributes"),o={error_x:n.extendFlat({},a),error_y:n.extendFlat({},a)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:n.extendFlat({},a),error_y:n.extendFlat({},a),error_z:n.extendFlat({},a)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:i(s,"calc","nested"),scattergl:i(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":212,"../../plot_api/edit_types":240,"./attributes":107,"./calc":108,"./compute_error":109,"./defaults":110,"./plot":112,"./style":113}],112:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,s){var l=r.xaxis,u=r.yaxis,c=s&&s.duration>0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,p);if(g.exit().remove(),e.length){f.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);c&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var p=d.width;a="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(a+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(f.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(f.copy_ystyle?d:f).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":364,"../drawing":105,d3:16,"fast-isnumeric":18}],113:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":83,d3:16}],114:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":204,"../../plots/font_attributes":286,"./layout_attributes":124}],115:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s<e.length;s++){var l=e[s],u=l[0].trace;if(!i.traceIs(u,"pie-like")){var c=i.traceIs(u,"2dMap")?a:n.fillArray;c(u.hoverinfo,l,"hi",o(u)),u.hovertemplate&&c(u.hovertemplate,l,"ht"),u.hoverlabel&&(c(u.hoverlabel.bgcolor,l,"hbg"),c(u.hoverlabel.bordercolor,l,"hbc"),c(u.hoverlabel.font.size,l,"hts"),c(u.hoverlabel.font.color,l,"htc"),c(u.hoverlabel.font.family,l,"htf"),c(u.hoverlabel.namelength,l,"hnl"),c(u.hoverlabel.align,l,"hta"))}}}},{"../../lib":212,"../../registry":308}],116:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./hover").hover;e.exports=function(t,e,r){var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&i(t,e,r,!0),t._hoverdata&&e&&e.target&&(a&&a.then?a.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":308,"./hover":120}],117:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],118:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var s=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}),s)}},{"../../lib":212,"./attributes":114,"./hoverlabel_defaults":121}],119:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==e.indexOf(n[a]+i[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,i){return"closest"===t?i||r.quadrature(e,n):"x"===t.charAt(0)?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},r.makeEventData=function(t,e,n){var i="index"in t?t.index:t.pointNumber,a={data:e._input,fullData:e,curveNumber:e.index,pointNumber:i};if(e._indexToPoints){var o=e._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return e._module.eventData?a=e._module.eventData(a,t,e,n,i):("xVal"in t?a.x=t.xVal:"x"in t&&(a.x=t.x),"yVal"in t?a.y=t.yVal:"y"in t&&(a.y=t.y),t.xa&&(a.xaxis=t.xa),t.ya&&(a.yaxis=t.ya),void 0!==t.zLabelVal&&(a.z=t.zLabelVal)),r.appendArrayPointValue(a,e,i),a},r.appendArrayPointValue=function(t,e,r){var i=e._arrayAttrs;if(i)for(var s=0;s<i.length;s++){var l=i[s],u=a(l);if(void 0===t[u]){var c=o(n.nestedProperty(e,l).get(),r);void 0!==c&&(t[u]=c)}}},r.appendArrayMultiPointValues=function(t,e,r){var i=e._arrayAttrs;if(i)for(var s=0;s<i.length;s++){var l=i[s],u=a(l);if(void 0===t[u]){for(var c=n.nestedProperty(e,l).get(),p=new Array(r.length),h=0;h<r.length;h++)p[h]=o(c,r[h]);t[u]=p}}};var i={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function a(t){return i[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var s={x:!0,y:!0},l={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(t){return"string"==typeof t&&!!l[t]},r.isXYhover=function(t){return"string"==typeof t&&!!s[t]}},{"../../lib":212}],120:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../lib"),s=o.strTranslate,l=o.strRotate,u=t("../../lib/events"),c=t("../../lib/svg_text_utils"),p=t("../../lib/override_cursor"),h=t("../drawing"),f=t("../color"),d=t("../dragelement"),m=t("../../plots/cartesian/axes"),g=t("../../registry"),y=t("./helpers"),v=t("./constants"),_=t("../legend/defaults"),x=t("../legend/draw"),b=v.YANGLE,w=Math.PI*b/180,T=1/Math.sin(w),k=Math.cos(w),A=Math.sin(w),M=v.HOVERARROWSIZE,S=v.HOVERTEXTPAD;function C(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")}r.hover=function(t,e,r,a){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,(function(){!function(t,e,r,a){r||(r="xy");var s=Array.isArray(r)?r:[r],l=t._fullLayout,c=l._plots||[],h=c[r],m=l._has("cartesian");if(h){var v=h.overlays.map((function(t){return t.id}));s=s.concat(v)}for(var _=s.length,x=new Array(_),b=new Array(_),w=!1,k=0;k<_;k++){var A=s[k];if(c[A])w=!0,x[k]=c[A].xaxis,b[k]=c[A].yaxis;else{if(!l[A]||!l[A]._subplot)return void o.warn("Unrecognized subplot: "+A);var M=l[A]._subplot;x[k]=M.xaxis,b[k]=M.yaxis}}var S=e.hovermode||l.hovermode;S&&!w&&(S="closest");if(-1===["x","y","closest","x unified","y unified"].indexOf(S)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return d.unhoverRaw(t,e);var L,I,R,F,B,N,U,j,V,q,H,Z,G,X=-1===l.hoverdistance?1/0:l.hoverdistance,W=-1===l.spikedistance?1/0:l.spikedistance,Y=[],K=[],J={hLinePoint:null,vLinePoint:null},Q=!1;if(Array.isArray(e))for(S="array",R=0;R<e.length;R++)(B=t.calcdata[e[R].curveNumber||0])&&(N=B[0].trace,"skip"!==B[0].trace.hoverinfo&&(K.push(B),"h"===N.orientation&&(Q=!0)));else{for(F=0;F<t.calcdata.length;F++)B=t.calcdata[F],"skip"!==(N=B[0].trace).hoverinfo&&y.isTraceInSubplots(N,s)&&(K.push(B),"h"===N.orientation&&(Q=!0));var $,tt;if(!e.target)$="xpx"in e?e.xpx:x[0]._length/2,tt="ypx"in e?e.ypx:b[0]._length/2;else{if(!1===u.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();$=e.clientX-et.left,tt=e.clientY-et.top,l._calcInverseTransform(t);var rt=o.apply3DTransform(l._invTransform)($,tt);if($=rt[0],tt=rt[1],$<0||$>x[0]._length||tt<0||tt>b[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=$+x[0]._offset,e.pointerY=tt+b[0]._offset,L="xval"in e?y.flat(s,e.xval):y.p2c(x,$),I="yval"in e?y.flat(s,e.yval):y.p2c(b,tt),!i(L[0])||!i(I[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var nt=1/0;function it(t,r){for(F=0;F<K.length;F++)if((B=K[F])&&B[0]&&B[0].trace&&!0===(N=B[0].trace).visible&&0!==N._length&&-1===["carpet","contourcarpet"].indexOf(N._module.name)){if("splom"===N.type?U=s[j=0]:(U=y.getSubplot(N),j=s.indexOf(U)),V=S,y.isUnifiedHover(V)&&(V=V.charAt(0)),Z={cd:B,trace:N,xa:x[j],ya:b[j],maxHoverDistance:X,maxSpikeDistance:W,index:!1,distance:Math.min(nt,X),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:N.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},l[U]&&(Z.subplot=l[U]._subplot),l._splomScenes&&l._splomScenes[N.uid]&&(Z.scene=l._splomScenes[N.uid]),G=Y.length,"array"===V){var n=e[F];"pointNumber"in n?(Z.index=n.pointNumber,V="closest"):(V="","xval"in n&&(q=n.xval,V="x"),"yval"in n&&(H=n.yval,V=V?"closest":"y"))}else void 0!==t&&void 0!==r?(q=t,H=r):(q=L[j],H=I[j]);if(0!==X)if(N._module&&N._module.hoverPoints){var a=N._module.hoverPoints(Z,q,H,V,l._hoverlayer);if(a)for(var u,c=0;c<a.length;c++)u=a[c],i(u.x0)&&i(u.y0)&&Y.push(P(u,S))}else o.log("Unrecognized trace type in hover:",N);if("closest"===S&&Y.length>G&&(Y.splice(0,G),nt=Y[0].distance),m&&0!==W&&0===Y.length){Z.distance=W,Z.index=!1;var p=N._module.hoverPoints(Z,q,H,"closest",l._hoverlayer);if(p&&(p=p.filter((function(t){return t.spikeDistance<=W}))),p&&p.length){var h,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var g=d[0];i(g.x0)&&i(g.y0)&&(h=ot(g),(!J.vLinePoint||J.vLinePoint.spikeDistance>h.spikeDistance)&&(J.vLinePoint=h))}var v=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var _=v[0];i(_.x0)&&i(_.y0)&&(h=ot(_),(!J.hLinePoint||J.hLinePoint.spikeDistance>h.spikeDistance)&&(J.hLinePoint=h))}}}}}function at(t,e){for(var r,n=null,i=1/0,a=0;a<t.length;a++)(r=t[a].spikeDistance)<=i&&r<=e&&(n=t[a],i=r);return n}function ot(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}it();var st={fullLayout:l,container:l._hoverlayer,outerContainer:l._paperdiv,event:e},lt=t._spikepoints,ut={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(t._spikepoints=ut,m&&0!==W&&0!==Y.length){var ct=at(Y.filter((function(t){return t.ya.showspikes})),W);J.hLinePoint=ot(ct);var pt=at(Y.filter((function(t){return t.xa.showspikes})),W);J.vLinePoint=ot(pt)}if(0===Y.length){var ht=d.unhoverRaw(t,e);return!m||null===J.hLinePoint&&null===J.vLinePoint||O(lt)&&D(t,J,st),ht}m&&O(lt)&&D(t,J,st);if(Y.sort((function(t,e){return t.distance-e.distance})),y.isXYhover(V)&&0!==Y[0].length&&"splom"!==Y[0].trace.type){var ft=Y[0],dt=ft.cd[ft.index],mt="group"===l.boxmode||"group"===l.violinmode,gt=ft.xVal,yt=ft.xa;"category"===yt.type&&(gt=yt._categoriesMap[gt]),"date"===yt.type&&(gt=yt.d2c(gt)),dt&&dt.t&&dt.t.posLetter===yt._id&&mt&&(gt+=dt.t.dPos);var vt=ft.yVal;"category"===(yt=ft.ya).type&&(vt=yt._categoriesMap[vt]),"date"===yt.type&&(vt=yt.d2c(vt)),dt&&dt.t&&dt.t.posLetter===yt._id&&mt&&(vt+=dt.t.dPos),it(gt,vt);var _t={};Y=Y.filter((function(t){var e=C(t);if(!_t[e])return _t[e]=!0,_t[e]}))}var xt=t._hoverdata,bt=[];for(R=0;R<Y.length;R++){var wt=Y[R],Tt=y.makeEventData(wt,wt.trace,wt.cd);if(!1!==wt.hovertemplate){var kt=!1;wt.cd[wt.index]&&wt.cd[wt.index].ht&&(kt=wt.cd[wt.index].ht),wt.hovertemplate=kt||wt.trace.hovertemplate||!1}wt.eventData=[Tt],bt.push(Tt)}t._hoverdata=bt;var At="y"===S&&(K.length>1||Y.length>1)||"closest"===S&&Q&&Y.length>1,Mt=f.combine(l.plot_bgcolor||f.background,l.paper_bgcolor),St={hovermode:S,rotateLabels:At,bgColor:Mt,container:l._hoverlayer,outerContainer:l._paperdiv,commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance},Ct=E(Y,St,t);y.isUnifiedHover(S)||(!function(t,e,r){var n,i,a,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?r.width:r.height}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o<f.length-1;){var g=f[o],y=f[o+1],v=g[g.length-1],_=y[0];if((i=v.pos+v.dp+v.size-_.pos-_.dp+_.size)>.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=y.length-1;s>=0;s--)y[s].dp+=i;for(g.push.apply(g,y),f.splice(o+1,1),u=0,s=g.length-1;s>=0;s--)u+=g[s].dp;for(a=u/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var b=x[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Ct,At?"xa":"ya",l),z(Ct,At,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Lt=g.getComponentMethod("annotations","hasClickToShow")(t,bt);p(n.select(e.target),Lt?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,xt))return;xt&&t.emit("plotly_unhover",{event:e,points:xt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:b,xvals:L,yvals:I})}(t,e,r,a)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map((function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:a,outerContainer:o},l=E(i,s,e.gd),u=0,c=0;l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5<u?u-n+5:0,u=n+t.by+t.offset,r===e.anchorIndex&&(c=t.offset)})).each((function(t){t.offset-=c}));var p=e.gd._fullLayout._invScaleX,h=e.gd._fullLayout._invScaleY;return z(l,s.rotateLabels,p,h),r?l:l.node()};var L=/<extra>([\s\S]*)<\/extra>/;function E(t,e,r){var i=r._fullLayout,a=e.hovermode,u=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,g=e.commonLabelOpts||{},w=e.fontFamily||v.HOVERFONT,T=e.fontSize||v.HOVERFONTSIZE,k=t[0],A=k.xa,L=k.ya,E="y"===a.charAt(0)?"yLabel":"xLabel",z=k[E],P=(String(z)||"").split(" ")[0],D=m.node().getBoundingClientRect(),O=D.top,R=D.width,F=D.height,B=void 0!==z&&k.distance<=e.hoverdistance&&("x"===a||"y"===a);if(B){var N,U,j=!0;for(N=0;N<t.length;N++)if(j&&void 0===t[N].zLabel&&(j=!1),U=t[N].hoverinfo||t[N].trace.hoverinfo){var V=Array.isArray(U)?U:U.split("+");if(-1===V.indexOf("all")&&-1===V.indexOf(a)){B=!1;break}}j&&(B=!1)}var q=d.selectAll("g.axistext").data(B?[0]:[]);function H(t){return t.filter((function(t){return void 0!==t.zLabelVal||(t[E]||"").split(" ")[0]===P}))}if(q.enter().append("g").classed("axistext",!0),q.exit().remove(),q.each((function(){var e=n.select(this),l=o.ensureSingle(e,"path","",(function(t){t.style({"stroke-width":"1px"})})),u=o.ensureSingle(e,"text","",(function(t){t.attr("data-notex",1)})),p=g.bgcolor||f.defaultLine,d=g.bordercolor||f.contrast(p),m=f.contrast(p),y={family:g.font.family||w,size:g.font.size||T,color:g.font.color||m};l.style({fill:p,stroke:d}),u.text(z).call(h.font,y).call(c.positionText,0,0).call(c.convertToTspans,r),e.attr("transform","");var v,_,x=u.node().getBoundingClientRect();if("x"===a){var b="top"===A.side?"-":"";u.attr("text-anchor","middle").call(c.positionText,0,"top"===A.side?O-x.bottom-M-S:O-x.top+M+S),v=A._offset+(k.x0+k.x1)/2,_=L._offset+("top"===A.side?0:L._length);var C=x.width/2+S;v<C?(v=C,l.attr("d","M-"+(C-M)+",0L-"+(C-2*M)+","+b+M+"H"+(S+x.width/2)+"v"+b+(2*S+x.height)+"H-"+C+"V"+b+M+"Z")):v>i.width-C?(v=i.width-C,l.attr("d","M"+(C-M)+",0L"+C+","+b+M+"v"+b+(2*S+x.height)+"H-"+C+"V"+b+M+"H"+(C-2*M)+"Z")):l.attr("d","M0,0L"+M+","+b+M+"H"+(S+x.width/2)+"v"+b+(2*S+x.height)+"H-"+(S+x.width/2)+"V"+b+M+"H-"+M+"Z")}else{var E,I,P;"right"===L.side?(E="start",I=1,P="",v=A._offset+A._length):(E="end",I=-1,P="-",v=A._offset),_=L._offset+(k.y0+k.y1)/2,u.attr("text-anchor",E),l.attr("d","M0,0L"+P+M+","+M+"V"+(S+x.height/2)+"h"+P+(2*S+x.width)+"V-"+(S+x.height/2)+"H"+P+M+"V-"+M+"Z");var D,R=x.height/2,F=O-x.top-R,B="clip"+i._uid+"commonlabel"+L._id;if(v<x.width+2*S+M){D="M-"+(M+S)+"-"+R+"h-"+(x.width-S)+"V"+R+"h"+(x.width-S)+"Z";var N=x.width-v+S;c.positionText(u,N,F),"end"===E&&u.selectAll("tspan").each((function(){var t=n.select(this),e=h.tester.append("text").text(t.text()).call(h.font,y),r=e.node().getBoundingClientRect();Math.round(r.width)<Math.round(x.width)&&t.attr("x",N-r.width),e.remove()}))}else c.positionText(u,I*(S+M),F),D=null;var U=i._topclips.selectAll("#"+B).data(D?[0]:[]);U.enter().append("clipPath").attr("id",B).append("path"),U.exit().remove(),U.select("path").attr("d",D),h.setClipUrl(u,D?B:null,r)}e.attr("transform",s(v,_)),t=H(t)})),y.isUnifiedHover(a)){if(d.selectAll("g.hovertext").remove(),void 0!==z&&k.distance<=e.hoverdistance&&(t=H(t)),0===t.length)return;var Z={showlegend:!0,legend:{title:{text:z,font:i.hoverlabel.font},font:i.hoverlabel.font,bgcolor:i.hoverlabel.bgcolor,bordercolor:i.hoverlabel.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:i.legend?i.legend.traceorder:void 0,orientation:"v"}},G={};_(Z,G,r._fullData);var X=G.legend;X.entries=[];for(var W=0;W<t.length;W++){var Y=I(t[W],!0,a,i,z),K=Y[0],J=Y[1],Q=t[W];Q.name=J,Q.text=""!==J?J+" : "+K:K;var $=Q.cd[Q.index];$&&($.mc&&(Q.mc=$.mc),$.mcc&&(Q.mc=$.mcc),$.mlc&&(Q.mlc=$.mlc),$.mlcc&&(Q.mlc=$.mlcc),$.mlw&&(Q.mlw=$.mlw),$.mrc&&(Q.mrc=$.mrc),$.dir&&(Q.dir=$.dir)),Q._distinct=!0,X.entries.push([Q])}X.entries.sort((function(t,e){return t[0].trace.index-e[0].trace.index})),X.layer=d,x(r,X);var tt=o.mean(t.map((function(t){return(t.y0+t.y1)/2}))),et=o.mean(t.map((function(t){return(t.x0+t.x1)/2}))),rt=d.select("g.legend"),nt=rt.node().getBoundingClientRect();et+=A._offset,tt+=L._offset-nt.height/2;var it=nt.width+2*S;!(et+it<=R)&&et-it>=0?et-=it:et+=2*S;var at=nt.height+2*S,ot=tt+at>=F;return at<=F&&(tt<=O?tt=L._offset+2*S:ot&&(tt=F-at)),rt.attr("transform",s(et,tt)),rt}var st=d.selectAll("g.hovertext").data(t,(function(t){return C(t)}));return st.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(f.fill,f.addOpacity(p,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(h.font,w,T)})),st.exit().remove(),st.each((function(t){var e=n.select(this).attr("transform",""),o=t.color;Array.isArray(o)&&(o=o[t.eventData[0].pointNumber]);var d=t.bgcolor||o,m=f.combine(f.opacity(d)?d:f.defaultLine,p),g=f.combine(f.opacity(o)?o:f.defaultLine,p),y=t.borderColor||f.contrast(m),v=I(t,B,a,i,z,e),_=v[0],x=v[1],k=e.select("text.nums").call(h.font,t.fontFamily||w,t.fontSize||T,t.fontColor||y).text(_).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,r),A=e.select("text.name"),C=0,L=0;if(x&&x!==_){A.call(h.font,t.fontFamily||w,t.fontSize||T,g).text(x).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,r);var E=A.node().getBoundingClientRect();C=E.width+2*S,L=E.height+2*S}else A.remove(),e.select("rect").remove();e.select("path").style({fill:m,stroke:y});var P,D,N=k.node().getBoundingClientRect(),U=t.xa._offset+(t.x0+t.x1)/2,j=t.ya._offset+(t.y0+t.y1)/2,V=Math.abs(t.x1-t.x0),q=Math.abs(t.y1-t.y0),H=N.width+M+S+C;if(t.ty0=O-N.top,t.bx=N.width+2*S,t.by=Math.max(N.height+2*S,L),t.anchor="start",t.txwidth=N.width,t.tx2width=C,t.offset=0,u)t.pos=U,P=j+q/2+H<=F,D=j-q/2-H>=0,"top"!==t.idealAlign&&P||!D?P?(j+=q/2,t.anchor="start"):t.anchor="middle":(j-=q/2,t.anchor="end");else if(t.pos=j,P=U+V/2+H<=R,D=U-V/2-H>=0,"left"!==t.idealAlign&&P||!D)if(P)U+=V/2,t.anchor="start";else{t.anchor="middle";var Z=H/2,G=U+Z-R,X=U-Z;G>0&&(U-=G),X<0&&(U+=-X)}else U-=V/2,t.anchor="end";k.attr("text-anchor",t.anchor),C&&A.attr("text-anchor",t.anchor),e.attr("transform",s(U,j)+(u?l(b):""))})),st}function I(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=R(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===i?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"<br>":"")+t.text),void 0!==t.extraText&&(l+=(l?"<br>":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,p=t.hovertemplateLabels||t,h=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,p,u,h,t.trace._meta)).replace(L,(function(e,r){return s=R(r,t.nameLength),""}))),[l,s]}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],p=u*(M+S),f=p+u*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(p-=t.tx2width/2,f+=t.txwidth/2+S),e&&(m*=-A,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(m-M)+"Z");var y=d+p,v=m+t.ty0-t.by/2+S,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==s?(i.attr("text-anchor","start"),y=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===_&&"end"!==s&&(i.attr("text-anchor","end"),y=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(c.positionText,a(y),o(v)),t.tx2width&&(r.select("text.name").call(c.positionText,a(f+u*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(f+(u-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function D(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var d=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var g,y,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(g=u.pointerX,y=u.pointerY):(g=n._offset+v.x,y=i._offset+v.y);var _,x,b=a.readability(v.color,d)<1.5?f.contrast(d):v.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||b,A=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=A,x=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),_=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:y,y2:y,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:y,y2:y,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:y,r:T,fill:k}).classed("spikeline",!0)}if(p){var C,L,E=e.vLinePoint;n=E&&E.xa,i=E&&E.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+E.x,L=i._offset+E.y);var I,z,P=a.readability(E.color,d)<1.5?f.contrast(d):E.color,D=n.spikemode,O=n.spikethickness,R=n.spikecolor||P,F=m.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(I=F,z=L),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),I=l.t+(1-N)*l.h,z=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:I,y2:z,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:I,y2:z,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function O(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function R(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":212,"../../lib/events":203,"../../lib/override_cursor":223,"../../lib/svg_text_utils":234,"../../plots/cartesian/axes":258,"../../registry":308,"../color":83,"../dragelement":102,"../drawing":105,"../legend/defaults":135,"../legend/draw":136,"./constants":117,"./helpers":119,d3:16,"fast-isnumeric":18,tinycolor2:66}],121:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&a(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":212,"../color":83,"./helpers":119}],122:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}var o,s=a("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n<t.length;n++){var i=t[n],a=i.xaxis+i.yaxis,o=(r[a]||{})[i.stackgroup]||{};if("h"!==i.orientation&&"h"!==o.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",a("hovermode",o)}},{"../../lib":212,"./layout_attributes":124}],123:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":212,"../dragelement":102,"./attributes":114,"./calc":115,"./click":116,"./constants":117,"./defaults":118,"./helpers":119,"./hover":120,"./layout_attributes":124,"./layout_defaults":125,"./layout_global_defaults":126,d3:16}],124:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":286,"./constants":117}],125:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").isUnifiedHover,a=t("./layout_attributes"),o=t("./hovermode_defaults"),s=t("./hoverlabel_defaults");e.exports=function(t,e,r){function l(r,i){return n.coerce(t,e,a,r,i)}var u=o(t,e,r);u&&(l("hoverdistance"),l("spikedistance",i(u)?-1:void 0)),"select"===l("dragmode")&&l("selectdirection");var c=e._has("mapbox"),p=e._has("geo"),h=e._basePlotModules.length;"zoom"===e.dragmode&&((c||p)&&1===h||c&&p&&2===h)&&(e.dragmode="pan"),s(t,e,l)}},{"../../lib":212,"./helpers":119,"./hoverlabel_defaults":121,"./hovermode_defaults":122,"./layout_attributes":124}],126:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":212,"./hoverlabel_defaults":121,"./layout_attributes":124}],127:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),p=c*(1-o),h=0;h<i;h++){var f=u+c*h;l[a?i-1-h:h]=[f,f+p]}return l}function p(t,e,r,n,i){var a,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(a=0;a<r;a++)s(a,t[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(t,e){var r=t.grid||{},i=u(e,r,"x"),a=u(e,r,"y");if(t.grid||i||a){var o,p,h=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),f=Array.isArray(i),d=Array.isArray(a),m=f&&i!==r.xaxes&&d&&a!==r.yaxes;h?(o=r.subplots.length,p=r.subplots[0].length):(d&&(o=a.length),f&&(p=i.length));var g=s.newContainer(e,"grid"),y=k("rows",o),v=k("columns",p);if(y*v>1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);g._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,y,b)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n<m;n++){var b=l[n]=new Array(g),w=_[n]||[];for(i=0;i<g;i++)if(y?(s=1===x?"xy":"x"+x+"y"+x,x++):s=w[i],b[i]="",-1!==f.cartesian.indexOf(s)){if(c=s.indexOf("y"),a=s.slice(0,c),o=s.slice(c),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;b[i]=s,v[a]=i,v[o]=n}}}else{var T=u(e,h,"x"),k=u(e,h,"y");r.xaxes=p(T,f.xaxis,g,v,"x"),r.yaxes=p(k,f.yaxis,m,v,"y")}var A=r._anchors={},M="top to bottom"===r.roworder;for(var S in v){var C,L,E,I=S.charAt(0),z=r[I+"side"];if(z.length<8)A[S]="free";else if("x"===I){if("t"===z.charAt(0)===M?(C=0,L=1,E=m):(C=m-1,L=-1,E=-1),d){var P=v[S];for(n=C;n!==E;n+=L)if((s=l[n][P])&&(c=s.indexOf("y"),s.slice(0,c)===S)){A[S]=s.slice(c);break}}else for(n=C;n!==E;n+=L)if(o=r.yaxes[n],-1!==f.cartesian.indexOf(S+o)){A[S]=o;break}}else if("l"===z.charAt(0)?(C=0,L=1,E=g):(C=g-1,L=-1,E=-1),d){var D=v[S];for(n=C;n!==E;n+=L)if((s=l[D][n])&&(c=s.indexOf("y"),s.slice(c)===S)){A[S]=s.slice(0,c);break}}else for(n=C;n!==E;n+=L)if(a=r.xaxes[n],-1!==f.cartesian.indexOf(a+S)){A[S]=a;break}}}}}},{"../../lib":212,"../../lib/regex":228,"../../plot_api/plot_template":247,"../../plots/cartesian/constants":264,"../../plots/domain":285}],128:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants"),i=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":186,"../../plot_api/plot_template":247,"../../plots/cartesian/constants":264}],129:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,p=e._id.charAt(0),h=0;h<c.length;h++)if(u="images["+h+"].",(l=c[h])[p+"ref"]===e._id){var f=l[p],d=l["size"+p],m=null,g=null;if(o){m=i(f,e.range);var y=d/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,f))*(Math.pow(10,d/2)-Math.pow(10,-d/2));n(m)?n(g)||(g=null):(m=null,g=null),a(u+p,m),a(u+"size"+p,g)}}},{"../../lib/to_log_range":236,"fast-isnumeric":18}],130:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./attributes");function s(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}var s=a("source");if(!a("visible",!!s))return e;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var l={_fullLayout:r},u=["x","y"],c=0;c<2;c++){var p=u[c],h=i.coerceRef(t,e,l,p,"paper",void 0);if("paper"!==h)i.getFromId(l,h)._imgIndices.push(e._index);i.coercePosition(e,l,a,h,p,0)}return e}e.exports=function(t,e){a(t,e,{name:"images",handleItemDefaults:s})}},{"../../lib":212,"../../plots/array_container_defaults":253,"../../plots/cartesian/axes":258,"./attributes":128}],131:[function(t,e,r){"use strict";var n=t("d3"),i=t("../drawing"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/axis_ids"),s=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,l=t._fullLayout,u=[],c={},p=[];for(r=0;r<l.images.length;r++){var h=l.images[r];if(h.visible)if("below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref){e=o.ref2id(h.xref)+o.ref2id(h.yref);var f=l._plots[e];if(!f){p.push(h);continue}f.mainplot&&(e=f.mainplot.id),c[e]||(c[e]=[]),c[e].push(h)}else"above"===h.layer?u.push(h):p.push(h)}var d={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(e){var r=n.select(this);if(this._imgSrc!==e.source)if(r.attr("xmlns",s.svg),e.source&&"data:"===e.source.slice(0,5))r.attr("xlink:href",e.source),this._imgSrc=e.source;else{var i=new Promise(function(t){var n=new Image;function i(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=i,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",i),n.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(i)}}function y(e){var r,o,s=n.select(this),u=a.getFromId(t,e.xref),c=a.getFromId(t,e.yref),p="domain"===a.getRefType(e.xref),h="domain"===a.getRefType(e.yref),f=l._size;r=void 0!==u?"string"==typeof e.xref&&p?u._length*e.sizex:Math.abs(u.l2p(e.sizex)-u.l2p(0)):e.sizex*f.w,o=void 0!==c?"string"==typeof e.yref&&h?c._length*e.sizey:Math.abs(c.l2p(e.sizey)-c.l2p(0)):e.sizey*f.h;var g,y,v=r*d[e.xanchor].offset,_=o*m[e.yanchor].offset,x=d[e.xanchor].sizing+m[e.yanchor].sizing;switch(g=void 0!==u?"string"==typeof e.xref&&p?u._length*e.x+u._offset:u.r2p(e.x)+u._offset:e.x*f.w+f.l,g+=v,y=void 0!==c?"string"==typeof e.yref&&h?c._length*(1-e.y)+c._offset:c.r2p(e.y)+c._offset:f.h-e.y*f.h+f.t,y+=_,e.sizing){case"fill":x+=" slice";break;case"stretch":x="none"}s.attr({x:g,y:y,width:r,height:o,preserveAspectRatio:x,opacity:e.opacity});var b=(u&&"domain"!==a.getRefType(e.xref)?u._id:"")+(c&&"domain"!==a.getRefType(e.yref)?c._id:"");i.setClipUrl(s,b?"clip"+l._uid+b:null,t)}var v=l._imageLowerLayer.selectAll("image").data(p),_=l._imageUpperLayer.selectAll("image").data(u);v.enter().append("image"),_.enter().append("image"),v.exit().remove(),_.exit().remove(),v.each((function(t){g.bind(this)(t),y.bind(this)(t)})),_.each((function(t){g.bind(this)(t),y.bind(this)(t)}));var x=Object.keys(l._plots);for(r=0;r<x.length;r++){e=x[r];var b=l._plots[e];if(b.imagelayer){var w=b.imagelayer.selectAll("image").data(c[e]||[]);w.enter().append("image"),w.exit().remove(),w.each((function(t){g.bind(this)(t),y.bind(this)(t)}))}}}},{"../../constants/xmlns_namespaces":190,"../../plots/cartesian/axes":258,"../../plots/cartesian/axis_ids":261,"../drawing":105,d3:16}],132:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":270,"./attributes":128,"./convert_coords":129,"./defaults":130,"./draw":131}],133:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},x:{valType:"number",min:-2,max:3,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":286,"../color/attributes":82}],134:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}},{}],135:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plot_api/plot_template"),o=t("./attributes"),s=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var u=t.legend||{},c=0,p=!1,h="normal",f=0;f<r.length;f++){var d=r[f];d.visible&&((d.showlegend||d._dfltShowLegend&&!(d._module&&d._module.attributes&&d._module.attributes.showlegend&&!1===d._module.attributes.showlegend.dflt))&&(c++,d.showlegend&&(p=!0,(n.traceIs(d,"pie-like")||!0===d._input.showlegend)&&c++)),(n.traceIs(d,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(d.fill))&&(h=l.isGrouped({traceorder:h})?"grouped+reversed":"reversed"),void 0!==d.legendgroup&&""!==d.legendgroup&&(h=l.isReversed({traceorder:h})?"reversed+grouped":"grouped"))}var m=i.coerce(t,e,s,"showlegend",p&&c>1);if(!1!==m||u.uirevision){var g=a.newContainer(e,"legend");if(b("uirevision",e.uirevision),!1!==m){b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),i.coerceFont(b,"font",e.font);var y,v,_,x=b("orientation");"h"===x?(y=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(y=1.02,v=1,_="auto"),b("traceorder",h),l.isGrouped(e.legend)&&b("tracegroupgap"),b("itemsizing"),b("itemwidth"),b("itemclick"),b("itemdoubleclick"),b("x",y),b("xanchor"),b("y",v),b("yanchor",_),b("valign"),i.noneOrAll(u,g,["x","y"]),b("title.text")&&(b("title.side","h"===x?"left":"top"),i.coerceFont(b,"title.font",e.font))}}function b(t,e){return i.coerce(u,g,o,t,e)}}},{"../../lib":212,"../../plot_api/plot_template":247,"../../plots/layout_attributes":290,"../../registry":308,"./attributes":133,"./helpers":139}],136:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e,r){var n,a=t.data()[0][0],s=a.trace,l=o.traceIs(s,"pie-like"),c=s.index,h=r._main&&e._context.edits.legendText&&!l,d=r._maxNameLength;r.entries?n=a.text:(n=l?a.label:s.name,s._meta&&(n=i.templateString(n,s._meta)));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(u.font,r.font).text(h?T(n,d):n);var g=r.itemwidth+2*f.itemGap;p.positionText(m,g,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(T(n,d)).call(A,t,e,r);var s=a.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),p=u[u.length-1],h=i.keyedContainer(s,"transforms["+p+"].styles","target","value.name");h.set(a.trace._group,n),l=h.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):A(m,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTime<a?o+=1:(o=1,e._legendMouseDownTime=r)})),s.on("mouseup",(function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>a&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}})))}function A(t,e,r,n){n._main||t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),a=i.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*m;if(a){var h=u.bBox(a);o=h.height,s=h.width,n?u.setTranslate(i,0,.25*o):u.setTranslate(i,l,.75*o+l)}else{var d=t.select(n?".legendtext":".legendtitletext"),g=p.lineCount(d),y=d.node();o=c*g,s=y?u.bBox(y).width:0;var v=c*((g-1)/2-.3);if(n){var _=r.itemwidth+2*f.itemGap;p.positionText(d,_,-v)}else p.positionText(d,f.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,p="legend"+s._uid;if(e?(r=e.layer,p+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var h;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;h=s.showlegend&&v(t.calcdata,e)}else{if(!e.entries)return;h=v(e.entries,e)}var d=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!h.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+p).remove(),a.autoMargin(t,"legend");var m=i.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),T=i.ensureSingleById(s._topdefs,"clipPath",p,(function(t){t.append("rect")})),C=i.ensureSingle(m,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var L=i.ensureSingle(m,"g","scrollbox"),E=e.title;if(e._titleWidth=0,e._titleHeight=0,E.text){var I=i.ensureSingle(L,"text","legendtitletext");I.attr("text-anchor","start").call(u.font,E.font).text(E.text),A(I,L,t,e)}else L.selectAll(".legendtitletext").remove();var z=i.ensureSingle(m,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),P=L.selectAll("g.groups").data(h);P.enter().append("g").attr("class","groups"),P.exit().remove();var D=P.selectAll("g.traces").data(i.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==d.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(_,t,e).each((function(){e._main&&n.select(this).call(k,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),c=i.borderwidth,p=2*c,h=f.itemGap,d=i.itemwidth+2*h,m=2*(c+h),g=S(i),y=i.y<0||0===i.y&&"top"===g,v=i.y>1||1===i.y&&"bottom"===g;i._maxHeight=Math.max(y||v?a.height/2:o.h,30);var _=0;i._width=0,i._height=0;var b=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+b[0],c+b[1]+i._height+e/2+h),i._height+=e,i._width=Math.max(i._width,t[0].width)})),_=d+i._width,i._width+=h+d+p,i._height+=m,l&&(e.each((function(t,e){u.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var w=M(i),T=i.x<0||0===i.x&&"right"===w,k=i.x>1||1===i.x&&"left"===w,A=v||y,C=a.width/2;i._maxWidth=Math.max(T?A&&"left"===w?o.l+o.w:C:k?A&&"right"===w?o.r+o.w:C:o.w,2*d);var L=0,E=0;r.each((function(t){var e=t[0].width+d;L=Math.max(L,e),E+=e})),_=null;var I=0;if(l){var z=0,P=0,D=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,b[0],b[1]+c+h+n/2+e),e+=n,t=Math.max(t,d+r[0].width)})),z=Math.max(z,e);var r=t+h;r+c+P>i._maxWidth&&(I=Math.max(I,P),P=0,D+=z+i.tracegroupgap,z=e),u.setTranslate(this,P,D),P+=r})),i._width=Math.max(I,P)+c,i._height=D+z+m}else{var O=r.size(),R=E+p+(O-1)*h<i._maxWidth,F=0,B=0,N=0,U=0;r.each((function(t){var e=t[0].height,r=d+t[0].width,n=(R?r:L)+h;n+c+B-h>=i._maxWidth&&(I=Math.max(I,U),B=0,N+=F,i._height+=F,F=0),u.setTranslate(this,b[0]+c+B,b[1]+c+N+e/2+h),U=B+r+h,B+=n,F=Math.max(F,e)})),R?(i._width=B+p,i._height=F+m):(i._width=Math.max(I,U)+p,i._height+=F+m)}}i._width=Math.ceil(Math.max(i._width+b[0],i._titleWidth+2*(c+f.titlePad))),i._height=Math.ceil(Math.max(i._height+b[1],i._titleHeight+2*(c+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var j=t._context.edits,V=j.legendText||j.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?d:_||d+t[0].width;s||(i+=h/2),u.setRect(e,0,-r/2,i,r)}))}(t,P,D,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*y[r],b:e._effHeight*y[n],t:e._effHeight*g[n]})}(t)){var c,h,d,v,_=s._size,x=e.borderwidth,w=_.l+_.w*e.x-g[M(e)]*e._width,k=_.t+_.h*(1-e.y)-g[S(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var A=w,E=k;w=i.constrain(w,0,s.width-e._width),k=i.constrain(k,0,s.height-e._effHeight),w!==A&&i.log("Constrain legend.x to make legend fit inside graph"),k!==E&&i.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(m,w,k),z.on(".drag",null),m.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;e._main||(I=e._height),C.attr({width:e._width-x,height:I-x,x:x/2,y:x/2}),u.setTranslate(L,0,0),T.select("rect").attr({width:e._width-2*x,height:I-2*x,x:x,y:x}),u.setClipUrl(L,p,t),u.setRect(z,0,0,0,0),delete e._scrollY}else{var P,D,O,R=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-R-2*f.scrollBarMargin,B=e._height-e._effHeight,N=F/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),T.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(L,p,t),q(U,R,N),m.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/F*B,0,B),R,N),0!==U&&U!==B&&n.event.preventDefault()}));var j=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;P="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,O=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));z.call(j);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(P=t.changedTouches[0].clientY,O=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/N+t;return i.constrain(n,0,B)}(O,P,D),R,N))}));L.call(V)}if(t._context.edits.legendPosition)m.classed("cursor-move",!0),l.init({element:m.node(),gd:t,prepFn:function(){var t=u.getTranslate(m);d=t.x,v=t.y},moveFn:function(t,r){var n=d+t,i=v+r;u.setTranslate(m,n,i),c=l.align(n,0,_.l,_.l+_.w,e.xanchor),h=l.align(i,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==h&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":h})},clickFn:function(e,n){var i=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));i.size()>0&&b(t,m,i,e,n)}})}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(L,0,-r),u.setRect(z,e._width,f.scrollBarMargin+r*i,f.scrollBarWidth,n),T.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":185,"../../lib":212,"../../lib/events":203,"../../lib/svg_text_utils":234,"../../plots/plots":299,"../../registry":308,"../color":83,"../dragelement":102,"../drawing":105,"./constants":134,"./get_legend_data":137,"./handle_click":138,"./helpers":139,"./style":141,d3:16}],137:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,p=0,h=e._main;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r<t.length;r++){var d=t[r],m=d[0],g=m.trace,y=g.legendgroup;if(!h||g.visible&&g.showlegend)if(n.traceIs(g,"pie-like"))for(u[y]||(u[y]={}),a=0;a<d.length;a++){var v=d[a].label;u[y][v]||(f(y,{label:v,color:d[a].color,i:d[a].i,trace:g,pts:d[a].pts}),u[y][v]=!0,p=Math.max(p,(v||"").length))}else f(y,m),p=Math.max(p,(g.name||"").length)}if(!s.length)return[];var _,x,b=s.length;if(l&&i.isGrouped(e))for(x=new Array(b),r=0;r<b;r++)_=o[s[r]],x[r]=i.isReversed(e)?_.reverse():_;else{for(x=[new Array(b)],r=0;r<b;r++)_=o[s[r]][0],x[0][i.isReversed(e)?b-r-1:r]=_;b=1}return e._lgroupsLength=b,e._maxNameLength=p,x}},{"../../registry":308,"./helpers":139}],138:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=!0;e.exports=function(t,e,r){var o=e._fullLayout;if(!e._dragged&&!e._editing){var s,l=o.legend.itemclick,u=o.legend.itemdoubleclick;if(1===r&&"toggle"===l&&"toggleothers"===u&&a&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),a=!1):a=!1,1===r?s=l:2===r&&(s=u),s){var c,p,h,f,d,m=o.hiddenlabels?o.hiddenlabels.slice():[],g=t.data()[0][0],y=e._fullData,v=g.trace,_=v.legendgroup,x={},b=[],w=[],T=[];if(i.traceIs(v,"pie-like")){var k=g.label,A=m.indexOf(k);"toggle"===s?-1===A?m.push(k):m.splice(A,1):"toggleothers"===s&&(m=[],e.calcdata[0].forEach((function(t){k!==t.label&&m.push(t.label)})),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===m.length&&-1===A&&(m=[])),i.call("_guiRelayout",e,"hiddenlabels",m)}else{var M,S=_&&_.length,C=[];if(S)for(c=0;c<y.length;c++)(M=y[c]).visible&&M.legendgroup===_&&C.push(c);if("toggle"===s){var L;switch(v.visible){case!0:L="legendonly";break;case!1:L=!1;break;case"legendonly":L=!0}if(S)for(c=0;c<y.length;c++)!1!==y[c].visible&&y[c].legendgroup===_&&B(y[c],L);else B(v,L)}else if("toggleothers"===s){var E,I,z,P,D=!0;for(c=0;c<y.length;c++)if(E=y[c]===v,z=!0!==y[c].showlegend,!(E||z||(I=S&&y[c].legendgroup===_)||!0!==y[c].visible||i.traceIs(y[c],"notLegendIsolatable"))){D=!1;break}for(c=0;c<y.length;c++)if(!1!==y[c].visible&&!i.traceIs(y[c],"notLegendIsolatable"))switch(v.visible){case"legendonly":B(y[c],!0);break;case!0:P=!!D||"legendonly",E=y[c]===v,z=!0!==y[c].showlegend&&!y[c].legendgroup,I=E||S&&y[c].legendgroup===_,B(y[c],!(!I&&!z)||P)}}for(c=0;c<w.length;c++)if(h=w[c]){var O=h.constructUpdate(),R=Object.keys(O);for(p=0;p<R.length;p++)f=R[p],(x[f]=x[f]||[])[T[c]]=O[f]}for(d=Object.keys(x),c=0;c<d.length;c++)for(f=d[c],p=0;p<b.length;p++)x[f].hasOwnProperty(p)||(x[f][p]=void 0);i.call("_guiRestyle",e,x,b)}}}function F(t,e,r){var n=b.indexOf(t),i=x[e];return i||(i=x[e]=[]),-1===b.indexOf(t)&&(b.push(t),n=b.length-1),i[n]=r,n}function B(t,e){var r=t._fullInput;if(i.hasTransform(r,"groupby")){var a=w[r.index];if(!a){var o=i.getTransformIndices(r,"groupby"),s=o[o.length-1];a=n.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),w[r.index]=a}var l=a.get(t._group);void 0===l&&(l=!0),!1!==l&&a.set(t._group,e),T[r.index]=F(r.index,"visible",!1!==r.visible)}else{var u=!1!==r.visible&&e;F(r.index,"visible",u)}}}},{"../../lib":212,"../../registry":308}],139:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],140:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":133,"./defaults":135,"./draw":136,"./style":141}],141:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.strTranslate,s=t("../drawing"),l=t("../color"),u=t("../colorscale/helpers").extractOpts,c=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one"),h=t("../../traces/pie/helpers").castOption,f=t("./constants");function d(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var g="constant"===r.itemsizing,y=r.itemwidth,v=(y+2*f.itemGap)/2,_=o(v,0),x=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return g?n:Math.min(i,r)};function b(t,e,r){var a=t[0].trace,o=a.marker||{},s=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],i=x(r.mlw,o.line,5,2);e.style("stroke-width",i+"px").call(l.fill,r.mc||o.color),i&&l.stroke(e,r.mlc||s.color)}))}function w(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var c=(s.marker||{}).line,f=x(h(c.width,o.pts),c,5,2),d=a.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=c.color;var m=a.minExtend(o,{trace:d});p(u,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));i.attr("transform",o(0,c))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=i.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,o=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,p=n.select(this),h=u(i),f=h.colorscale,m=h.reversescale;if(f){if(!r){var g=f.length;c=0===o?f[m?g-1:0][1]:1===o?f[m?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}p.attr("d",t[0]),c?p.call(l.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),f,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,b(t,this,"waterfall")}var a=[];e.visible&&r&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=x(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){b(t,this,"funnel")})).each((function(t){b(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=x(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:g?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){w(t,this,"funnelarea")})).each((function(t){w(t,this,"pie")})).each((function(t){var r,i,o=t[0],l=o.trace,p=l.visible&&l.fill&&"none"!==l.fill,h=c.hasLines(l),f=l.contours,m=!1,g=!1,v=u(l),_=v.colorscale,b=v.reversescale;if(f){var w=f.coloring;"lines"===w?m=!0:h="none"===w||"heatmap"===w||f.showlines,"constraint"===f.type?p="="!==f._operation:"fill"!==w&&"heatmap"!==w||(g=!0)}var T=c.hasMarkers(l)||c.hasText(l),k=p||g,A=h||m,M=T||!k?"M5,0":A?"M5,-2":"M5,-3",S=n.select(this),C=S.select(".legendfill").selectAll("path").data(p||g?[t]:[]);if(C.enter().append("path").classed("js-fill",!0),C.exit().remove(),C.attr("d",M+"h"+y+"v6h-"+y+"z").call(p?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+l.uid;s.gradient(t,e,r,d(b),_,"fill")}}),h||m){var L=x(void 0,l.line,10,5);i=a.minExtend(l,{line:{width:L}}),r=[a.minExtend(o,{trace:i})]}var E=S.select(".legendlines").selectAll("path").data(h||m?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",M+(m?"l"+y+",0.0001":"h"+y)).call(h?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+l.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(b),_,"stroke")}})})).each((function(t){var r,i,o=t[0],l=o.trace,u=c.hasMarkers(l),p=c.hasText(l),h=c.hasLines(l);function f(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(g&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function d(t){return o._distinct&&o.index&&t[o.index]?t[o.index]:t[0]}if(u||p||h){var m={},y={};if(u){m.mc=f("marker.color",d),m.mx=f("marker.symbol",d),m.mo=f("marker.opacity",a.mean,[.2,1]),m.mlc=f("marker.line.color",d),m.mlw=f("marker.line.width",a.mean,[0,5],2),y.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var v=f("marker.size",a.mean,[2,16],12);m.ms=v,y.marker.size=v}h&&(y.line={width:f("line.width",d,[0,10],5)}),p&&(m.tx="Aa",m.tp=f("textposition",d),m.ts=10,m.tc=f("textfont.color",d),m.tf=f("textfont.family",d)),r=[a.minExtend(o,m)],(i=a.minExtend(l,y)).selectedpoints=null,i.texttemplate=null}var x=n.select(this).select("g.legendpoints"),b=x.selectAll("path.scatterpts").data(u?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),b.exit().remove(),b.call(s.pointStyle,i,e),u&&(r[0].mrc=3);var w=x.selectAll("g.pointtext").data(p?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),w.exit().remove(),w.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=x(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=x(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":212,"../../registry":308,"../../traces/pie/helpers":336,"../../traces/pie/style_one":337,"../../traces/scatter/subtypes":364,"../color":83,"../colorscale/helpers":94,"../drawing":105,"./constants":134,d3:16}],142:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i<p.length;i++)if(!(r=p[i]).fixedrange)if(f=r._name,"auto"===l)c[f+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)c[f+".autorange"]=!0;else{var y=r._rangeInitial.slice();c[f+".range[0]"]=y[0],c[f+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(c[f+".showspikes"]=r._showSpikeInitial,"on"!==h||r._showSpikeInitial||(h="off"))}else{var v=[r.r2l(r.range[0]),r.r2l(r.range[1])],_=[m*v[0]+g*v[1],m*v[1]+g*v[0]];c[f+".range[0]"]=r.l2r(_[0]),c[f+".range[1]"]=r.l2r(_[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=u._isHoriz?"y":"x",o.setAttribute("data-val",l)),c[s]=l;u._cartesianSpikesEnabled=h,n.call("_guiRelayout",t,c)}function h(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],s={},l=i.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=a;var c="pan"===a?a:"zoom";s.dragmode=c,n.call("_guiRelayout",t,s)}function f(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),i="resetLastSave"===r,a="resetDefault"===r,o=t._fullLayout,s=o._subplots.gl3d||[],l={},u=0;u<s.length;u++){var c,p=s[u],h=p+".camera",f=p+".aspectratio",d=p+".aspectmode",m=o[p]._scene;i?(l[h+".up"]=m.viewInitial.up,l[h+".eye"]=m.viewInitial.eye,l[h+".center"]=m.viewInitial.center,c=!0):a&&(l[h+".up"]=null,l[h+".eye"]=null,l[h+".center"]=null,c=!0),c&&(l[f+".x"]=m.viewInitial.aspectratio.x,l[f+".y"]=m.viewInitial.aspectratio.y,l[f+".z"]=m.viewInitial.aspectratio.z,l[d]=m.viewInitial.aspectmode)}n.call("_guiRelayout",t,l)}function d(t,e){var r=e.currentTarget,n=r._previousVal,i=t._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var u=0;u<a.length;u++){var c=a[u],p=i[c],h=c+".hovermode";s[h]=p.hovermode,l[h]=!1;for(var f=0;f<3;f++){var d=o[f],m=c+"."+d+".showspikes";l[m]=!1,s[m]=p[d].showspikes}}r._previousVal=s}return l}function m(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var u=s[l],c=o[u];if("zoom"===i){var p=c.projection.scale,h="in"===a?2*p:.5*p;n.call("_guiRelayout",t,u+".projection.scale",h)}}"reset"===i&&_(t,"geo")}function g(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function y(t){var e=g(t);n.call("_guiRelayout",t,"hovermode",e)}function v(t,e){for(var r=e.currentTarget.getAttribute("data-val"),i=t._fullLayout,a=i._subplots.mapbox||[],o={},s=0;s<a.length;s++){var l=a[s],u=i[l].zoom,c="in"===r?1.05*u:u/1.05;o[l+".zoom"]=c}n.call("_guiRelayout",t,o)}function _(t,e){for(var r=t._fullLayout,i=r._subplots[e]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=r[s]._subplot.viewInitial,u=Object.keys(l),c=0;c<u.length;c++){var p=u[c];a[s+"."+p]=l[p]}n.call("_guiRelayout",t,a)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return u(t,"png"===e?"Download plot as a png":"Download plot")},icon:o.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};l.notifier(u(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&l.isIE()&&(l.notifier(u(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(t){t in e&&(r[t]=e[t])})),n.call("downloadImage",t,r).then((function(e){l.notifier(u(t,"Snapshot succeeded")+" - "+e,"long")})).catch((function(){l.notifier(u(t,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return u(t,"Edit in Chart Studio")},icon:o.disk,click:function(t){i.sendDataToCloud(t)}},c.editInChartStudio={name:"editInChartStudio",title:function(t){return u(t,"Edit in Chart Studio")},icon:o.pencil,click:function(t){i.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",title:function(t){return u(t,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:p},c.pan2d={name:"pan2d",title:function(t){return u(t,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:p},c.select2d={name:"select2d",title:function(t){return u(t,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:p},c.lasso2d={name:"lasso2d",title:function(t){return u(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:p},c.drawclosedpath={name:"drawclosedpath",title:function(t){return u(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:p},c.drawopenpath={name:"drawopenpath",title:function(t){return u(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:p},c.drawline={name:"drawline",title:function(t){return u(t,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:p},c.drawrect={name:"drawrect",title:function(t){return u(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:p},c.drawcircle={name:"drawcircle",title:function(t){return u(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:p},c.eraseshape={name:"eraseshape",title:function(t){return u(t,"Erase active shape")},icon:o.eraseshape,click:s},c.zoomIn2d={name:"zoomIn2d",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:p},c.zoomOut2d={name:"zoomOut2d",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:p},c.autoScale2d={name:"autoScale2d",title:function(t){return u(t,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:p},c.resetScale2d={name:"resetScale2d",title:function(t){return u(t,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:p},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return u(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:p},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return u(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:p},c.zoom3d={name:"zoom3d",title:function(t){return u(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:h},c.pan3d={name:"pan3d",title:function(t){return u(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:h},c.orbitRotation={name:"orbitRotation",title:function(t){return u(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:h},c.tableRotation={name:"tableRotation",title:function(t){return u(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:h},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return u(t,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:f},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return u(t,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:f},c.hoverClosest3d={name:"hoverClosest3d",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=d(t,e);n.call("_guiRelayout",t,r)}},c.zoomInGeo={name:"zoomInGeo",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:m},c.zoomOutGeo={name:"zoomOutGeo",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:m},c.resetGeo={name:"resetGeo",title:function(t){return u(t,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:m},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:y},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:y},c.hoverClosestPie={name:"hoverClosestPie",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:y},c.resetViewSankey={name:"resetSankeyGroup",title:function(t){return u(t,"Reset view")},icon:o.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var i=t._fullData[r]._viewInitial;e["node.groups"].push(i.node.groups.slice()),e["node.x"].push(i.node.x.slice()),e["node.y"].push(i.node.y.slice())}n.call("restyle",t,e)}},c.toggleHover={name:"toggleHover",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=d(t,e);r.hovermode=g(t),n.call("_guiRelayout",t,r)}},c.resetViews={name:"resetViews",title:function(t){return u(t,"Reset views")},icon:o.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),p(t,e),r.setAttribute("data-attr","resetLastSave"),f(t,e),_(t,"geo"),_(t,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return u(t,"Toggle Spike Lines")},icon:o.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=a.list(t,null,!0),n={},i=0;i<r.length;i++){var o=r[i];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},c.resetViewMapbox={name:"resetViewMapbox",title:function(t){return u(t,"Reset view")},attr:"reset",icon:o.home,click:function(t){_(t,"mapbox")}},c.zoomInMapbox={name:"zoomInMapbox",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:v},c.zoomOutMapbox={name:"zoomOutMapbox",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:v}},{"../../fonts/ploticon":193,"../../lib":212,"../../plots/cartesian/axis_ids":261,"../../plots/plots":299,"../../registry":308,"../shapes/draw":164}],143:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":144}],144:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),i=t("../../traces/scatter/subtypes"),a=t("../../registry"),o=t("../fx/helpers").isUnifiedHover,s=t("./modebar"),l=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,c=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var p,h=r.modeBarButtons;p=Array.isArray(h)&&h.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===l[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=l[i]}}return t}(h):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,s=t._context,c=s.modeBarButtonsToRemove,p=s.modeBarButtonsToAdd,h=e._has("cartesian"),f=e._has("gl3d"),d=e._has("geo"),m=e._has("pie"),g=e._has("funnelarea"),y=e._has("gl2d"),v=e._has("ternary"),_=e._has("mapbox"),x=e._has("polar"),b=e._has("sankey"),w=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(e),T=o(e.hovermode),k=[];function A(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===c.indexOf(n)&&e.push(l[n])}k.push(e)}}var M=["toImage"];s.showEditInChartStudio?M.push("editInChartStudio"):s.showSendToCloud&&M.push("sendDataToCloud");A(M);var S=[],C=[],L=[],E=[];(h||y||m||g||v)+d+f+_+x>1?(C=["toggleHover"],L=["resetViews"]):d?(S=["zoomInGeo","zoomOutGeo"],C=["hoverClosestGeo"],L=["resetGeo"]):f?(C=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(S=["zoomInMapbox","zoomOutMapbox"],C=["toggleHover"],L=["resetViewMapbox"]):y?C=["hoverClosestGl2d"]:m?C=["hoverClosestPie"]:b?(C=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):C=["toggleHover"];h&&(C=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e<t.length;e++)if(!a.traceIs(t[e],"noHover"))return!1;return!0}(r)||T)&&(C=[]);!h&&!y||w||(S=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==L[0]&&(L=["resetScale2d"]));f?E=["zoom3d","pan3d","orbitRotation","tableRotation"]:(h||y)&&!w||v?E=["zoom2d","pan2d"]:_||d?E=["pan2d"]:x&&(E=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(a.traceIs(n,"scatter-like")?(i.hasMarkers(n)||i.hasText(n))&&(e=!0):a.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(r)&&E.push("select2d","lasso2d");if(Array.isArray(p)){for(var I=[],z=0;z<p.length;z++){var P=p[z];"string"==typeof P?-1!==u.indexOf(P)&&(e._has("mapbox")||e._has("cartesian"))&&E.push(P):I.push(P)}p=I}return A(E),A(S.concat(L)),A(C),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(k,p)}(t),c?c.update(t,p):e._modeBar=s(t,p)}else c&&(c.destroy(),delete e._modeBar)};var u=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"]},{"../../plots/cartesian/axis_ids":261,"../../registry":308,"../../traces/scatter/subtypes":364,"../fx/helpers":119,"./buttons":142,"./modebar":145}],145:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../fonts/ploticon"),s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,i="modebar-"+n._uid;this.element.setAttribute("id",i),this._uid=i,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";a.deleteRelatedStyleRule(i),a.addRelatedStyleRule(i,s+"#"+i+" .modebar-group","background-color: "+o.bgcolor),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn .icon path","fill: "+o.color),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn:hover .icon path","fill: "+o.activecolor),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn.active .icon path","fill: "+o.activecolor);var l=!this.hasButtons(e),u=this.hasLogo!==r.displaylogo,c=this.locale!==r.locale;if(this.locale=r.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var p=this.getLogo();r.watermark&&(p.className=p.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(p,this.element.childNodes[0]):this.element.appendChild(p),this.hasLogo=!0}this.updateActiveButton()},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)})),e.element.appendChild(r)}))},u.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},u.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&r.setAttribute("data-title",i),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var s=t.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},u.createIcon=function(t){var e,r=i(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var a=document.createElementNS(n,"path");a.setAttribute("d",t.path),t.transform?a.setAttribute("transform",t.transform):void 0!==t.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(a)}t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var i=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)o===r&&l.classed("active",!l.classed("active"));else{var u=null===o?o:a.nestedProperty(e,o).get();l.classed("active",u===i)}}))},u.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},u.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",a._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},u.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},u.destroy=function(){a.removeElement(this.container.querySelector(".modebar")),a.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,i=new l({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&n.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}},{"../../fonts/ploticon":193,"../../lib":212,d3:16,"fast-isnumeric":18}],146:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:a,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:i.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":247,"../../plots/font_attributes":286,"../color/attributes":82}],147:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],148:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants");function u(t,e,r,i){var a=i.calendar;function o(r,i){return n.coerce(t,e,s.buttons,r,i)}if(o("visible")){var l=o("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,c,p){var h=t.rangeselector||{},f=a.newContainer(e,"rangeselector");function d(t,e){return n.coerce(h,f,s,t,e)}if(d("visible",o(h,f,{name:"buttons",handleItemDefaults:u,calendar:p}).length>0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+l.yPad]}(e,r,c);d("x",m[0]),d("y",m[1]),n.noneOrAll(t,e,["x","y"]),d("xanchor"),d("yanchor"),n.coerceFont(d,"font",r.font);var g=d("bgcolor");d("activecolor",i.contrast(g,l.lightAmount,l.darkAmount)),d("bordercolor"),d("borderwidth")}}},{"../../lib":212,"../../plot_api/plot_template":247,"../../plots/array_container_defaults":253,"../color":83,"./attributes":146,"./constants":147}],149:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../color"),s=t("../drawing"),l=t("../../lib"),u=l.strTranslate,c=t("../../lib/svg_text_utils"),p=t("../../plots/cartesian/axis_ids"),h=t("../../constants/alignment"),f=h.LINE_SPACING,d=h.FROM_TL,m=h.FROM_BR,g=t("./constants"),y=t("./get_update_object");function v(t){return t._id}function _(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){l.ensureSingle(t,"text","selector-text",(function(t){t.attr("text-anchor","middle")})).call(s.font,e.font).text(function(t,e){if(t.label)return e?l.templateString(t.label,e):t.label;return"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call((function(t){c.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=p.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),v);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each((function(e){var r=n.select(this),o=e,p=o.rangeselector,h=r.selectAll("g.button").data(l.filterVisible(p.buttons));h.enter().append("g").classed("button",!0),h.exit().remove(),h.each((function(e){var r=n.select(this),a=y(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,a),r.call(_,p,e),r.call(x,p,e,t),r.on("click",(function(){t._dragged||i.call("_guiRelayout",t,a)})),r.on("mouseover",(function(){e._isHovered=!0,r.call(_,p,e)})),r.on("mouseout",(function(){e._isHovered=!1,r.call(_,p,e)}))})),function(t,e,r,i,o){var p=0,h=0,y=r.borderwidth;e.each((function(){var t=n.select(this).select(".selector-text"),e=r.font.size*f,i=Math.max(e*c.lineCount(t),16)+3;h=Math.max(h,i)})),e.each((function(){var t=n.select(this),e=t.select(".selector-rect"),i=t.select(".selector-text"),a=i.node()&&s.bBox(i.node()).width,o=r.font.size*f,l=c.lineCount(i),d=Math.max(a+10,g.minButtonWidth);t.attr("transform",u(y+p,y)),e.attr({x:0,y:0,width:d,height:h}),c.positionText(i,d/2,h/2-(l-1)*o/2+3),p+=d+5}));var v=t._fullLayout._size,_=v.l+v.w*r.x,x=v.t+v.h*(1-r.y),b="left";l.isRightAnchor(r)&&(_-=p,b="right");l.isCenterAnchor(r)&&(_-=p/2,b="center");var w="top";l.isBottomAnchor(r)&&(x-=h,w="bottom");l.isMiddleAnchor(r)&&(x-=h/2,w="middle");p=Math.ceil(p),h=Math.ceil(h),_=Math.round(_),x=Math.round(x),a.autoMargin(t,i+"-range-selector",{x:r.x,y:r.y,l:p*d[b],r:p*m[b],b:h*m[w],t:h*d[w]}),o.attr("transform",u(_,x))}(t,h,p,o._name,r)}))}},{"../../constants/alignment":185,"../../lib":212,"../../lib/svg_text_utils":234,"../../plots/cartesian/axis_ids":261,"../../plots/plots":299,"../../registry":308,"../color":83,"../drawing":105,"./constants":147,"./get_update_object":150,d3:16}],150:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=function(t,e){var r,i=t.range,a=new Date(t.r2l(i[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(a,-s));break;case"todate":var l=n.time[o].utc.offset(a,-s);r=t.l2r(+n.time[o].utc.ceil(l))}var u=i[1];return[r,u]}(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:16}],151:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":146,"./defaults":148,"./draw":149}],152:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":82}],153:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,i=t("../../plots/cartesian/autorange").getAutoRange,a=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],s=o[a.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=i(t,o))}}},{"../../plots/cartesian/autorange":257,"../../plots/cartesian/axis_ids":261,"./constants":154}],154:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],155:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),s=t("./oppaxis_attributes");e.exports=function(t,e,r){var l=t[r],u=e[r];if(l.rangeslider||e._requestRangeslider[u._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var c,p,h=l.rangeslider,f=i.newContainer(u,"rangeslider");if(b("visible")){b("bgcolor",e.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!u.isValidRange(h.range)),b("range");var d=e._subplots;if(d)for(var m=d.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===a.name2id(r)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),g=n.simpleMap(m,a.id2name),y=0;y<g.length;y++){var v=g[y];c=h[v]||{},p=i.newContainer(f,v,"yaxis");var _,x=e[v];c.range&&x.isValidRange(c.range)&&(_="fixed"),"match"!==w("rangemode",_)&&w("range",x.range.slice())}f._input=h}}function b(t,e){return n.coerce(h,f,o,t,e)}function w(t,e){return n.coerce(c,p,s,t,e)}}},{"../../lib":212,"../../plot_api/plot_template":247,"../../plots/cartesian/axis_ids":261,"./attributes":152,"./oppaxis_attributes":159}],156:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../../lib"),s=o.strTranslate,l=t("../drawing"),u=t("../color"),c=t("../titles"),p=t("../../plots/cartesian"),h=t("../../plots/cartesian/axis_ids"),f=t("../dragelement"),d=t("../../lib/setcursor"),m=t("./constants");function g(t,e,r,n){var i=o.ensureSingle(t,"rect",m.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,c=l.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:s(u,u),fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function y(t,e,r,n){var i=e._fullLayout;o.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function v(t,e,r,i){var s,u=e.calcdata,c=t.selectAll("g."+m.rangePlotClassName).data(r._subplotsWith,o.identity);c.enter().append("g").attr("class",(function(t){return m.rangePlotClassName+" "+t})).call(l.setClipUrl,i._clipId,e),c.order(),c.exit().remove(),c.each((function(t,o){var l=n.select(this),c=0===o,f=h.getFromId(e,t,"y"),d=f._name,m=i[d],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[d]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},f.rangebreaks&&(g.layout[d].rangebreaks=f.rangebreaks),a.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var _={id:t,plotgroup:l,xaxis:y,yaxis:v,isRangePlot:!0};c?s=_:(_.mainplot="xy",_.mainplotinfo=s),p.rangePlot(e,_,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(u,t))}))}function _(t,e,r,n,i){(o.ensureSingle(t,"rect",m.maskMinClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(u.fill,m.maskColor),o.ensureSingle(t,"rect",m.maskMaxClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(u.fill,m.maskColor),"match"!==i.rangemode)&&(o.ensureSingle(t,"rect",m.maskMinOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(u.fill,m.maskOppAxisColor),o.ensureSingle(t,"rect",m.maskMaxOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",m.maskOppBorder).call(u.fill,m.maskOppAxisColor))}function x(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",m.slideBoxClassName,(function(t){t.attr({y:0,cursor:m.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:m.slideBoxFill})}function b(t,e,r,n){var i=o.ensureSingle(t,"g",m.grabberMinClassName),a=o.ensureSingle(t,"g",m.grabberMaxClassName),s={x:0,width:m.handleWidth,rx:m.handleRadius,fill:u.background,stroke:u.defaultLine,"stroke-width":m.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)};o.ensureSingle(i,"rect",m.handleMinClassName,(function(t){t.attr(s)})).attr(l),o.ensureSingle(a,"rect",m.handleMaxClassName,(function(t){t.attr(s)})).attr(l);var c={width:m.grabAreaWidth,x:0,y:0,fill:m.grabAreaFill,cursor:e._context.staticPlot?void 0:m.grabAreaCursor};o.ensureSingle(i,"rect",m.grabAreaMinClassName,(function(t){t.attr(c)})).attr("height",n._height),o.ensureSingle(a,"rect",m.grabAreaMaxClassName,(function(t){t.attr(c)})).attr("height",n._height)}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,a=0;a<r.length;a++){var l=r[a][m.name];l._clipId=l._id+"-"+e._uid}var u=e._infolayer.selectAll("g."+m.containerClassName).data(r,(function(t){return t._name}));u.exit().each((function(t){var r=t[m.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(u.enter().append("g").classed(m.containerClassName,!0).attr("pointer-events","all"),u.each((function(r){var a=n.select(this),l=r[m.name],u=e[h.id2name(r.anchor)],p=l[h.id2name(r.anchor)];if(l.range){var w,T=o.simpleMap(l.range,r.r2l),k=o.simpleMap(r.range,r.r2l);w=k[0]<k[1]?[Math.min(T[0],k[0]),Math.max(T[1],k[1])]:[Math.max(T[0],k[0]),Math.min(T[1],k[1])],l.range=l._input.range=o.simpleMap(w,r.l2r)}r.cleanRange("rangeslider.range");var A=e._size,M=r.domain;l._width=A.w*(M[1]-M[0]);var S=Math.round(A.l+A.w*M[0]),C=Math.round(A.t+A.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+l._offsetShift+m.extraPad);a.attr("transform",s(S,C)),l._rl=o.simpleMap(l.range,r.r2l);var L=l._rl[0],E=l._rl[1],I=E-L;if(l.p2d=function(t){return t/l._width*I+L},l.d2p=function(t){return(t-L)/I*l._width},r.rangebreaks){var z=r.locateBreaks(L,E);if(z.length){var P,D,O=0;for(P=0;P<z.length;P++)O+=(D=z[P]).max-D.min;var R=l._width/(E-L-O),F=[-R*L];for(P=0;P<z.length;P++)D=z[P],F.push(F[F.length-1]-R*(D.max-D.min));for(l.d2p=function(t){for(var e=F[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.max)e=F[r+1];else if(t<n.min)break}return e+R*t},P=0;P<z.length;P++)(D=z[P]).pmin=l.d2p(D.min),D.pmax=l.d2p(D.max);l.p2d=function(t){for(var e=F[0],r=0;r<z.length;r++){var n=z[r];if(t>=n.pmax)e=F[r+1];else if(t<n.pmin)break}return(t-e)/R}}}if("match"!==p.rangemode){var B=u.r2l(p.range[0]),N=u.r2l(p.range[1])-B;l.d2pOppAxis=function(t){return(t-B)/N*l._height}}a.call(g,t,r,l).call(y,t,r,l).call(v,t,r,l).call(_,t,r,l,p).call(x,t,r,l).call(b,t,r,l),function(t,e,r,a){if(e._context.staticPlot)return;var s=t.select("rect."+m.slideBoxClassName).node(),l=t.select("rect."+m.grabAreaMinClassName).node(),u=t.select("rect."+m.grabAreaMaxClassName).node();function c(){var c=n.event,p=c.target,h=c.clientX||c.touches[0].clientX,m=h-t.node().getBoundingClientRect().left,g=a.d2p(r._rl[0]),y=a.d2p(r._rl[1]),v=f.coverSlip();function _(t){var c,f,_,x=+(t.clientX||t.touches[0].clientX)-h;switch(p){case s:_="ew-resize",c=g+x,f=y+x;break;case l:_="col-resize",c=g+x,f=y;break;case u:_="col-resize",c=g,f=y+x;break;default:_="ew-resize",c=m,f=m+x}if(f<c){var b=f;f=c,c=b}a._pixelMin=c,a._pixelMax=f,d(n.select(v),_),function(t,e,r,n){function a(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var s=a(n.p2d(n._pixelMin)),l=a(n.p2d(n._pixelMax));window.requestAnimationFrame((function(){i.call("_guiRelayout",e,r._name+".range",[s,l])}))}(0,e,r,a)}function x(){v.removeEventListener("mousemove",_),v.removeEventListener("mouseup",x),this.removeEventListener("touchmove",_),this.removeEventListener("touchend",x),o.removeElement(v)}this.addEventListener("touchmove",_),this.addEventListener("touchend",x),v.addEventListener("mousemove",_),v.addEventListener("mouseup",x)}t.on("mousedown",c),t.on("touchstart",c)}(a,t,r,l),function(t,e,r,n,i,a){var l=m.handleWidth/2;function u(t){return o.constrain(t,0,n._width)}function c(t){return o.constrain(t,0,n._height)}function p(t){return o.constrain(t,-l,n._width+l)}var h=u(n.d2p(r._rl[0])),f=u(n.d2p(r._rl[1]));if(t.select("rect."+m.slideBoxClassName).attr("x",h).attr("width",f-h),t.select("rect."+m.maskMinClassName).attr("width",h),t.select("rect."+m.maskMaxClassName).attr("x",f).attr("width",n._width-f),"match"!==a.rangemode){var d=n._height-c(n.d2pOppAxis(i._rl[1])),g=n._height-c(n.d2pOppAxis(i._rl[0]));t.select("rect."+m.maskMinOppAxisClassName).attr("x",h).attr("height",d).attr("width",f-h),t.select("rect."+m.maskMaxOppAxisClassName).attr("x",h).attr("y",g).attr("height",n._height-g).attr("width",f-h),t.select("rect."+m.slideBoxClassName).attr("y",d).attr("height",g-d)}var y=Math.round(p(h-l))-.5,v=Math.round(p(f-l))+.5;t.select("g."+m.grabberMinClassName).attr("transform",s(y,.5)),t.select("g."+m.grabberMaxClassName).attr("transform",s(v,.5))}(a,0,r,l,u,p),"bottom"===r.side&&c.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:C+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":212,"../../lib/setcursor":232,"../../plots/cartesian":271,"../../plots/cartesian/axis_ids":261,"../../plots/plots":299,"../../registry":308,"../color":83,"../dragelement":102,"../drawing":105,"../titles":178,"./constants":154,d3:16}],157:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),i=t("../../lib/svg_text_utils"),a=t("./constants"),o=t("../../constants/alignment").LINE_SPACING,s=a.name;function l(t){var e=t&&t[s];return e&&e.visible}r.isVisible=l,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,i=[];if(!t._has("gl2d"))for(var a=0;a<e.length;a++){var o=e[a];if(l(o)){i.push(o);var u=o[s];u._id=s+o._id,u._height=(t.height-r.b-r.t)*u.thickness,u._offsetShift=Math.floor(u.borderwidth/2)}}t._rangeSliderData=i},r.autoMarginOpts=function(t,e){var r=t._fullLayout,n=e[s],l=e._id.charAt(0),u=0,c=0;"bottom"===e.side&&(u=e._depth,e.title.text!==r._dfltTitle[l]&&(c=1.5*e.title.font.size+10+n._offsetShift,c+=(e.title.text.match(i.BR_TAG_ALL)||[]).length*e.title.font.size*o));return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:n._height+u+Math.max(r.margin.b,c),pad:a.extraPad+2*n._offsetShift}}},{"../../constants/alignment":185,"../../lib/svg_text_utils":234,"../../plots/cartesian/axis_ids":261,"./constants":154}],158:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},i,{yaxis:a})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":212,"./attributes":152,"./calc_autorange":153,"./defaults":155,"./draw":156,"./helpers":157,"./oppaxis_attributes":159}],159:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],160:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":186,"../../lib/extend":204,"../../plot_api/plot_template":247,"../../traces/scatter/attributes":339,"../annotations/attributes":68,"../drawing/attributes":104}],161:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,i,s,l){var u=t/2,c=l;if("pixel"===e){var p=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,p),f=n.aggNums(Math.min,null,p),d=f<0?Math.abs(f)+u:u,m=h>0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;l<d.length;l++)void 0!==(u=i[d[l].charAt(0)].drawn)&&(!(c=d[l].substr(1).match(a.paramRE))||c.length<u||((p=s(c[u]))<h&&(h=p),p>f&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var u,p,h=r[o];h._extremes={};var f=i.getRefType(h.xref),d=i.getRefType(h.yref);if("paper"!==h.xref&&"domain"!==f){var m="pixel"===h.xsizemode?h.xanchor:h.x0,g="pixel"===h.xsizemode?h.xanchor:h.x1;(p=c(u=i.getFromId(t,h.xref),m,g,h.path,a.paramIsX))&&(h._extremes[u._id]=i.findExtremes(u,p,s(h)))}if("paper"!==h.yref&&"domain"!==d){var y="pixel"===h.ysizemode?h.yanchor:h.y0,v="pixel"===h.ysizemode?h.yanchor:h.y1;(p=c(u=i.getFromId(t,h.yref),y,v,h.path,a.paramIsY))&&(h._extremes[u._id]=i.findExtremes(u,p,l(h)))}}}},{"../../lib":212,"../../plots/cartesian/axes":258,"./constants":162,"./helpers":171}],162:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],163:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./helpers");function l(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}if(a("visible")){var l=a("path"),u=a("type",l?"path":"rect");"path"!==e.type&&delete e.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule"),a("line.width")&&(a("line.color"),a("line.dash"));for(var c=a("xsizemode"),p=a("ysizemode"),h=["x","y"],f=0;f<2;f++){var d,m,g,y=h[f],v=y+"anchor",_="x"===y?c:p,x={_fullLayout:r},b=i.coerceRef(t,e,x,y,void 0,"paper");if("range"===i.getRefType(b)?((d=i.getFromId(x,b))._shapeIndices.push(e._index),g=s.rangeToShapePosition(d),m=s.shapePositionToRange(d)):m=g=n.identity,"path"!==u){var w=y+"0",T=y+"1",k=t[w],A=t[T];t[w]=m(t[w],!0),t[T]=m(t[T],!0),"pixel"===_?(a(w,0),a(T,10)):(i.coercePosition(e,x,a,b,w,.25),i.coercePosition(e,x,a,b,T,.75)),e[w]=g(e[w]),e[T]=g(e[T]),t[w]=k,t[T]=A}if("pixel"===_){var M=t[v];t[v]=m(t[v],!0),i.coercePosition(e,x,a,b,v,.25),e[v]=g(e[v]),t[v]=M}}"path"===u?a("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){a(t,e,{name:"shapes",handleItemDefaults:l})}},{"../../lib":212,"../../plots/array_container_defaults":253,"../../plots/cartesian/axes":258,"./attributes":160,"./helpers":171}],164:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw_newshape/helpers").readPaths,s=t("./draw_newshape/display_outlines"),l=t("../../plots/cartesian/handle_outline").clearOutlineControllers,u=t("../color"),c=t("../drawing"),p=t("../../plot_api/plot_template").arrayEditor,h=t("../dragelement"),f=t("../../lib/setcursor"),d=t("./constants"),m=t("./helpers");function g(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i<e.shapes.length;i++)e.shapes[i].visible&&_(t,i)}function y(t){return!!t._fullLayout._drawing}function v(t){return!t._context.edits.shapePosition}function _(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=m.makeOptionsAndPlotinfo(t,e),l=r.options,_=r.plotinfo;if(l._input&&!1!==l.visible)if("below"!==l.layer)k(t._fullLayout._shapeUpperLayer);else if("paper"===l.xref||"paper"===l.yref)k(t._fullLayout._shapeLowerLayer);else{if(_._hadPlotinfo)k((_.mainplotinfo||_).shapelayer);else k(t._fullLayout._shapeLowerLayer)}function k(r){var k=b(t,l),A={"data-index":e,"fill-rule":l.fillrule,d:k},M=l.opacity,S=l.fillcolor,C=l.line.width?l.line.color:"rgba(0,0,0,0)",L=l.line.width,E=l.line.dash;L||!0!==l.editable||(L=5,E="solid");var I="Z"!==k[k.length-1],z=v(t)&&l.editable&&t._fullLayout._activeShapeIndex===e;z&&(S=I?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,M=t._fullLayout.activeshape.opacity);var P,D=r.append("path").attr(A).style("opacity",M).call(u.stroke,C).call(u.fill,S).call(c.dashLine,E,L);if(x(D,t,l),(z||t._context.edits.shapePosition)&&(P=p(t.layout,"shapes",l)),z){D.style({cursor:"move"});var O={element:D.node(),plotinfo:_,gd:t,editHelpers:P,isActiveShape:!0},R=o(k,t);s(R,D,O)}else t._context.edits.shapePosition?function(t,e,r,o,s,l){var u,p,g,v,_,T,k,A,M,S,C,L,E,I,z,P,D="pixel"===r.xsizemode,O="pixel"===r.ysizemode,R="line"===r.type,F="path"===r.type,B=l.modifyItem,N=a.getFromId(t,r.xref),U=a.getRefType(r.xref),j=a.getFromId(t,r.yref),V=a.getRefType(r.yref),q=m.getDataToPixel(t,N,!1,U),H=m.getDataToPixel(t,j,!0,V),Z=m.getPixelToData(t,N,!1,U),G=m.getPixelToData(t,j,!0,V),X=R?function(){var t=Math.max(r.line.width,10),n=s.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=Math.max(t/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:D?q(r.xanchor)+r.x0:q(r.x0),cy:O?H(r.yanchor)-r.y0:H(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:D?q(r.xanchor)+r.x1:q(r.x1),cy:O?H(r.yanchor)-r.y1:H(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,W={element:X.node(),gd:t,prepFn:function(n){if(y(t))return;D&&(_=q(r.xanchor));O&&(T=H(r.yanchor));"path"===r.type?z=r.path:(u=D?r.x0:q(r.x0),p=O?r.y0:H(r.y0),g=D?r.x1:q(r.x1),v=O?r.y1:H(r.y1));u<g?(M=u,E="x0",S=g,I="x1"):(M=g,E="x1",S=u,I="x0");!O&&p<v||O&&p>v?(k=p,C="y0",A=v,L="y1"):(k=v,C="y1",A=p,L="y0");Y(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),W.moveFn="move"===P?K:J,W.altKey=n.altKey},doneFn:function(){if(y(t))return;f(e),$(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function Y(r){if(y(t))P=null;else if(R)P="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=W.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";f(e,l),P=l.split("-")[0]}}function K(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+i)):(l=function(t){return G(H(t)+i)},j&&"date"===j.type&&(l=m.encodeDate(l))),B("path",r.path=w(z,o,l))}else D?B("xanchor",r.xanchor=Z(_+n)):(B("x0",r.x0=Z(u+n)),B("x1",r.x1=Z(g+n))),O?B("yanchor",r.yanchor=G(T+i)):(B("y0",r.y0=G(p+i)),B("y1",r.y1=G(v+i)));e.attr("d",b(t,r)),Q(s,r)}function J(n,i){if(F){var a=function(t){return t},o=a,l=a;D?B("xanchor",r.xanchor=Z(_+n)):(o=function(t){return Z(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+i)):(l=function(t){return G(H(t)+i)},j&&"date"===j.type&&(l=m.encodeDate(l))),B("path",r.path=w(z,o,l))}else if(R){if("resize-over-start-point"===P){var c=u+n,h=O?p-i:p+i;B("x0",r.x0=D?c:Z(c)),B("y0",r.y0=O?h:G(h))}else if("resize-over-end-point"===P){var f=g+n,d=O?v-i:v+i;B("x1",r.x1=D?f:Z(f)),B("y1",r.y1=O?d:G(d))}}else{var y=function(t){return-1!==P.indexOf(t)},x=y("n"),U=y("s"),V=y("w"),X=y("e"),W=x?k+i:k,Y=U?A+i:A,K=V?M+n:M,J=X?S+n:S;O&&(x&&(W=k-i),U&&(Y=A-i)),(!O&&Y-W>10||O&&W-Y>10)&&(B(C,r[C]=O?W:G(W)),B(L,r[L]=O?Y:G(Y))),J-K>10&&(B(E,r[E]=D?K:Z(K)),B(I,r[I]=D?J:Z(J)))}e.attr("d",b(t,r)),Q(s,r)}function Q(t,e){(D||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=q(D?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=H(O?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),D&&O){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(D){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(W),X.node().onmousemove=Y}(t,D,l,e,r,P):!0===l.editable&&D.style("pointer-events",I||u.opacity(S)*M<=.5?"stroke":"all");D.node().addEventListener("click",(function(){return function(t,e){if(!v(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void T(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=T,g(t)}}(t,D)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function b(t,e){var r,n,o,s,l,u,c,p,h=e.type,f=a.getRefType(e.xref),g=a.getRefType(e.yref),y=a.getFromId(t,e.xref),v=a.getFromId(t,e.yref),_=t._fullLayout._size;if(y?"domain"===f?n=function(t){return y._offset+y._length*t}:(r=m.shapePositionToRange(y),n=function(t){return y._offset+y.r2p(r(t,!0))}):n=function(t){return _.l+_.w*t},v?"domain"===g?s=function(t){return v._offset+v._length*(1-t)}:(o=m.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return _.t+_.h*(1-t)},"path"===h)return y&&"date"===y.type&&(n=m.decodeDate(n)),v&&"date"===v.type&&(s=m.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(d.segmentRE,(function(t){var n=0,u=t.charAt(0),c=d.paramIsX[u],p=d.paramIsY[u],h=d.numParams[u],f=t.substr(1).replace(d.paramRE,(function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):p[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>h&&(t="X"),t}));return n>h&&(f=f.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+f}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,p=b-e.y1}else c=s(e.y0),p=s(e.y1);if("line"===h)return"M"+l+","+c+"L"+u+","+p;if("rect"===h)return"M"+l+","+c+"H"+u+"V"+p+"H"+l+"Z";var w=(l+u)/2,T=(c+p)/2,k=Math.abs(w-l),A=Math.abs(T-c),M="A"+k+","+A,S=w+k+","+T;return"M"+S+M+" 0 1,1 "+(w+","+(T-A))+M+" 0 0,1 "+S+"Z"}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){v(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,g(t)))}e.exports={draw:g,drawOne:_,eraseActiveShape:function(t){if(!v(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var i=[],a=0;a<r.length;a++)a!==e&&i.push(r[a]);delete t._fullLayout._activeShapeIndex,n.call("_guiRelayout",t,{shapes:i})}}}},{"../../lib":212,"../../lib/setcursor":232,"../../plot_api/plot_template":247,"../../plots/cartesian/axes":258,"../../plots/cartesian/handle_outline":268,"../../registry":308,"../color":83,"../dragelement":102,"../drawing":105,"./constants":162,"./draw_newshape/display_outlines":168,"./draw_newshape/helpers":169,"./helpers":171}],165:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newshape:{line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:0,dflt:4,editType:"none"},dash:i({},n,{dflt:"solid",editType:"none"}),editType:"none"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"none"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"none"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",editType:"none"},editType:"none"},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":204,"../../drawing/attributes":104}],166:[function(t,e,r){"use strict";e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},{}],167:[function(t,e,r){"use strict";var n=t("../../color");e.exports=function(t,e,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var i=(t||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(i)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":83}],168:[function(t,e,r){"use strict";var n=t("../../dragelement"),i=t("../../dragelement/helpers").drawMode,a=t("../../../registry"),o=t("./constants"),s=o.i000,l=o.i090,u=o.i180,c=o.i270,p=t("../../../plots/cartesian/handle_outline").clearOutlineControllers,h=t("./helpers"),f=h.pointsShapeRectangle,d=h.pointsShapeEllipse,m=h.writePaths,g=t("./newshapes");e.exports=function t(e,r,o,h){h||(h=0);var y=o.gd;function v(){t(e,r,o,h++),d(e[0])&&_({redrawing:!0})}function _(t){o.isActiveShape=!1;var e=g(r,o);Object.keys(e).length&&a.call((t||{}).redrawing?"relayout":"_guiRelayout",y,e)}var x,b,w,T,k,A=o.isActiveShape,M=y._fullLayout._zoomlayer,S=o.dragmode;(i(S)?y._fullLayout._drawing=!0:y._fullLayout._activeShapeIndex>=0&&p(y),r.attr("d",m(e)),A&&!h)&&(k=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[r]=[];for(var i=0;i<n.length;i++){t[r][i]=[];for(var a=0;a<n[i].length;a++)t[r][i][a]=n[i][a]}}return t}([],e),function(t){x=[];for(var r=0;r<e.length;r++){var i=e[r],a=!f(i)&&d(i);x[r]=[];for(var o=0;o<i.length;o++)if("Z"!==i[o][0]&&(!a||o===s||o===l||o===u||o===c)){var p=i[o][1],h=i[o][2],m=t.append("circle").classed("cursor-grab",!0).attr("data-i",r).attr("data-j",o).attr("cx",p).attr("cy",h).attr("r",4).style({"mix-blend-mode":"luminosity",fill:"black",stroke:"white","stroke-width":1});x[r][o]={element:m.node(),gd:y,prepFn:C,doneFn:E,clickFn:I},n.init(x[r][o])}}}(M.append("g").attr("class","outline-controllers")),function(){if(b=[],!e.length)return;b[0]={element:r[0][0],gd:y,prepFn:P,doneFn:D},n.init(b[0])}());function C(t){w=+t.srcElement.getAttribute("data-i"),T=+t.srcElement.getAttribute("data-j"),x[w][T].moveFn=L}function L(t,r){if(e.length){var n=k[w][T][1],i=k[w][T][2],a=e[w],o=a.length;if(f(a)){for(var s=0;s<o;s++)if(s!==T){var l=a[s];l[1]===a[T][1]&&(l[1]=n+t),l[2]===a[T][2]&&(l[2]=i+r)}if(a[T][1]=n+t,a[T][2]=i+r,!f(a))for(var u=0;u<o;u++)for(var c=0;c<a[u].length;c++)a[u][c]=k[w][u][c]}else a[T][1]=n+t,a[T][2]=i+r;v()}}function E(){_()}function I(t,r){if(2===t){w=+r.srcElement.getAttribute("data-i"),T=+r.srcElement.getAttribute("data-j");var n=e[w];f(n)||d(n)||function(){if(e.length&&e[w]&&e[w].length){for(var t=[],r=0;r<e[w].length;r++)r!==T&&t.push(e[w][r]);t.length>1&&(2!==t.length||"Z"!==t[1][0])&&(0===T&&(t[0][0]="M"),e[w]=t,v(),_())}}()}}function z(t,r){!function(t,r){if(e.length)for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)for(var a=0;a+2<e[n][i].length;a+=2)e[n][i][a+1]=k[n][i][a+1]+t,e[n][i][a+2]=k[n][i][a+2]+r}(t,r),v()}function P(t){(w=+t.srcElement.getAttribute("data-i"))||(w=0),b[w].moveFn=z}function D(){_()}}},{"../../../plots/cartesian/handle_outline":268,"../../../registry":308,"../../dragelement":102,"../../dragelement/helpers":101,"./constants":166,"./helpers":169,"./newshapes":170}],169:[function(t,e,r){"use strict";var n=t("parse-svg-path"),i=t("./constants"),a=i.CIRCLE_SIDES,o=i.SQRT2,s=t("../../../plots/cartesian/helpers"),l=s.p2r,u=s.r2p,c=[0,3,4,5,6,1,2],p=[0,3,4,1,2];function h(t,e){return Math.abs(t-e)<=1e-6}function f(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n<e;n++)for(var i=t[n].length,a=0;a<i;a++){var o=t[n][a][0];if("Z"===o)r+="Z";else for(var s=t[n][a].length,l=0;l<s;l++){var u=l;"Q"===o||"S"===o?u=p[l]:"C"===o&&(u=c[l]),r+=t[n][a][u],l>0&&l<s-1&&(r+=",")}}return r},r.readPaths=function(t,e,r,i){var o,s,c,p=n(t),h=[],f=-1,d=0,m=0,g=function(){s=d,c=m};g();for(var y=0;y<p.length;y++){var v,_,x,b,w=[],T=p[y][0],k=T;switch(T){case"M":f++,h[f]=[],d=+p[y][1],m=+p[y][2],w.push([k,d,m]),g();break;case"Q":case"S":v=+p[y][1],x=+p[y][2],d=+p[y][3],m=+p[y][4],w.push([k,d,m,v,x]);break;case"C":v=+p[y][1],x=+p[y][2],_=+p[y][3],b=+p[y][4],d=+p[y][5],m=+p[y][6],w.push([k,d,m,v,x,_,b]);break;case"T":case"L":d=+p[y][1],m=+p[y][2],w.push([k,d,m]);break;case"H":k="L",d=+p[y][1],w.push([k,d,m]);break;case"V":k="L",m=+p[y][1],w.push([k,d,m]);break;case"A":k="L";var A=+p[y][1],M=+p[y][2];+p[y][4]||(A=-A,M=-M);var S=d-A,C=m;for(o=1;o<=a/2;o++){var L=2*Math.PI*o/a;w.push([k,S+A*Math.cos(L),C+M*Math.sin(L)])}break;case"Z":d===s&&m===c||(d=s,m=c,w.push([k,d,m]))}for(var E=(r||{}).domain,I=e._fullLayout._size,z=r&&"pixel"===r.xsizemode,P=r&&"pixel"===r.ysizemode,D=!1===i,O=0;O<w.length;O++){for(o=0;o+2<7;o+=2){var R=w[O][o+1],F=w[O][o+2];void 0!==R&&void 0!==F&&(d=R,m=F,r&&(r.xaxis&&r.xaxis.p2r?(D&&(R-=r.xaxis._offset),R=z?u(r.xaxis,r.xanchor)+R:l(r.xaxis,R)):(D&&(R-=I.l),E?R=E.x[0]+R/I.w:R/=I.w),r.yaxis&&r.yaxis.p2r?(D&&(F-=r.yaxis._offset),F=P?u(r.yaxis,r.yanchor)-F:l(r.yaxis,F)):(D&&(F-=I.t),F=E?E.y[1]-F/I.h:1-F/I.h)),w[O][o+1]=R,w[O][o+2]=F)}h[f].push(w[O].slice())}}return h},r.pointsShapeRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!h(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!h(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!h(t[0][1],t[1][1])&&!h(t[0][1],t[3][1]))&&!!(f(t[0],t[1])*f(t[0],t[3]))},r.pointsShapeEllipse=function(t){var e=t.length;if(e!==a+1)return!1;e=a;for(var r=0;r<e;r++){var n=(2*e-r)%e,i=(e/2+n)%e,o=(e/2+r)%e;if(!h(f(t[r],t[o]),f(t[n],t[i])))return!1}return!0},r.handleEllipse=function(t,e,n){if(!t)return[e,n];var i=r.ellipseOver({x0:e[0],y0:e[1],x1:n[0],y1:n[1]}),s=(i.x1+i.x0)/2,l=(i.y1+i.y0)/2,u=(i.x1-i.x0)/2,c=(i.y1-i.y0)/2;u||(u=c/=o),c||(c=u/=o);for(var p=[],h=0;h<a;h++){var f=2*h*Math.PI/a;p.push([s+u*Math.cos(f),l+c*Math.sin(f)])}return p},r.ellipseOver=function(t){var e=t.x0,r=t.y0,n=t.x1,i=t.y1,a=n-e,s=i-r,l=((e-=a)+n)/2,u=((r-=s)+i)/2;return{x0:l-(a*=o),y0:u-(s*=o),x1:l+a,y1:u+s}}},{"../../../plots/cartesian/helpers":269,"./constants":166,"parse-svg-path":56}],170:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers"),i=n.drawMode,a=n.openMode,o=t("./constants"),s=o.i000,l=o.i090,u=o.i180,c=o.i270,p=o.cos45,h=o.sin45,f=t("../../../plots/cartesian/helpers"),d=f.p2r,m=f.r2p,g=t("../../../plots/cartesian/handle_outline").clearSelect,y=t("./helpers"),v=y.readPaths,_=y.writePaths,x=y.ellipseOver;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var n=r.getAttribute("d"),o=e.gd,f=o._fullLayout.newshape,y=e.plotinfo,b=y.xaxis,w=y.yaxis,T=!!y.domain||!y.xaxis,k=!!y.domain||!y.yaxis,A=e.isActiveShape,M=e.dragmode,S=(o.layout||{}).shapes||[];if(!i(M)&&void 0!==A){var C=o._fullLayout._activeShapeIndex;if(C<S.length)switch(o._fullLayout.shapes[C].type){case"rect":M="drawrect";break;case"circle":M="drawcircle";break;case"line":M="drawline";break;case"path":var L=S[C].path||"";M="Z"===L[L.length-1]?"drawclosedpath":"drawopenpath"}}var E,I=a(M),z=v(n,o,y,A),P={editable:!0,xref:T?"paper":b._id,yref:k?"paper":w._id,layer:f.layer,opacity:f.opacity,line:{color:f.line.color,width:f.line.width,dash:f.line.dash}};if(I||(P.fillcolor=f.fillcolor,P.fillrule=f.fillrule),1===z.length&&(E=z[0]),E&&"drawrect"===M)P.type="rect",P.x0=E[0][1],P.y0=E[0][2],P.x1=E[2][1],P.y1=E[2][2];else if(E&&"drawline"===M)P.type="line",P.x0=E[0][1],P.y0=E[0][2],P.x1=E[1][1],P.y1=E[1][2];else if(E&&"drawcircle"===M){P.type="circle";var D=E[s][1],O=E[l][1],R=E[u][1],F=E[c][1],B=E[s][2],N=E[l][2],U=E[u][2],j=E[c][2],V=y.xaxis&&("date"===y.xaxis.type||"log"===y.xaxis.type),q=y.yaxis&&("date"===y.yaxis.type||"log"===y.yaxis.type);V&&(D=m(y.xaxis,D),O=m(y.xaxis,O),R=m(y.xaxis,R),F=m(y.xaxis,F)),q&&(B=m(y.yaxis,B),N=m(y.yaxis,N),U=m(y.yaxis,U),j=m(y.yaxis,j));var H=(O+F)/2,Z=(B+U)/2,G=x({x0:H,y0:Z,x1:H+(F-O+R-D)/2*p,y1:Z+(j-N+U-B)/2*h});V&&(G.x0=d(y.xaxis,G.x0),G.x1=d(y.xaxis,G.x1)),q&&(G.y0=d(y.yaxis,G.y0),G.y1=d(y.yaxis,G.y1)),P.x0=G.x0,P.y0=G.y0,P.x1=G.x1,P.y1=G.y1}else P.type="path",b&&w&&function(t,e,r){var n="date"===e.type,i="date"===r.type;if(!n&&!i)return t;for(var a=0;a<t.length;a++)for(var o=0;o<t[a].length;o++)for(var s=0;s+2<t[a][o].length;s+=2)n&&(t[a][o][s+1]=t[a][o][s+1].replace(" ","_")),i&&(t[a][o][s+2]=t[a][o][s+2].replace(" ","_"))}(z,b,w),P.path=_(z),E=null;g(o);for(var X=e.editHelpers,W=(X||{}).modifyItem,Y=[],K=0;K<S.length;K++){var J=o._fullLayout.shapes[K];if(Y[K]=J._input,void 0!==A&&K===o._fullLayout._activeShapeIndex){var Q=P;switch(J.type){case"line":case"rect":case"circle":W("x0",Q.x0),W("x1",Q.x1),W("y0",Q.y0),W("y1",Q.y1);break;case"path":W("path",Q.path)}}}return void 0===A?(Y.push(P),Y):X?X.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":268,"../../../plots/cartesian/helpers":269,"../../dragelement/helpers":101,"./constants":166,"./helpers":169}],171:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach((function(t){var a=e[t.charAt(0)].drawn;if(void 0!==a){var o=t.substr(1).match(n.paramRE);!o||o.length<a||r.push(i.cleanNumber(o[a]))}})),r},r.getDataToPixel=function(t,e,n,i){var a,o=t._fullLayout._size;if(e)if("domain"===i)a=function(t){return e._length*(n?1-t:t)+e._offset};else{var s=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(s(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},r.getPixelToData=function(t,e,n,i){var a,o=t._fullLayout._size;if(e)if("domain"===i)a=function(t){var r=(t-e._offset)/e._length;return n?1-r:r};else{var s=r.rangeToShapePosition(e);a=function(t){return s(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return!!n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}}},{"../../lib":212,"./constants":162}],172:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),supplyDrawNewShapeDefaults:t("./draw_newshape/defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":270,"./attributes":160,"./calc_autorange":161,"./defaults":163,"./draw":164,"./draw_newshape/defaults":167}],173:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":204,"../../plot_api/edit_types":240,"../../plot_api/plot_template":247,"../../plots/animation_attributes":252,"../../plots/font_attributes":286,"../../plots/pad_attributes":298,"./constants":174}],174:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],175:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c<s.length;c++)s[c].visible&&l++;if(l<2?e.visible=!1:o("visible")){e._stepCount=l;var p=e._visibleSteps=n.filterVisible(s);(s[o("active")]||{}).visible||(e.active=p[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var i=r("label","step-"+e._index);r("value",i),r("execute")}}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":212,"../../plots/array_container_defaults":253,"./attributes":173,"./constants":174}],176:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,p=t("./constants"),h=t("../../constants/alignment"),f=h.LINE_SPACING,d=h.FROM_TL,m=h.FROM_BR;function g(t){return p.autoMarginIdRoot+t._index}function y(t){return t._index}function v(t,e){var r=o.tester.selectAll("g."+p.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(p.labelGroupClass,!0);var a=0,l=0;r.each((function(t){var r=b(n.select(this),{step:t},e).node();if(r){var i=o.bBox(r);l=Math.max(l,i.height),a=Math.max(a,i.width)}})),r.remove();var c=e._dims={};c.inputAreaWidth=Math.max(p.railWidth,p.gripHeight);var h=t._fullLayout._size;c.lx=h.l+h.w*e.x,c.ly=h.t+h.h*(1-e.y),"fraction"===e.lenmode?c.outerLength=Math.round(h.w*e.len):c.outerLength=e.len,c.inputAreaStart=0,c.inputAreaLength=Math.round(c.outerLength-e.pad.l-e.pad.r);var f=(c.inputAreaLength-2*p.stepInset)/(e._stepCount-1),y=a+p.labelPadding;if(c.labelStride=Math.max(1,Math.ceil(y/f)),c.labelHeight=l,c.currentValueMaxWidth=0,c.currentValueHeight=0,c.currentValueTotalHeight=0,c.currentValueMaxLines=1,e.currentvalue.visible){var v=o.tester.append("g");r.each((function(t){var r=_(v,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},i=u.lineCount(r);c.currentValueMaxWidth=Math.max(c.currentValueMaxWidth,Math.ceil(n.width)),c.currentValueHeight=Math.max(c.currentValueHeight,Math.ceil(n.height)),c.currentValueMaxLines=Math.max(c.currentValueMaxLines,i)})),c.currentValueTotalHeight=c.currentValueHeight+e.currentvalue.offset,v.remove()}c.height=c.currentValueTotalHeight+p.tickOffset+e.ticklen+p.labelOffset+c.labelHeight+e.pad.t+e.pad.b;var x="left";s.isRightAnchor(e)&&(c.lx-=c.outerLength,x="right"),s.isCenterAnchor(e)&&(c.lx-=c.outerLength/2,x="center");var w="top";s.isBottomAnchor(e)&&(c.ly-=c.height,w="bottom"),s.isMiddleAnchor(e)&&(c.ly-=c.height/2,w="middle"),c.outerLength=Math.ceil(c.outerLength),c.height=Math.ceil(c.height),c.lx=Math.round(c.lx),c.ly=Math.round(c.ly);var T={y:e.y,b:c.height*m[w],t:c.height*d[w]};"fraction"===e.lenmode?(T.l=0,T.xl=e.x-e.len*d[x],T.r=0,T.xr=e.x+e.len*m[x]):(T.x=e.x,T.l=c.outerLength*d[x],T.r=c.outerLength*m[x]),i.autoMargin(t,g(e),T)}function _(t,e,r){if(e.currentvalue.visible){var n,i,a=e._dims;switch(e.currentvalue.xanchor){case"right":n=a.inputAreaLength-p.currentValueInset-a.currentValueMaxWidth,i="left";break;case"center":n=.5*a.inputAreaLength,i="middle";break;default:n=p.currentValueInset,i="left"}var l=s.ensureSingle(t,"text",p.labelClass,(function(t){t.attr({"text-anchor":i,"data-notex":1})})),c=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)c+=r;else{var h=e.steps[e.active].label,d=e._gd._fullLayout._meta;d&&(h=s.templateString(h,d)),c+=h}e.currentvalue.suffix&&(c+=e.currentvalue.suffix),l.call(o.font,e.currentvalue.font).text(c).call(u.convertToTspans,e._gd);var m=u.lineCount(l),g=(a.currentValueMaxLines+1-m)*e.currentvalue.font.size*f;return u.positionText(l,n,g),l}}function x(t,e,r){s.ensureSingle(t,"rect",p.gripRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")})).attr({width:p.gripWidth,height:p.gripHeight,rx:p.gripRadius,ry:p.gripRadius}).call(a.stroke,r.bordercolor).call(a.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(t,e,r){var n=s.ensureSingle(t,"text",p.labelClass,(function(t){t.attr({"text-anchor":"middle","data-notex":1})})),i=e.step.label,a=r._gd._fullLayout._meta;return a&&(i=s.templateString(i,a)),n.call(o.font,r.font).text(i).call(u.convertToTspans,r._gd),n}function w(t,e){var r=s.ensureSingle(t,"g",p.labelsClass),i=e._dims,a=r.selectAll("g."+p.labelGroupClass).data(i.labelSteps);a.enter().append("g").classed(p.labelGroupClass,!0),a.exit().remove(),a.each((function(t){var r=n.select(this);r.call(b,t,e),o.setTranslate(r,C(e,t.fraction),p.tickOffset+e.ticklen+e.font.size*f+p.labelOffset+i.currentValueTotalHeight)}))}function T(t,e,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&k(t,e,r,o,!0,i)}function k(t,e,r,n,a,o){var s=r.active;r.active=n,c(t.layout,p.name,r).applyUpdate("active",n);var l=r.steps[r.active];e.call(S,r,o),e.call(_,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&i.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function A(t,e,r){var i=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",(function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+p.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(a.fill,t.activebgcolor);var u=L(t,n.mouse(i)[0]);T(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",(function(){var t=s(),a=L(t,n.mouse(i)[0]);T(e,r,t,a,!1)})),o.on("mouseup",(function(){var t=s();t._dragging=!1,l.call(a.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}))}))}function M(t,e){var r=t.selectAll("rect."+p.tickRectClass).data(e._visibleSteps),i=e._dims;r.enter().append("rect").classed(p.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(t,r){var s=r%i.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(a.fill,e.tickcolor),o.setTranslate(l,C(e,r/(e._stepCount-1))-.5*e.tickwidth,(s?p.tickOffset:p.minorTickOffset)+i.currentValueTotalHeight)}))}function S(t,e,r){for(var n=t.select("rect."+p.gripRectClass),i=0,a=0;a<e._stepCount;a++)if(e._visibleSteps[a]._index===e.active){i=a;break}var o=C(e,i/(e._stepCount-1));if(!e._invokingCommand){var s=n;r&&e.transition.duration>0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function E(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function I(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,i=s.ensureSingle(t,"rect",p.railRectClass);i.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=e,n.push(a))}return n}(e,t),a=e._infolayer.selectAll("g."+p.containerClassName).data(r.length>0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+p.groupClassName).data(r,y);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u<r.length;u++){var c=r[u];v(t,c)}l.each((function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),i.manageCommandObserver(t,e,e._visibleSteps,(function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||k(t,r,n,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(_,r).call(I,r).call(w,r).call(M,r).call(E,t,r).call(x,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(S,r,!1),e.call(_,r)}(t,n.select(this),e)}))}}},{"../../constants/alignment":185,"../../lib":212,"../../lib/svg_text_utils":234,"../../plot_api/plot_template":247,"../../plots/plots":299,"../color":83,"../drawing":105,"./constants":174,d3:16}],177:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":173,"./constants":174,"./defaults":175,"./draw":176}],178:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("../../constants/interactions"),f=t("../../constants/alignment").OPPOSITE_SIDE,d=/ [XY][0-9]* /;e.exports={draw:function(t,e,r){var m,g=r.propContainer,y=r.propName,v=r.placeholder,_=r.traceIndex,x=r.avoid||{},b=r.attributes,w=r.transform,T=r.containerGroup,k=t._fullLayout,A=1,M=!1,S=g.title,C=(S&&S.text?S.text:"").trim(),L=S&&S.font?S.font:{},E=L.family,I=L.size,z=L.color;"title.text"===y?m="titleText":-1!==y.indexOf("axis")?m="axisTitleText":y.indexOf(!0)&&(m="colorbarTitleText");var P=t._context.edits[m];""===C?A=0:C.replace(d," % ")===v.replace(d," % ")&&(A=.2,M=!0,P||(C="")),r._meta?C=s.templateString(C,r._meta):k._meta&&(C=s.templateString(C,k._meta));var D=C||P;T||(T=s.ensureSingle(k._infolayer,"g","g-"+e));var O=T.selectAll("text").data(D?[0]:[]);if(O.enter().append("text"),O.text(C).attr("class",e),O.exit().remove(),!D)return T;function R(t){s.syncOrAsync([F,B],t)}function F(e){var r;return w?(r="",w.rotate&&(r+="rotate("+[w.rotate,b.x,b.y]+")"),w.offset&&(r+=l(0,w.offset))):r=null,e.attr("transform",r),e.style({"font-family":E,"font-size":n.round(I,2)+"px",fill:c.rgb(z),opacity:A*c.opacity(z),"font-weight":a.fontWeight}).attr(b).call(p.convertToTspans,t),a.previousPromises(t)}function B(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&C){e.attr("transform",null);var r=f[x.side],a="left"===x.side||"top"===x.side?-1:1,o=i(x.pad)?x.pad:2,c=u.bBox(e.node()),p={left:0,top:0,right:k.width,bottom:k.height},h=x.maxShift||a*(p[x.side]-c[x.side]),d=0;if(h<0)d=h;else{var m=x.offsetLeft||0,g=x.offsetTop||0;c.left-=m,c.right-=m,c.top-=g,c.bottom-=g,x.selection.each((function(){var t=u.bBox(this);s.bBoxIntersect(c,t,o)&&(d=Math.max(d,a*(t[x.side]-c[r])+o))})),d=Math.min(h,d)}if(d>0||h<0){var y={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(y[0],y[1]))}}}return O.call(R),P&&(C?O.on(".opacity",null):(A=0,M=!0,O.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),O.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?o.call("_guiRestyle",t,y,e,_):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(R)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),O.classed("js-placeholder",M),T}}},{"../../constants/alignment":185,"../../constants/interactions":188,"../../lib":212,"../../lib/svg_text_utils":234,"../../plots/plots":299,"../../registry":308,"../color":83,"../drawing":105,d3:16,"fast-isnumeric":18}],179:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":204,"../../plot_api/edit_types":240,"../../plot_api/plot_template":247,"../../plots/font_attributes":286,"../../plots/pad_attributes":298,"../color/attributes":82}],180:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],181:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":212,"../../plots/array_container_defaults":253,"./attributes":179,"./constants":180}],182:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(i.attr(p.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||y(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,u=i.active,c=i.buttons[u]||p.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};a.call(v,i,c,t).call(M,i,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(p.arrowSymbol[i.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+i.pad.l,y:l.headerHeight/2+p.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),y(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,g=0,y=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?g=y.headerHeight+p.gapButtonHeader:d=y.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-p.gapButtonHeader+p.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-y.openWidth);var x={x:y.lx+d+o.pad.l,y:y.ly+g+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(y.openWidth,y.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(y.openHeight,y.headerHeight)),k.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,f=i.active;if(c)for(s=0,l=0;l<f;l++)s+=h.heights[l]+p.gapButton;else for(o=0,l=0;l<f;l++)o+=h.widths[l]+p.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,o,k):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",(function(){e=!1,r||t.disable()}));r&&t.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,e||t.disable()}))}(a))}function v(t,e,r,n){t.call(_,e).call(x,e,r,n)}function _(t,e){s.ensureSingle(t,"rect",p.itemRectClassName,(function(t){t.attr({rx:p.rx,ry:p.ry,"shape-rendering":"crispEdges"})})).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var i=s.ensureSingle(t,"text",p.itemTextClassName,(function(t){t.attr({"text-anchor":"start","data-notex":1})})),a=r.label,u=n._fullLayout._meta;u&&(a=s.templateString(a,u)),i.call(o.font,e.font).text(a).call(l.convertToTspans,n)}function b(t,e){var r=e.active;t.each((function(t,i){var o=n.select(this);i===r&&e.showactive&&o.select("rect."+p.itemRectClassName).call(a.fill,p.activeColor)}))}function w(t){t.select("rect."+p.itemRectClassName).call(a.fill,p.hoverColor)}function T(t,e){t.select("rect."+p.itemRectClassName).call(a.fill,e.bgcolor)}function k(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},a=o.tester.selectAll("g."+p.dropdownButtonClassName).data(s.filterVisible(e.buttons));a.enter().append("g").classed(p.dropdownButtonClassName,!0);var u=-1!==["up","down"].indexOf(e.direction);a.each((function(i,a){var s=n.select(this);s.call(v,e,i,t);var h=s.select("."+p.itemTextClassName),f=h.node()&&o.bBox(h.node()).width,d=Math.max(f+p.textPadX,p.minWidth),m=e.font.size*c,g=l.lineCount(h),y=Math.max(m*g,p.minHeight)+p.textOffsetY;y=Math.ceil(y),d=Math.ceil(d),r.widths[a]=d,r.heights[a]=y,r.height1=Math.max(r.height1,y),r.width1=Math.max(r.width1,d),u?(r.totalWidth=Math.max(r.totalWidth,d),r.openWidth=r.totalWidth,r.totalHeight+=y+p.gapButton,r.openHeight+=y+p.gapButton):(r.totalWidth+=d+p.gapButton,r.openWidth+=d+p.gapButton,r.totalHeight=Math.max(r.totalHeight,y),r.openHeight=r.totalHeight)})),u?r.totalHeight-=p.gapButton:r.totalWidth-=p.gapButton,r.headerWidth=r.width1+p.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(u?(r.width1+=p.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=p.arrowPadX),a.remove();var h=r.totalWidth+e.pad.l+e.pad.r,f=r.totalHeight+e.pad.t+e.pad.b,d=t._fullLayout._size;r.lx=d.l+d.w*e.x,r.ly=d.t+d.h*(1-e.y);var m="left";s.isRightAnchor(e)&&(r.lx-=h,m="right"),s.isCenterAnchor(e)&&(r.lx-=h/2,m="center");var g="top";s.isBottomAnchor(e)&&(r.ly-=f,g="bottom"),s.isMiddleAnchor(e)&&(r.ly-=f/2,g="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),i.autoMargin(t,A(e),{x:e.x,y:e.y,l:h*({right:1,center:.5}[m]||0),r:h*({left:1,center:.5}[m]||0),b:f*({top:1,middle:.5}[g]||0),t:f*({bottom:1,middle:.5}[g]||0)})}function A(t){return p.autoMarginIdRoot+t._index}function M(t,e,r,n){n=n||{};var i=t.select("."+p.itemRectClassName),a=t.select("."+p.itemTextClassName),s=e.borderwidth,u=r.index,h=e._dims;o.setTranslate(t,s+r.x,s+r.y);var f=-1!==["up","down"].indexOf(e.direction),d=n.height||(f?h.heights[u]:h.height1);i.attr({x:0,y:0,width:n.width||(f?h.width1:h.widths[u]),height:d});var m=e.font.size*c,g=(l.lineCount(a)-1)*m/2;l.positionText(a,p.textOffsetX,d/2-g+p.textOffsetY),f?r.y+=h.heights[u]+r.yPad:r.x+=h.widths[u]+r.xPad,r.index++}function S(t,e){t.attr(p.menuIndexAttrName,e||"-1").selectAll("g."+p.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=s.filterVisible(e[p.name]);function a(e){i.autoMargin(t,A(e))}var o=e._menulayer.selectAll("g."+p.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(a)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;c<r.length;c++){var v=r[c];k(t,v)}var _="updatemenus"+e._uid,x=new h(t,u,_);l.enter().size()&&(u.node().parentNode.appendChild(u.node()),u.call(S)),l.exit().each((function(t){u.call(S),a(t)})).remove(),l.each((function(e){var r=n.select(this),a="dropdown"===e.type?u:null;i.manageCommandObserver(t,e,e.buttons,(function(n){m(t,e,e.buttons[n.index],r,a,x,n.index,!0)})),"dropdown"===e.type?(g(t,r,u,x,e),d(u,e)&&y(t,r,u,x,e)):y(t,r,null,null,e)}))}}},{"../../constants/alignment":185,"../../lib":212,"../../lib/svg_text_utils":234,"../../plot_api/plot_template":247,"../../plots/plots":299,"../color":83,"../drawing":105,"./constants":180,"./scrollbox":184,d3:16}],183:[function(t,e,r){arguments[4][177][0].apply(r,arguments)},{"./attributes":179,"./constants":180,"./defaults":181,"./draw":182,dup:177}],184:[function(t,e,r){"use strict";e.exports=s;var n=t("d3"),i=t("../color"),a=t("../drawing"),o=t("../../lib");function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,l=o.width,u=o.height;this.position=t;var c,p,h,f,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,_="down"===v,x="left"===v,b="up"===v,w=m,T=y;_||x||"right"===v||b||(this.position.direction="down",_=!0),_||b?(p=(c=d)+w,_?(h=g,T=(f=Math.min(h+T,u))-h):T=(f=g+T)-(h=Math.max(f-T,0))):(f=(h=g)+T,x?w=(p=d+w)-(c=Math.max(p-w,0)):(c=d,w=(p=Math.min(c+w,l))-c)),this._box={l:c,t:h,w:w,h:T};var k=m>w,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,C=g+y;C+M>u&&(C=u-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var E=y>T,I=s.barWidth+2*s.barPad,z=s.barLength+2*s.barPad,P=d+m,D=g;P+I>l&&(P=l-I);var O=this.container.selectAll("rect.scrollbar-vertical").data(E?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),E?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:D,width:I,height:z}),this._vbarYMin=D+z/2,this._vbarTranslateMax=T-z):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=E?p+I+.5:p+.5,N=h-.5,U=k?f+M+.5:f+.5,j=o._topdefs.selectAll("#"+R).data(k||E?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),k||E?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||E){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),E&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":212,"../color":83,"../drawing":105,d3:16}],185:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],186:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],187:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format#locale_format"}},{}],188:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],189:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],190:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],191:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s<o.length;s++){var l=o[s];"_"!==l.charAt(0)&&(r[l]=a[l]),i({moduleType:"apiMethod",name:l,fn:a[l]})}i(t("./traces/scatter")),i([t("./components/legend"),t("./components/fx"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale"),t("./components/colorbar")]),i([t("./locale-en"),t("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":76,"./components/annotations3d":81,"./components/colorbar":89,"./components/colorscale":95,"./components/errorbars":111,"./components/fx":123,"./components/grid":127,"./components/images":132,"./components/legend":140,"./components/rangeselector":151,"./components/rangeslider":158,"./components/shapes":172,"./components/sliders":177,"./components/updatemenus":183,"./fonts/mathjax_config":192,"./fonts/ploticon":193,"./lib/queue":227,"./locale-en":238,"./locale-en-us":237,"./plot_api":242,"./plot_api/plot_schema":246,"./plots/plots":299,"./registry":308,"./snapshot":313,"./traces/scatter":351,"./version":378,d3:16,"es6-promise":17}],192:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],193:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #3f4f75;} .cls-2 {fill: #80cfbe;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],194:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],195:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=i(r,s))>(n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function p(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,p,h,f,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(c=0,p=o,h=s):r<n?(c=r,h=n):(c=n,h=r),t<e?(f=t,d=e):(f=e,d=t);var y,v=Math.abs(h-c)<=o?0:1;function _(t,e,r){return"A"+[t,t]+" "+[0,v,r]+" "+g(t,e)}return m?y=null===f?"M"+g(d,c)+_(d,p,0)+_(d,h,0)+"Z":"M"+g(f,c)+_(f,p,0)+_(f,h,0)+"ZM"+g(d,c)+_(d,p,1)+_(d,h,1)+"Z":null===f?(y="M"+g(d,c)+_(d,h,0),u&&(y+="L0,0Z")):y="M"+g(f,c)+"L"+g(d,c)+_(d,h,0)+"L"+g(f,h)+_(f,c,1)+"Z",y}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:u,angleDist:function(t,e){return Math.abs(u(t,e))},isFullCircle:l,isAngleInsideSector:c,isPtInsideSector:function(t,e,r,n){return!!c(e,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),t>=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return p(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return p(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return p(t,e,r,n,i,a,1)}}},{"./mod":219}],196:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i<t.length;i++)n=e(n,t[i].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=s,r.isArray1D=function(t){return!s(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,i,a,o,s,l,u=[],c=!0,p=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(e?u.push(i):(e=i,a=o),n(i)?t=!1:(c=!1,p?t!==i.constructor&&(t=!1):t=i.constructor),p+=o);if(!p)return[];if(!u.length)return e;if(c)return e.concat.apply(e,u);if(t){for((s=new t(p)).set(e),r=0;r<u.length;r++)i=u[r],s.set(i,a),a+=i.length;return s}for(s=new Array(p),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<u.length;r++){for(i=u[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},r.maxRowLength=function(t){return l(t,Math.max,0)},r.minRowLength=function(t){return l(t,Math.min,1/0)}},{}],197:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":189,"fast-isnumeric":18}],198:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}},{}],199:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],200:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/scales"),s=t("../constants/interactions").DESELECTDIM,l=t("./nested_property"),u=t("./regex").counter,c=t("./mod").modHalf,p=t("./array").isArrayOrTypedArray;function h(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&p(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){p(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){function a(t,e,n){var i,a={set:function(t){i=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,a,n,e),i}var o=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var s,l,u,c,p,h,f=i.items,d=[],m=Array.isArray(f),g=m&&o&&Array.isArray(f[0]),y=o&&m&&!g,v=m&&!y?f.length:t.length;if(n=Array.isArray(n)?n:[],o)for(s=0;s<v;s++)for(d[s]=[],u=Array.isArray(t[s])?t[s]:[],p=y?f.length:m?f[s].length:u.length,l=0;l<p;l++)c=y?f[l]:m?f[s][l]:f,void 0!==(h=a(u[l],c,(n[s]||[])[l]))&&(d[s][l]=h);else for(s=0;s<v;s++)void 0!==(h=a(t[s],m?f[s]:f,n[s]))&&(d[s]=h);e.set(d)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),i=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(i){if(!Array.isArray(t[a])||!e.freeLength&&t[a].length!==r[a].length)return!1;for(var o=0;o<t[a].length;o++)if(!h(t[a][o],n?r[a][o]:r))return!1}else if(!h(t[a],n?r[a]:r))return!1;return!0}}},r.coerce=function(t,e,n,i,a){var o=l(n,i).get(),s=l(t,i),u=l(e,i),c=s.get(),f=e._template;if(void 0===c&&f&&(c=l(f,i).get(),f=0),void 0===a&&(a=o.dflt),o.arrayOk&&p(c))return u.set(c),c;var d=r.valObjectMeta[o.valType].coerceFunction;d(c,u,a,o);var m=u.get();return f&&m===a&&!h(c,o)&&(d(c=l(f,i).get(),u,a,o),m=u.get()),m},r.coerce2=function(t,e,n,i,a){var o=l(t,i),s=r.coerce(t,e,n,i,a),u=o.get();return null!=u&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var i,o=e._module.attributes,s=o.hoverinfo?o:a,l=s.hoverinfo;if(1===n._dataLength){var u="all"===l.dflt?l.flags.slice():l.dflt.split("+");u.splice(u.indexOf("name"),1),i=u.join("+")}return r.coerce(t,e,s,"hoverinfo",i)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;if(void 0!==i)p(i)||t.selected||t.unselected||(r=i,n=s*i),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=h},{"../components/colorscale/scales":98,"../constants/interactions":188,"../plots/attributes":254,"./array":196,"./mod":219,"./nested_property":220,"./regex":228,"fast-isnumeric":18,tinycolor2:66}],201:[function(t,e,r){"use strict";var n,i,a=t("d3-time-format").timeFormat,o=t("fast-isnumeric"),s=t("./loggers"),l=t("./mod").mod,u=t("../constants/numerical"),c=u.BADNUM,p=u.ONEDAY,h=u.ONEHOUR,f=u.ONEMIN,d=u.ONESEC,m=u.EPOCHJD,g=t("../registry"),y=t("d3-time-format").utcFormat,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function b(t){return t&&g.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){var n=function(t,e){return b(t)?e?g.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:g.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(t,!!e);if(e<2)return n;var i=r.dateTime2ms(n,t);return i+=p*(e-1),r.ms2DateTime(i,0,t)},r.dfltRange=function(t){return b(t)?g.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var a=t.getTimezoneOffset()*f,o=(t.getUTCMinutes()-t.getMinutes())*f+(t.getUTCSeconds()-t.getSeconds())*d+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var s=3*f;a=a-s/2+l(o-a+s/2,s)}return(t=Number(t)-a)>=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),y=t.charAt(0);!u||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var E;k=Number(k);try{var I=g.getComponentMethod("calendars","getCal")(e);if(w){var z="i"===A.charAt(A.length-1);A=parseInt(A,10),E=I.newDate(k,I.toMonthIndex(k,A,z),M)}else E=I.newDate(k,Number(A),M)}catch(t){return c}return E?(E.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),A-=1;var P=new Date(Date.UTC(2e3,A,M,S,C));return P.setUTCFullYear(k),P.getUTCMonth()!==A||P.getUTCDate()!==M?c:P.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,A=5*f;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=y("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e<T?Math.floor(C/h):0,s=e<T?Math.floor(C%h/f):0,u=e<k?Math.floor(C%f/d):0,v=e<A?C%d*10+x:0}else _=new Date(w),a=y("%Y-%m-%d")(_),o=e<T?_.getUTCHours():0,s=e<T?_.getUTCMinutes():0,u=e<k?_.getUTCSeconds():0,v=e<A?10*_.getUTCMilliseconds()+x:0;return M(a,o,s,u,v)},r.ms2DateTimeLocal=function(t){if(!(t>=n+p&&t<=i-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(b(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=b(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var i=Math.round(t/p)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=b(e)&&g.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(n=t[c],o(n)){if(!(n%p))if(u)try{1===(r=u.fromJD(n/p+m)).day()?1===r.month()?i++:a++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?i++:a++:s++}else l++;s+=a+=i;var h=t.length-l;return{exactYears:i/h,exactMonths:a/h,exactDays:s/h}}},{"../constants/numerical":189,"../registry":308,"./loggers":216,"./mod":219,"d3-time-format":14,"fast-isnumeric":18}],202:[function(t,e,r){"use strict";var n=t("d3"),i=t("./loggers"),a=t("./matrix"),o=t("gl-mat4");function s(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function l(t,e,r){var n="plotly.js-style-"+t,a=document.getElementById(n);a||((a=document.createElement("style")).setAttribute("id",n),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):i.warn("addStyleRule failed")}function u(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(t){return+t}))}function c(t){for(var e=[];p(t);)e.push(t),t=t.parentNode;return e}function p(t){return t&&(t instanceof Element||t instanceof HTMLElement)}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:s,addStyleRule:function(t,e){l("global",t,e)},addRelatedStyleRule:l,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&s(r)},getFullTransformMatrix:function(t){var e=c(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(t){var e=u(t);if(e){var n=a.convertCssMatrix(e);r=o.multiply(r,r,n)}})),r},getElementTransformMatrix:u,getElementAndAncestors:c,equalDomRects:function(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}},{"./loggers":216,"./matrix":218,d3:16,"gl-mat4":34}],203:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o,s=a._events[e];if(!s)return n;function l(t){return t.listener?(a.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(a,[r]))):t.apply(a,[r])}for(s=Array.isArray(s)?s:[s],o=0;o<s.length-1;o++)l(s[o]);return i=l(s[o]),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=i},{events:12}],204:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),i=Array.isArray;function a(t,e,r,o){var s,l,u,c,p,h,f=t[0],d=t.length;if(2===d&&i(f)&&i(t[1])&&0===f.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],f))return f;f.splice(0,f.length)}for(var m=1;m<d;m++)for(l in s=t[m])u=f[l],c=s[l],o&&i(c)?f[l]=c:e&&c&&(n(c)||(p=i(c)))?(p?(p=!1,h=u&&i(u)?u:[]):h=u&&n(u)?u:{},f[l]=a([h,c],e,r,o)):("undefined"!=typeof c||r)&&(f[l]=c);return f}r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":213}],205:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}},{}],206:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function i(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?i:n),a=[],o=0;o<t.length;o++){var s=t[o];r(s)&&a.push(s)}return a}},{}],207:[function(t,e,r){"use strict";var n=t("d3"),i=t("country-regex"),a=t("@turf/area"),o=t("@turf/centroid"),s=t("@turf/bbox"),l=t("./identity"),u=t("./loggers"),c=t("./is_plain_object"),p=t("./nested_property"),h=t("./polygon"),f=Object.keys(i),d={"ISO-3":l,"USA-states":l,"country names":function(t){for(var e=0;e<f.length;e++){var r=f[e];if(new RegExp(i[r]).test(t.trim().toLowerCase()))return r}return u.log("Unrecognized country name: "+t+"."),!1}};function m(t){var e=t.geojson,r=window.PlotlyGeoAssets||{},n="string"==typeof e?r[e]:e;return c(n)?n:(u.error("Oops ... something went wrong when fetching "+e),!1)}e.exports={locationToFeature:function(t,e,r){if(!e||"string"!=typeof e)return!1;var n,i,a,o=d[t](e);if(o){if("USA-states"===t)for(n=[],a=0;a<r.length;a++)(i=r[a]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(a=0;a<n.length;a++)if((i=n[a]).id===o)return i;u.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(t){var e,r,n,i,a=t.geometry,o=a.coordinates,s=t.id,l=[];function u(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];l.push(h.tester(e))}:"ATA"===s?function(t){var e=u(t);if(null===e)return l.push(h.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)e(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)e(o[r])}return l},getTraceGeojson:m,extractTraceFeature:function(t){var e=t[0].trace,r=m(e);if(!r)return!1;var n,i={},s=[];for(n=0;n<e._length;n++){var l=t[n];(l.loc||0===l.loc)&&(i[l.loc]=l)}function c(t){var r=p(t,e.featureidkey||"id").get(),n=i[r];if(n){var l=t.geometry;if("Polygon"===l.type||"MultiPolygon"===l.type){var c={type:"Feature",id:r,geometry:l,properties:{}};c.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,i=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},u=a.default(l);u>i&&(i=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n<h.length;n++)c(h[n]);break;case"Feature":c(r);break;default:return u.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var f in i)u.log(["Location *"+f+"*","does not have a matching feature with id-key","*"+e.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(t){var e=window.PlotlyGeoAssets||{},r=[];function i(t){return new Promise((function(r,i){n.json(t,(function(n,a){if(n){delete e[t];var o=404===n.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t;return i(new Error(o))}return e[t]=a,r(a)}))}))}function a(t){return new Promise((function(r,n){var i=0,a=setInterval((function(){return e[t]&&"pending"!==e[t]?(clearInterval(a),r(e[t])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o<t.length;o++){var s=t[o][0].trace.geojson;"string"==typeof s&&(e[s]?"pending"===e[s]&&r.push(a(s)):(e[s]="pending",r.push(i(s))))}return r},computeBbox:function(t){return s.default(t)}}},{"./identity":210,"./is_plain_object":213,"./loggers":216,"./nested_property":220,"./polygon":224,"@turf/area":7,"@turf/bbox":8,"@turf/centroid":9,"country-regex":13,d3:16}],208:[function(t,e,r){"use strict";var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace.connectgaps,r=[],i=[],a=0;a<t.length;a++){var o=t[a].lonlat;o[0]!==n?i.push(o):!e&&i.length>0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":189}],209:[function(t,e,r){"use strict";var n,i,a,o=t("./mod").mod;function s(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,p=n-e,h=a-e,f=s-a,d=l*f-c*p;if(0===d)return null;var m=(u*f-c*h)/d,g=(u*p-l*h)/d;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,p=n-e,h=o-i,f=u-a,d=c*c+p*p,m=h*h+f*f,g=Math.min(l(c,p,d,i-t,a-e),l(c,p,d,o-t,u-e),l(h,f,m,t-i,e-a),l(h,f,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.x<a?a-r.x:r.x>o?r.x-o:0,p=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p<u;){if(i=(h+f)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;c*o>0?f=i:h=i,p++}return a}},{"./mod":219}],210:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],211:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],212:[function(t,e,r){"use strict";var n=t("d3"),i=t("d3-time-format").utcFormat,a=t("fast-isnumeric"),o=t("../constants/numerical"),s=o.FP_SAFE,l=o.BADNUM,u=e.exports={};u.nestedProperty=t("./nested_property"),u.keyedContainer=t("./keyed_container"),u.relativeAttr=t("./relative_attr"),u.isPlainObject=t("./is_plain_object"),u.toLogRange=t("./to_log_range"),u.relinkPrivateKeys=t("./relink_private");var c=t("./array");u.isTypedArray=c.isTypedArray,u.isArrayOrTypedArray=c.isArrayOrTypedArray,u.isArray1D=c.isArray1D,u.ensureArray=c.ensureArray,u.concat=c.concat,u.maxRowLength=c.maxRowLength,u.minRowLength=c.minRowLength;var p=t("./mod");u.mod=p.mod,u.modHalf=p.modHalf;var h=t("./coerce");u.valObjectMeta=h.valObjectMeta,u.coerce=h.coerce,u.coerce2=h.coerce2,u.coerceFont=h.coerceFont,u.coerceHoverinfo=h.coerceHoverinfo,u.coerceSelectionMarkerOpacity=h.coerceSelectionMarkerOpacity,u.validate=h.validate;var f=t("./dates");u.dateTime2ms=f.dateTime2ms,u.isDateTime=f.isDateTime,u.ms2DateTime=f.ms2DateTime,u.ms2DateTimeLocal=f.ms2DateTimeLocal,u.cleanDate=f.cleanDate,u.isJSDate=f.isJSDate,u.formatDate=f.formatDate,u.incrementMonth=f.incrementMonth,u.dateTick0=f.dateTick0,u.dfltRange=f.dfltRange,u.findExactDates=f.findExactDates,u.MIN_MS=f.MIN_MS,u.MAX_MS=f.MAX_MS;var d=t("./search");u.findBin=d.findBin,u.sorterAsc=d.sorterAsc,u.sorterDes=d.sorterDes,u.distinctVals=d.distinctVals,u.roundUp=d.roundUp,u.sort=d.sort,u.findIndexOfMin=d.findIndexOfMin;var m=t("./stats");u.aggNums=m.aggNums,u.len=m.len,u.mean=m.mean,u.median=m.median,u.midRange=m.midRange,u.variance=m.variance,u.stdev=m.stdev,u.interp=m.interp;var g=t("./matrix");u.init2dArray=g.init2dArray,u.transposeRagged=g.transposeRagged,u.dot=g.dot,u.translationMatrix=g.translationMatrix,u.rotationMatrix=g.rotationMatrix,u.rotationXYMatrix=g.rotationXYMatrix,u.apply3DTransform=g.apply3DTransform,u.apply2DTransform=g.apply2DTransform,u.apply2DTransform2=g.apply2DTransform2,u.convertCssMatrix=g.convertCssMatrix,u.inverseTransformMatrix=g.inverseTransformMatrix;var y=t("./angles");u.deg2rad=y.deg2rad,u.rad2deg=y.rad2deg,u.angleDelta=y.angleDelta,u.angleDist=y.angleDist,u.isFullCircle=y.isFullCircle,u.isAngleInsideSector=y.isAngleInsideSector,u.isPtInsideSector=y.isPtInsideSector,u.pathArc=y.pathArc,u.pathSector=y.pathSector,u.pathAnnulus=y.pathAnnulus;var v=t("./anchor_utils");u.isLeftAnchor=v.isLeftAnchor,u.isCenterAnchor=v.isCenterAnchor,u.isRightAnchor=v.isRightAnchor,u.isTopAnchor=v.isTopAnchor,u.isMiddleAnchor=v.isMiddleAnchor,u.isBottomAnchor=v.isBottomAnchor;var _=t("./geometry2d");u.segmentsIntersect=_.segmentsIntersect,u.segmentDistance=_.segmentDistance,u.getTextLocation=_.getTextLocation,u.clearLocationCache=_.clearLocationCache,u.getVisibleSegment=_.getVisibleSegment,u.findPointOnPath=_.findPointOnPath;var x=t("./extend");u.extendFlat=x.extendFlat,u.extendDeep=x.extendDeep,u.extendDeepAll=x.extendDeepAll,u.extendDeepNoArrays=x.extendDeepNoArrays;var b=t("./loggers");u.log=b.log,u.warn=b.warn,u.error=b.error;var w=t("./regex");u.counterRegex=w.counter;var T=t("./throttle");u.throttle=T.throttle,u.throttleDone=T.done,u.clearThrottle=T.clear;var k=t("./dom");function A(t){var e={};for(var r in t)for(var n=t[r],i=0;i<n.length;i++)e[n[i]]=+r;return e}u.getGraphDiv=k.getGraphDiv,u.isPlotDiv=k.isPlotDiv,u.removeElement=k.removeElement,u.addStyleRule=k.addStyleRule,u.addRelatedStyleRule=k.addRelatedStyleRule,u.deleteRelatedStyleRule=k.deleteRelatedStyleRule,u.getFullTransformMatrix=k.getFullTransformMatrix,u.getElementTransformMatrix=k.getElementTransformMatrix,u.getElementAndAncestors=k.getElementAndAncestors,u.equalDomRects=k.equalDomRects,u.clearResponsive=t("./clear_responsive"),u.preserveDrawingBuffer=t("./preserve_drawing_buffer"),u.makeTraceGroups=t("./make_trace_groups"),u._=t("./localize"),u.notifier=t("./notifier"),u.filterUnique=t("./filter_unique"),u.filterVisible=t("./filter_visible"),u.pushUnique=t("./push_unique"),u.increment=t("./increment"),u.cleanNumber=t("./clean_number"),u.ensureNumber=function(t){return a(t)?(t=Number(t))<-s||t>s?l:a(t)?Number(t):l:l},u.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(a(t)&&t>=0&&t%1==0)},u.noop=t("./noop"),u.identity=t("./identity"),u.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},u.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;i<e.length;i++){var a=e[i],o=u.nestedProperty(t,a.replace("?",r)),s=u.nestedProperty(t,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(t){t.parentNode.appendChild(t)},u.cancelTransition=function(t){return t.transition().duration(0)},u.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s<a;s++)o[s]=e(t[s],r,n,i);return o},u.randstr=function t(e,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var p=parseInt(l,n);return e&&e[l]||p!==1/0&&p>=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},u.syncOrAsync=function(t,e,r){var n;function i(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,u.promiseError);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?i=!0:a=!1;if(i&&!a)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},u.mergeArray=function(t,e,r,n){var i="function"==typeof n;if(u.isArrayOrTypedArray(t))for(var a=Math.min(t.length,e.length),o=0;o<a;o++){var s=t[o];e[o][r]=i?n(s):s}},u.mergeArrayCastPositive=function(t,e,r){return u.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},u.castOption=function(t,e,r,n){n=n||u.identity;var i=u.nestedProperty(t,r).get();return u.isArrayOrTypedArray(i)?Array.isArray(e)&&u.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},u.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=u.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},u.tagSelected=function(t,e,r){var n,i,a=e.selectedpoints,o=e._indexToPoints;o&&(n=A(o));for(var s=0;s<a.length;s++){var l=a[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,p=r?r[c]:c;void 0!==(i=p)&&i<t.length&&(t[p].selected=1)}}},u.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=A(r),i=[],a=0;a<e.length;a++){var o=e[a];if(u.isIndex(o)){var s=n[o];u.isIndex(s)&&i.push(s)}}return i}return e},u.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=u.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},u.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,i,a,o=Object.keys(t);for(n=0;n<o.length;n++)a=t[i=o[n]],"_"!==i.charAt(0)&&"function"!=typeof a&&("module"===i?r[i]=a:Array.isArray(a)?r[i]="colorscale"===i?a.slice():a.slice(0,3):u.isTypedArray(a)?r[i]=a.subarray(0,3):r[i]=a&&"object"==typeof a?u.minExtend(t[i],e[i]):a);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(a=e[i=o[n]])&&i in r&&"object"==typeof r[i]||(r[i]=a);return r},u.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},u.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},u.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var M=/MSIE [1-9]\./;u.isIE9orBelow=function(){return u.isIE()&&M.test(window.navigator.userAgent)};var S=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return S.test(window.navigator.userAgent)};var C=/iPad|iPhone|iPod/;u.isIOS=function(){return C.test(window.navigator.userAgent)},u.isD3Selection=function(t){return t&&"function"==typeof t.classed},u.ensureSingle=function(t,e,r,n){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var a=t.append(e);return r&&a.classed(r,!0),n&&a.call(n),a},u.ensureSingleById=function(t,e,r,n){var i=t.select(e+"#"+r);if(i.size())return i;var a=t.append(e).attr("id",r);return n&&a.call(n),a},u.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var L=/^([^\[\.]+)\.(.+)?/,E=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;u.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(L))?(i=t[r],n=e[1],delete t[r],t[n]=u.extendDeepNoArrays(t[n]||{},u.objectFromPath(r,u.expandObjectPaths(i))[n])):(e=r.match(E))?(i=t[r],n=e[1],a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],o=t[n][a]=t[n][a]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)))):t[n][a]=u.expandObjectPaths(i)):t[r]=u.expandObjectPaths(t[r]));return t},u.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n]()),u.isValidTextValue(i)?i:""}))};var z={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return O.apply(z,arguments)};var P={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return O.apply(P,arguments)};var D=/^[:|\|]/;function O(t,e,r){var a=this,o=arguments;e||(e={});var s={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,l,c){var p,h,f,d;for(f=3;f<o.length;f++)if(p=o[f]){if(p.hasOwnProperty(l)){h=p[l];break}if(I.test(l)||(h=s[l]||u.nestedProperty(p,l).get())&&(s[l]=h),void 0!==h)break}if(void 0===h&&a)return a.count<a.max&&(u.warn("Variable '"+l+"' in "+a.name+" could not be found!"),h=t),a.count===a.max&&u.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,t;if(c){if(":"===c[0]&&(h=(d=r?r.numberFormat:n.format)(c.replace(D,""))(h)),"|"===c[0]){d=r?r.timeFormat:i;var m=u.dateTime2ms(h);h=u.formatDate(m,c.replace(D,""),!1,d)}}else e.hasOwnProperty(l+"Label")&&(h=e[l+"Label"]);return h}))}u.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var R=2e9;u.seedPseudoRandom=function(){R=2e9},u.pseudoRandom=function(){var t=R;return R=(69069*R+1)%4294967296,Math.abs(R-t)<429496729?u.pseudoRandom():R/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},u.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},u.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},u.strRotate=function(t){return t?"rotate("+t+")":""},u.strScale=function(t){return 1!==t?"scale("+t+")":""},u.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,i=t.targetX,a=t.targetY,o=t.anchorX||0,s=t.anchorY||0,l=t.rotate,c=t.scale;return c?c>1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)}},{"../constants/numerical":189,"./anchor_utils":194,"./angles":195,"./array":196,"./clean_number":197,"./clear_responsive":199,"./coerce":200,"./dates":201,"./dom":202,"./extend":204,"./filter_unique":205,"./filter_visible":206,"./geometry2d":209,"./identity":210,"./increment":211,"./is_plain_object":213,"./keyed_container":214,"./localize":215,"./loggers":216,"./make_trace_groups":217,"./matrix":218,"./mod":219,"./nested_property":220,"./noop":221,"./notifier":222,"./preserve_drawing_buffer":225,"./push_unique":226,"./regex":228,"./relative_attr":229,"./relink_private":230,"./search":231,"./stats":233,"./throttle":235,"./to_log_range":236,d3:16,"d3-time-format":14,"fast-isnumeric":18}],213:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],214:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o<s.length;o++)c[s[o][r]]=o;var p=i.test(a),h={set:function(t,e){var i=null===e?4:0;if(!s){if(!l||4===i)return;s=[],l.set(s)}var o=c[t];if(void 0===o){if(4===i)return;i|=3,o=s.length,c[t]=o}else e!==(p?s[o][a]:n(s[o],a).get())&&(i|=2);var f=s[o]=s[o]||{};return f[r]=t,p?f[a]=e:n(f,a).set(e),null!==e&&(i&=-5),u[o]=u[o]|i,h},get:function(t){if(s){var e=c[t];return void 0===e?void 0:p?s[e][a]:n(s[e],a).get()}},rename:function(t,e){var n=c[t];return void 0===n||(u[n]=1|u[n],c[e]=n,delete c[t],s[n][r]=e),h},remove:function(t){var e=c[t];if(void 0===e)return h;var i=s[e];if(Object.keys(i).length>2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o<s.length;o++)u[o]=3|u[o];for(o=e;o<s.length;o++)c[s[o][r]]--;s.splice(e,1),delete c[t]}else n(i,a).set(null),u[e]=6|u[e];return h},constructUpdate:function(){for(var t,i,o={},l=Object.keys(u),c=0;c<l.length;c++)i=l[c],t=e+"["+i+"]",s[i]?(1&u[i]&&(o[t+"."+r]=s[i][r]),2&u[i]&&(o[t+"."+a]=p?4&u[i]?null:s[i][a]:4&u[i]?null:n(s[i],a).get())):o[t]=null;return o}};return h}},{"./nested_property":220}],215:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=n.localeRegistry}var u=r.split("-")[0];if(u===r)break;r=u}return e}},{"../registry":308}],216:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,i=t("./notifier"),a=e.exports={};function o(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}a.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.error,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":245,"./notifier":222}],217:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{d3:16}],218:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=r.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply3DTransform=function(t){return function(){var e=arguments,n=1===arguments.length?e[0]:[e[0],e[1],e[2]||0];return r.dot(t,[n[0],n[1],n[2],1]).slice(0,3)}},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}},r.convertCssMatrix=function(t){if(t){var e=t.length;if(16===e)return t;if(6===e)return[t[0],t[1],0,0,t[2],t[3],0,0,0,0,1,0,t[4],t[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},r.inverseTransformMatrix=function(t){var e=[];return n.invert(e,t),[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}},{"gl-mat4":34}],219:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],220:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s<e.length-1;s++){if(-1===(r=e[s])){for(n=!0,o=[],l=0;l<u.length;l++)o[l]=a(u[l],e.slice(s+1))(),o[l]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!i(u))return;if("object"!=typeof(u=u[r])||null===u)return}if("object"==typeof u&&null!==u&&null!==(o=u[e[s]]))return o}}e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,u=e.split(".");s<u.length;){if(r=String(u[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])u[s]=r[1];else{if(0!==s)throw"bad property string";u.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,u.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,u):{set:l(t,u,e),get:a(t,u),astr:e,parts:u,obj:t}};var o=/(^|\.)args\[/;function s(t,e){return void 0===t||null===t&&!e.match(o)}function l(t,e,r){return function(n){var a,o,l=t,h="",f=[[t,h]],d=s(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(a=e[o])&&!i(l))throw"array index but container is not an array";if(-1===a){if(d=!c(l,e.slice(o+1),n,r))break;return}if(!p(l,a,e[o+1],d))break;if("object"!=typeof(l=l[a])||null===l)throw"container is not an object";h=u(h,a),f.push([l,h])}if(d){if(o===e.length-1&&(delete l[e[o]],Array.isArray(l)&&+e[o]==l.length-1))for(;l.length&&void 0===l[l.length-1];)l.pop()}else l[e[o]]=n}}function u(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function c(t,e,r,n){var a,o=i(r),u=!0,c=r,h=n.replace("-1",0),f=!o&&s(r,h),d=e[0];for(a=0;a<t.length;a++)h=n.replace("-1",a),o&&(f=s(c=r[a%r.length],h)),f&&(u=!1),p(t,a,d,f)&&l(t[a],e,n.replace("-1",a))(c);return u}function p(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":196,"fast-isnumeric":18}],221:[function(t,e,r){"use strict";e.exports=function(){}},{}],222:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){if(-1===a.indexOf(t)){a.push(t);var r=1e3;i(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(t){var i=n.select(this);i.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){i.transition().call(s)}));for(var a=i.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&a.append("br"),a.append("span").text(o[l]);"stick"===e?i.transition().duration(350).style("opacity",1):i.transition().duration(700).style("opacity",1).transition().delay(r).call(s)}))}function s(t){t.duration(700).style("opacity",0).each("end",(function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),n.select(this).remove()}))}}},{d3:16,"fast-isnumeric":18}],223:[function(t,e,r){"use strict";var n=t("./setcursor"),i="data-savedcursor";e.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var a=(t.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&t.attr(i,s.substr(7)).classed(s,!1)}t.attr(i)||t.attr(i,"!!")}n(t,e)}else r&&(t.attr(i,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":232}],224:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=t("../constants/numerical").BADNUM,a=e.exports={};a.tester=function(t){var e,r=t.slice(),n=r[0][0],a=n,o=r[0][1],s=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),a=Math.max(a,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,l=function(t){return t[1]===r[0][1]}));var c=!0,p=r[0];for(e=1;e<r.length;e++)if(p[0]!==r[e][0]||p[1]!==r[e][1]){c=!1;break}return{xmin:n,xmax:a,ymin:o,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],u=t[1];return!(r===i||r<n||r>a||u===i||u<o||u>s)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||l<n||l>a||u===i||u<o||u>s)return!1;var c,p,h,f,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(c=1;c<m;c++)if(p=g,h=y,g=r[c][0],y=r[c][1],!(l<(f=Math.min(p,g))||l>Math.max(p,g)||u>Math.max(h,y)))if(u<Math.min(h,y))l!==f&&v++;else{if(u===(d=g===p?u:h+(l-p)*(y-h)/(g-p)))return 1!==c||!e;u<=d&&l!==f&&v++}return v%2==1},isRect:u,degenerate:c}},a.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),p=Math.sqrt(c),h=[-u[1]/p,u[0]/p];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=n(o,u))<0||s>c||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||a.isSegmentBent(t,l,u+1,e))&&(r.push(t[u]),r.length<s-2&&(n=u,i=r.length-1),l=u)}t.length>1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":189,"./matrix":218}],225:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o<a.length;o++){if(-1!==a[o].indexOf("Safari"))for(var s=o-1;s>-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":18,"is-mobile":52}],226:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],227:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_config").dfltConfig;var a={add:function(t,e,r,n,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(a)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)a.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)a.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};a.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,i=[],a=0;a<e.length;a++)r=e[a],i[a]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return i}(t,r),e.apply(null,r)},e.exports=a},{"../lib":212,"../plot_api/plot_config":245}],228:[function(t,e,r){"use strict";r.counter=function(t,e,r,n){var i=(e||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===t?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+t+"([2-9]|[1-9][0-9]+)?"+i)}},{}],229:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,i=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(i))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],230:[function(t,e,r){"use strict";var n=t("./array").isArrayOrTypedArray,i=t("./is_plain_object");e.exports=function t(e,r){for(var a in r){var o=r[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(n(o)&&n(s)&&i(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),u=0;u<l;u++)s[u]!==o[u]&&i(o[u])&&i(s[u])&&t(s[u],o[u])}else i(o)&&i(s)&&(t(s,o),Object.keys(s).length||delete e[a])}}},{"./array":196,"./is_plain_object":213}],231:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./loggers"),a=t("./identity"),o=t("../constants/numerical").BADNUM;function s(t,e){return t<e}function l(t,e){return t<=e}function u(t,e){return t>e}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p<h&&f++<100;)o(e[a=Math.floor((p+h)/2)],t)?p=a+1:h=a;return f>90&&i.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t,e){var n,i=(e||{}).unitMinDiff,a=t.slice();for(a.sort(r.sorterAsc),n=a.length-1;n>-1&&a[n]===o;n--);var s=1;i||(s=a[n]-a[0]||1);for(var l,u=s/(n||1)/1e4,c=[],p=0;p<=n;p++){var h=a[p],f=h-l;void 0===l?(c.push(h),l=h):f>u&&(s=Math.min(s,f),c.push(h),l=h)}return{vals:c,minDiff:s}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=u((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]},r.sort=function(t,e){for(var r=0,n=0,i=1;i<t.length;i++){var a=e(t[i],t[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;i<t.length;i++){var o=e(t[i]);o<n&&(n=o,r=i)}return r}},{"../constants/numerical":189,"./identity":210,"./loggers":216,"fast-isnumeric":18}],232:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}},{}],233:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=r.aggNums(t,e,a[s]);a=l}for(s=0;s<o;s++)n(e)?n(a[s])&&(e=t(+e,+a[s])):e=a[s];return e},r.len=function(t){return r.aggNums((function(t){return t+1}),0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums((function(t,e){return t+e}),0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums((function(t,e){return t+Math.pow(e-i,2)}),0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.median=function(t){var e=t.slice().sort();return r.interp(e,.5)},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":196,"fast-isnumeric":18}],234:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var S=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&S.match(u),E=n.select(t.node().parentNode);if(!E.empty()){var I=t.attr("class")?t.attr("class").split(" ")[0]:"text";return I+="-math",E.selectAll("svg."+I).remove(),E.selectAll("g."+I+"-group").remove(),t.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(p,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(L[2],o,(function(n,i,o){E.selectAll("svg."+I).remove(),E.selectAll("g."+I+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return z(),void e();var u=E.append("g").classed(I+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});u.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:I,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",p=s.select("g");p.attr({fill:c,stroke:c});var h=l(p,"width"),f=l(p,"height"),d=+t.attr("x")-h*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=-(r||l(t,"height"))/4;"y"===I[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+a(-h/2,m-f/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===I[0]?s.attr({x:t.attr("x"),y:m-f/2}):"a"===I[0]&&0!==I.indexOf("atitle")?s.attr({x:0,y:m}):s.attr({x:d,y:+t.attr("y")+m-f/2}),M&&M.call(t,u),e(u)}))}))):z(),t}function z(){E.empty()||(I=t.attr("class")+"-math",E.select("svg."+I).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a<i.length;a++)p(i[a])}function p(t){var e,i=t.type,a={};if("a"===i){e="a";var s=t.target,u=t.href,c=t.popup;u&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":u},c&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+c+'");return false;'))}else e="tspan";t.style&&(a.style=t.style);var p=document.createElementNS(o.svg,e);if("sup"===i||"sub"===i){M(r,"\u200b"),r.appendChild(p);var h=document.createElementNS(o.svg,"tspan");M(h,"\u200b"),n.select(h).attr("dy",d[i]),a.dy=f[i],r.appendChild(p),r.appendChild(h)}else r.appendChild(p);n.select(p).attr(a),r=t.node=p,l.push(t)}function M(t,e){t.appendChild(document.createTextNode(e))}function S(t){if(1!==l.length){var n=l.pop();t!==n.type&&i.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag </"+t+">.",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var L=e.split(y),E=0;E<L.length;E++){var I=L[E],z=I.match(v),P=z&&z[2].toLowerCase(),D=h[P];if("br"===P)c();else if(void 0===D)M(r,C(I));else if(z[1])S(P);else{var O=z[4],R={type:P},F=k(O,x);if(F?(F=F.replace(A,"$1 fill:"),D&&(F+=";"+D)):D&&(F=D),F&&(R.style=F),"a"===P){a=!0;var B=k(O,b);if(B){var N=document.createElement("a");N.href=B,-1!==m.indexOf(N.protocol)&&(R.href=encodeURI(decodeURI(B)),R.target=k(O,w)||"_blank",R.popup=k(O,T))}}p(R)}}return a}(t.node(),S)&&t.style("pointer-events","all"),r.positionText(t),M&&M.call(t)}};var c=/(<|&lt;|&#60;)/g,p=/(>|&gt;|&#62;)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(y),o=[],s="",l=0,u=0;u<a.length;u++){var c=a[u],p=c.match(v),h=p&&p[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(o.push(c),s=h);else{var f=c.length;if(l+f<r)o.push(c),l+=f;else if(l<r){var d=r-l;s&&("br"!==s||d<=i||f<=i)&&o.pop(),r>i?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function L(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=a()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;o<a.length;o++){var s=a[o],l=s.match(v),u=l&&l[2].toLowerCase();if(u in h)if(l[1])i.length&&(r=i.pop());else{var c=l[4],p=k(c,x),f=p?{style:p}:{};if("a"===u){var d=k(c,b);if(d){var _=document.createElement("a");if(_.href=d,-1!==m.indexOf(_.protocol)){f.href=encodeURI(decodeURI(d));var T=k(c,w);T&&(f.target=T)}}}var A=document.createElement(u);r.appendChild(A),n.select(A).attr(f),r=A,i.push(A)}else r.appendChild(document.createTextNode(C(s)))}return e.innerHTML},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each((function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})}))},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=n.select(r).select(".svg-container"),o=i.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(L(t,i,e)).on("blur",(function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)})).on("focus",(function(){var t=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(L(t,i,e)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":185,"../constants/xmlns_namespaces":190,"../lib":212,d3:16}],235:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].ts<o-6e4&&delete n[s];a=n[t]={ts:0,timer:null}}function l(){r(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}i(a),o>a.ts+e?l():a.timer=setTimeout((function(){l(),a.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],236:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":18}],237:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],238:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],239:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if((r=t.match(a[s]))&&0===r.index){e=r[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":308}],240:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},l=o.flags.slice().concat(["fullReplot"]),u=s.flags.slice().concat("layoutReplot");function c(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function p(t,e,r){var n=i({},t);for(var o in n){var s=n[o];a(s)&&(n[o]=h(s,e,r,o))}return"from-root"===r&&(n.editType=e),n}function h(t,e,r,n){if(t.valType){var a=i({},t);if(a.editType=e,Array.isArray(t.items)){a.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)a.items[o]=h(t.items[o],e,"from-root")}return a}return p(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:s,traceFlags:function(){return c(l)},layoutFlags:function(){return c(u)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:p}},{"../lib":212}],241:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("gl-mat4/fromQuat"),a=t("../registry"),o=t("../lib"),s=t("../plots/plots"),l=t("../plots/cartesian/axis_ids"),u=t("../components/color"),c=l.cleanId,p=l.getFromTrace,h=a.traceIs;function f(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n,!0))}function d(t){function e(e,r){var n=t[e],i=t.title&&t.title[r];n&&!i&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function m(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function g(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var i,a=Math.min(t.length,e.length);for(i=0;i<a&&t.charAt(i)===e.charAt(i);i++);return t.substr(0,i).trim()}function y(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function v(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e<m.length;e++){var g=m[e];if(a&&a.test(g)){var y=t[g];y.anchor&&"free"!==y.anchor&&(y.anchor=c(y.anchor)),y.overlaying&&(y.overlaying=c(y.overlaying)),y.type||(y.isdate?y.type="date":y.islog?y.type="log":!1===y.isdate&&!1===y.islog&&(y.type="linear")),"withzero"!==y.autorange&&"tozero"!==y.autorange||(y.autorange=!0,y.rangemode="tozero"),delete y.islog,delete y.isdate,delete y.categories,v(y,"domain")&&delete y.domain,void 0!==y.autotick&&(void 0===y.tickmode&&(y.tickmode=y.autotick?"auto":"linear"),delete y.autotick),d(y)}else if(l&&l.test(g)){d(t[g].radialaxis)}else if(p&&p.test(g)){var _=t[g];d(_.aaxis),d(_.baxis),d(_.caxis)}else if(h&&h.test(g)){var x=t[g],b=x.cameraposition;if(Array.isArray(b)&&4===b[0].length){var w=b[0],T=b[1],k=b[2],A=i([],w),M=[];for(n=0;n<3;++n)M[n]=T[n]+k*A[2+4*n];x.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:T[0],y:T[1],z:T[2]},up:{x:0,y:0,z:1}},delete x.cameraposition}d(x.xaxis),d(x.yaxis),d(x.zaxis)}}var S=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<S;e++){var C=t.annotations[e];o.isPlainObject(C)&&(C.ref&&("paper"===C.ref?(C.xref="paper",C.yref="paper"):"data"===C.ref&&(C.xref="x",C.yref="y"),delete C.ref),f(C,"xref"),f(C,"yref"))}var L=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<L;e++){var E=t.shapes[e];o.isPlainObject(E)&&(f(E,"xref"),f(E,"yref"))}var I=Array.isArray(t.images)?t.images.length:0;for(e=0;e<I;e++){var z=t.images[e];o.isPlainObject(z)&&(f(z,"xref"),f(z,"yref"))}var P=t.legend;return P&&(P.x>3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e<t.length;e++){var n,i=t[e];if("histogramy"===i.type&&"xbins"in i&&!("ybins"in i)&&(i.ybins=i.xbins,delete i.xbins),i.error_y&&"opacity"in i.error_y){var l=u.defaults,p=i.error_y.color||(h(i,"bar")?u.defaultLine:l[e%l.length]);i.error_y.color=u.addOpacity(u.rgb(p),u.opacity(p)*i.error_y.opacity),delete i.error_y.opacity}if("bardir"in i&&("h"!==i.bardir||!h(i,"bar")&&"histogram"!==i.type.substr(0,9)||(i.orientation="h",r.swapXYData(i)),delete i.bardir),"histogramy"===i.type&&r.swapXYData(i),"histogramx"!==i.type&&"histogramy"!==i.type||(i.type="histogram"),"scl"in i&&!("colorscale"in i)&&(i.colorscale=i.scl,delete i.scl),"reversescl"in i&&!("reversescale"in i)&&(i.reversescale=i.reversescl,delete i.reversescl),i.xaxis&&(i.xaxis=c(i.xaxis,"x")),i.yaxis&&(i.yaxis=c(i.yaxis,"y")),h(i,"gl3d")&&i.scene&&(i.scene=s.subplotsRegistry.gl3d.cleanId(i.scene)),!h(i,"pie-like")&&!h(i,"bar-like"))if(Array.isArray(i.textposition))for(n=0;n<i.textposition.length;n++)i.textposition[n]=y(i.textposition[n]);else i.textposition&&(i.textposition=y(i.textposition));var f=a.getModule(i);if(f&&f.colorbar){var _=f.colorbar.container,x=_?i[_]:i;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===i.type&&o.isPlainObject(i.contours)){var b=["x","y","z"];for(n=0;n<b.length;n++){var w=i.contours[b[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===i.type||"ohlc"===i.type){var T=!1!==(i.increasing||{}).showlegend,k=!1!==(i.decreasing||{}).showlegend,A=m(i.increasing),M=m(i.decreasing);if(!1!==A&&!1!==M){var S=g(A,M,T,k);S&&(i.name=S)}else!A&&!M||i.name||(i.name=A||M)}if(Array.isArray(i.transforms)){var C=i.transforms;for(n=0;n<C.length;n++){var L=C[n];if(o.isPlainObject(L))switch(L.type){case"filter":L.filtersrc&&(L.target=L.filtersrc,delete L.filtersrc),L.calendar&&(L.valuecalendar||(L.valuecalendar=L.calendar),delete L.calendar);break;case"groupby":if(L.styles=L.styles||L.style,L.styles&&!Array.isArray(L.styles)){var E=L.styles,I=Object.keys(E);L.styles=[];for(var z=0;z<I.length;z++)L.styles.push({target:I[z],value:E[I[z]]})}}}}v(i,"line")&&delete i.line,"marker"in i&&(v(i.marker,"line")&&delete i.marker.line,v(i,"marker")&&delete i.marker),u.clean(i),i.autobinx&&(delete i.autobinx,delete i.xbins),i.autobiny&&(delete i.autobiny,delete i.ybins),d(i),i.colorbar&&d(i.colorbar),i.marker&&i.marker.colorbar&&d(i.marker.colorbar),i.line&&i.line.colorbar&&d(i.line.colorbar),i.aaxis&&d(i.aaxis),i.baxis&&d(i.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var i=t.hoverinfo.split("+");for(e=0;e<i.length;e++)"x"===i[e]?i[e]="y":"y"===i[e]&&(i[e]="x");t.hoverinfo=i.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map((function(t,e){return e}));if(Array.isArray(e)){for(var r=[],i=0;i<e.length;i++)o.isIndex(e[i],t.data.length)?r.push(e[i]):o.warn("trace index (",e[i],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var i=t.obj,a=t.parts,s=a.length,l=a[s-1],u=n(l);if(u&&null===e){var c=a.slice(0,s-1).join(".");o.nestedProperty(i,c).get().splice(l,1)}else u&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var _=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(t){var e=t.search(_);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var i=t._fullData[n],a=0;a<3;a++){var s=p(t,i,b[a]);if(s&&"log"!==s.type){var l=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;l=u+"."+l}var c=l+".type";void 0===r[l]&&void 0===r[c]&&o.nestedProperty(t.layout,c).set(null)}}}},{"../components/color":83,"../lib":212,"../plots/cartesian/axis_ids":261,"../plots/plots":299,"../registry":308,"fast-isnumeric":18,"gl-mat4/fromQuat":24}],242:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var i=t("./template_api");r.makeTemplate=i.makeTemplate,r.validateTemplate=i.validateTemplate},{"../snapshot/download":310,"./plot_api":244,"./template_api":249,"./to_image":250,"./validate":251}],243:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),i=t("../lib/noop"),a=t("../lib/loggers"),o=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var l=r.isAddVal=function(t){return"add"===t||n(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,c){var p=e.astr,h=s.getComponentMethod(p,"supplyLayoutDefaults"),f=s.getComponentMethod(p,"draw"),d=s.getComponentMethod(p,"drawOne"),m=n.replot||n.recalc||h===i||f===i,g=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&a.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(g,y),f(t),!0)}var _,x,b,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],E=c(y,p).get(),I=[],z=-1,P=L.length;for(_=0;_<S.length;_++)if(w=r[b=S[_]],T=Object.keys(w),k=w[""],A=l(k),b<0||b>L.length-(A?0:1))a.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?I.push(b):A?("add"===k&&(k={}),L.splice(b,0,k),E&&E.splice(b,0,{})):a.warn("Unrecognized full object edit value",p,b,k),-1===z&&(z=b);else for(x=0;x<T.length;x++)M=p+"["+b+"].",c(L[b],T[x],M).set(w[T[x]]);for(_=I.length-1;_>=0;_--)L.splice(I[_],1),E&&E.splice(I[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(g,y),d!==i){var D;if(-1===z)D=S;else{for(P=Math.max(L.length,P),D=[],_=0;_<S.length&&!((b=S[_])>=z);_++)D.push(b);for(_=z;_<P;_++)D.push(_)}for(_=0;_<D.length;_++)d(t,D[_])}else f(t);return!0}},{"../lib/is_plain_object":213,"../lib/loggers":216,"../lib/noop":221,"../lib/search":231,"../registry":308,"./container_array_match":239}],244:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("has-hover"),o=t("../lib"),s=o.nestedProperty,l=t("../lib/events"),u=t("../lib/queue"),c=t("../registry"),p=t("./plot_schema"),h=t("../plots/plots"),f=t("../plots/polar/legacy"),d=t("../plots/cartesian/axes"),m=t("../components/drawing"),g=t("../components/color"),y=t("../plots/cartesian/graph_interact").initInteractions,v=t("../constants/xmlns_namespaces"),_=t("../lib/svg_text_utils"),x=t("../plots/cartesian/select").clearSelect,b=t("./plot_config").dfltConfig,w=t("./manage_arrays"),T=t("./helpers"),k=t("./subroutines"),A=t("./edit_types"),M=t("../plots/cartesian/constants").AX_NAME_PATTERN,S=0;function C(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function L(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function E(t,e){L(t,g.combine(e,"white"))}function I(t,e){if(!t._context){t._context=o.extendDeep({},b);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var i,s,l,u=t._context;if(e){for(s=Object.keys(e),i=0;i<s.length;i++)"editable"!==(l=s[i])&&"edits"!==l&&l in u&&("setBackground"===l&&"opaque"===e[l]?u[l]=E:u[l]=e[l]);e.plot3dPixelRatio&&!u.plotGlPixelRatio&&(u.plotGlPixelRatio=u.plot3dPixelRatio);var c=e.editable;if(void 0!==c)for(u.editable=c,s=Object.keys(u.edits),i=0;i<s.length;i++)u.edits[s[i]]=c;if(e.edits)for(s=Object.keys(e.edits),i=0;i<s.length;i++)(l=s[i])in u.edits&&(u.edits[l]=e.edits[l]);u._exportedPlot=e._exportedPlot}u.staticPlot&&(u.editable=!1,u.edits={},u.autosizable=!1,u.scrollZoom=!1,u.doubleClick=!1,u.showTips=!1,u.showLink=!1,u.displayModeBar=!1),"hover"!==u.displayModeBar||a||(u.displayModeBar=!0),"transparent"!==u.setBackground&&"function"==typeof u.setBackground||(u.setBackground=L),u._hasZeroHeight=u._hasZeroHeight||0===t.clientHeight,u._hasZeroWidth=u._hasZeroWidth||0===t.clientWidth;var p=u.scrollZoom,h=u._scrollZoom={};if(!0===p)h.cartesian=1,h.gl3d=1,h.geo=1,h.mapbox=1;else if("string"==typeof p){var f=p.split("+");for(i=0;i<f.length;i++)h[f[i]]=1}else!1!==p&&(h.gl3d=1,h.geo=1,h.mapbox=1)}function z(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function P(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&P(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=z(r,t.data.length-1),e)for(var m=0;m<r.length;m++){if(a=t.data[r[m]],l=(u=s(a,d)).get(),c=e[d][m],!o.isArrayOrTypedArray(c))throw new Error("attribute: "+d+" index: "+m+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+d);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+d);p=h?n[d][m]:n,i(p)||(p=-1),f.push({prop:u,target:l,insert:c,maxp:Math.floor(p)})}return f}(t,e,r,n),u={},c={},p=0;p<l.length;p++){var h=l[p].prop,f=l[p].maxp,d=a(l[p].target,l[p].insert,f);h.set(d[0]),Array.isArray(u[h.astr])||(u[h.astr]=[]),u[h.astr].push(d[1]),Array.isArray(c[h.astr])||(c[h.astr]=[]),c[h.astr].push(l[p].target.length)}return{update:u,maxPoints:c}}function R(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function F(t,e,n,i){t=o.getGraphDiv(t),T.clearPromiseQueue(t);var a={};if("string"==typeof e)a[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,i),Promise.reject();a=o.extendFlat({},e),void 0===i&&(i=n)}Object.keys(a).length&&(t.changed=!0);var s=T.coerceTraceIndices(t,i),l=j(t,a,s),c=l.flags;c.calc&&(t.calcdata=void 0),c.clearAxisTypes&&T.clearAxisTypes(t,s,{});var p=[];c.fullReplot?p.push(r.plot):(p.push(h.previousPromises),h.supplyDefaults(t),c.markerSize&&(h.doCalcdata(t),Z(p)),c.style&&p.push(k.doTraceStyle),c.colorbars&&p.push(k.doColorBars),p.push(C)),p.push(h.rehover,h.redrag),u.add(t,F,[t,l.undoit,l.traces],F,[t,l.redoit,l.traces]);var f=o.syncOrAsync(p,t);return f&&f.then||(f=Promise.resolve()),f.then((function(){return t.emit("plotly_restyle",l.eventData),t}))}function B(t){return void 0===t?null:t}function N(t,e){return e?function(e,r,n){var i=s(e,r),a=i.set;return i.set=function(e){U((n||"")+r,i.get(),e,t),a(e)},i}:s}function U(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var i=Array.isArray(e)?e:[],a=Array.isArray(r)?r:[],s=Math.max(i.length,a.length),l=0;l<s;l++)U(t+"["+l+"]",i[l],a[l],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var u=o.isPlainObject(e)?e:{},c=o.isPlainObject(r)?r:{},p=o.extendFlat({},u,c);for(var h in p)U(t+"."+h,u[h],c[h],n)}else void 0===n[t]&&(n[t]=B(e))}function j(t,e,r){var n,i=t._fullLayout,a=t._fullData,l=t.data,u=i._guiEditing,f=N(i._preGUI,u),m=o.extendDeepAll({},e);V(e);var g,y=A.traceFlags(),v={},_={};function x(){return r.map((function(){}))}function b(t){var e=d.id2name(t);-1===g.indexOf(e)&&g.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function k(t){return"LAYOUT"+t+".range"}function M(t){for(var e=t;e<a.length;e++)if(a[e]._input===l[t])return a[e]}function S(n,a,o){if(Array.isArray(n))n.forEach((function(t){S(t,a,o)}));else if(!(n in e)&&!T.hasParent(e,n)){var s;if("LAYOUT"===n.substr(0,6))s=f(t.layout,n.replace("LAYOUT",""));else{var c=r[o];s=N(i._tracePreGUI[M(c)._fullInput.uid],u)(l[c],n)}n in _||(_[n]=x()),void 0===_[n][o]&&(_[n][o]=B(s.get())),void 0!==a&&s.set(a)}}function C(t){return function(e){return a[e][t]}}function L(t){return function(e,n){return!1===e?a[r[n]][t]:null}}for(var E in e){if(T.hasParent(e,E))throw new Error("cannot set "+E+" and a parent attribute simultaneously");var I,z,P,D,O,R,F=e[E];if("autobinx"!==E&&"autobiny"!==E||(E=E.charAt(E.length-1)+"bins",F=Array.isArray(F)?F.map(L(E)):!1===F?r.map(C(E)):null),v[E]=F,"LAYOUT"!==E.substr(0,6)){for(_[E]=x(),n=0;n<r.length;n++){if(I=l[r[n]],z=M(r[n]),D=(P=N(i._tracePreGUI[z._fullInput.uid],u)(I,E)).get(),void 0!==(O=Array.isArray(F)?F[n%F.length]:F)){var U=P.parts[P.parts.length-1],j=E.substr(0,E.length-U.length-1),q=j?j+".":"",H=j?s(z,j).get():z;if((R=p.getTraceValObject(z,P.parts))&&R.impliedEdits&&null!==O)for(var Z in R.impliedEdits)S(o.relativeAttr(E,Z),R.impliedEdits[Z],n);else if("thicknessmode"!==U&&"lenmode"!==U||D===O||"fraction"!==O&&"pixels"!==O||!H){if("type"===E&&("pie"===O!=("pie"===D)||"funnelarea"===O!=("funnelarea"===D))){var G="x",X="y";"bar"!==O&&"bar"!==D||"h"!==I.orientation||(G="y",X="x"),o.swapAttrs(I,["?","?src"],"labels",G),o.swapAttrs(I,["d?","?0"],"label",G),o.swapAttrs(I,["?","?src"],"values",X),"pie"===D||"funnelarea"===D?(s(I,"marker.color").set(s(I,"marker.colors").get()),i._pielayer.selectAll("g.trace").remove()):c.traceIs(I,"cartesian")&&s(I,"marker.colors").set(s(I,"marker.color").get())}}else{var W=i._size,Y=H.orient,K="top"===Y||"bottom"===Y;if("thicknessmode"===U){var J=K?W.h:W.w;S(q+"thickness",H.thickness*("fraction"===O?1/J:J),n)}else{var Q=K?W.w:W.h;S(q+"len",H.len*("fraction"===O?1/Q:Q),n)}}_[E][n]=B(D);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(E)){if("orientation"===E){P.set(O);var $=I.x&&!I.y?"h":"v";if((P.get()||$)===z.orientation)continue}else"orientationaxes"===E&&(I.orientation={v:"h",h:"v"}[z.orientation]);T.swapXYData(I),y.calc=y.clearAxisTypes=!0}else-1!==h.dataArrayContainers.indexOf(P.parts[0])?(T.manageArrayContainers(P,O,_),y.calc=!0):(R?R.arrayOk&&!c.traceIs(z,"regl")&&(o.isArrayOrTypedArray(O)||o.isArrayOrTypedArray(D))?y.calc=!0:A.update(y,R):y.calc=!0,P.set(O))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(E)&&d.swap(t,r),"orientationaxes"===E){var tt=s(t.layout,"hovermode"),et=tt.get();"x"===et?tt.set("y"):"y"===et?tt.set("x"):"x unified"===et?tt.set("y unified"):"y unified"===et&&tt.set("x unified")}if(-1!==["orientation","type"].indexOf(E)){for(g=[],n=0;n<r.length;n++){var rt=l[r[n]];c.traceIs(rt,"cartesian")&&(b(rt.xaxis||"x"),b(rt.yaxis||"y"))}S(g.map(w),!0,0),S(g.map(k),[0,1],0)}}else P=f(t.layout,E.replace("LAYOUT","")),_[E]=[B(P.get())],P.set(Array.isArray(F)?F[0]:F),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:_,redoit:v,traces:r,eventData:o.extendDeepNoArrays([],[m,r])}}function V(t){var e,r,n,i=o.counterRegex("axis",".title",!1,!1),a=/colorbar\.title$/,s=Object.keys(t);for(e=0;e<s.length;e++)r=s[e],n=t[r],"title"!==r&&!i.test(r)&&!a.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Y(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(k.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(k.doLegend),a.layoutstyle&&s.push(k.layoutStyles),a.axrange&&Z(s,i.rangesAltered),a.ticks&&s.push(k.doTicksRelayout),a.modebar&&s.push(k.doModeBar),a.camera&&s.push(k.doCamera),a.colorbars&&s.push(k.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function Z(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(x,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var G=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=N(l._preGUI,u),f=Object.keys(e),m=d.list(t),g=o.extendDeepAll({},e),y={};for(V(e),f=Object.keys(e),n=0;n<f.length;n++)if(0===f[n].indexOf("allaxes")){for(i=0;i<m.length;i++){var v=m[i]._id.substr(1),_=-1!==v.indexOf("scene")?v+".":"",x=f[n].replace("allaxes",_+m[i]._name);e[x]||(e[x]=e[f[n]])}delete e[f[n]]}var b=A.layoutFlags(),k={},S={};function C(t,r){if(Array.isArray(t))t.forEach((function(t){C(t,r)}));else if(!(t in e)&&!T.hasParent(e,t)){var n=h(a,t);t in S||(S[t]=B(n.get())),void 0!==r&&n.set(r)}}var L,E={};function I(t){var e=d.name2id(t.split(".")[0]);return E[e]=1,e}for(var z in e){if(T.hasParent(e,z))throw new Error("cannot set "+z+" and a parent attribute simultaneously");for(var P=h(a,z),D=e[z],O=P.parts.length-1;O>0&&"string"!=typeof P.parts[O];)O--;var R=P.parts[O],F=P.parts[O-1]+"."+R,U=P.parts.slice(0,O).join("."),j=s(t.layout,U).get(),q=s(l,U).get(),H=P.get();if(void 0!==D){k[z]=D,S[z]="reverse"===R?D:B(H);var Z=p.getLayoutValObject(l,P.parts);if(Z&&Z.impliedEdits&&null!==D)for(var Y in Z.impliedEdits)C(o.relativeAttr(z,Y),Z.impliedEdits[Y]);if(-1!==["width","height"].indexOf(z))if(D){C("autosize",null);var J="height"===z?"width":"height";C(J,l[J])}else l[z]=t._initialAutoSize[z];else if("autosize"===z)C("width",D?null:l.width),C("height",D?null:l.height);else if(F.match(G))I(F),s(l,U+"._inputRange").set(null);else if(F.match(X)){I(F),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(W)&&s(l,U+"._inputDomain").set(null);if("type"===R){L=j;var $="linear"===q.type&&"log"===D,tt="log"===q.type&&"linear"===D;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,D,C),c.getComponentMethod("images","convertCoords")(t,q,D,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(R.match(M)){var nt=s(l,z).get(),it=(D||{}).type;it&&"-"!==it||(it="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,it,C),c.getComponentMethod("images","convertCoords")(t,nt,it,C)}var at=w.containerArrayMatch(z);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(w.isAddVal(D)?S[z]=null:w.isRemoveVal(D)?S[z]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(b,st),y[r]||(y[r]={});var lt=y[r][n];lt||(lt=y[r][n]={}),lt[ot]=D,delete e[z]}else"reverse"===R?(j.range?j.range.reverse():(C(U+".autorange",!0),j.range=[1,0]),q.autorange?b.calc=!0:b.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===z&&("lasso"===D||"select"===D)&&"lasso"!==H&&"select"!==H||l._has("gl2d")?b.plot=!0:Z?A.update(b,Z):b.calc=!0,P.set(D))}}for(r in y){w.applyContainerArrayChanges(t,h(a,r),y[r],b,h)||(b.plot=!0)}for(var ut in E){var ct=(L=d.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var pt in b.calc=!0,ct)E[pt]||(d.getFromId(t,pt)._constraintShrinkable=!0)}return(K(t)||e.height||e.width)&&(b.plot=!0),(b.plot||b.calc)&&(b.layoutReplot=!0),{flags:b,rangesAltered:E,undoit:S,redoit:k,eventData:g}}function K(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function J(t,e,n,i){if(t=o.getGraphDiv(t),T.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=T.coerceTraceIndices(t,i),s=j(t,o.extendFlat({},e),a),l=s.flags,c=Y(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&T.clearAxisTypes(t,a,n);var f=[];p.layoutReplot?f.push(k.layoutReplot):l.fullReplot?f.push(r.plot):(f.push(h.previousPromises),H(t,p,c)||h.supplyDefaults(t),l.style&&f.push(k.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(k.doColorBars),p.legend&&f.push(k.doLegend),p.layoutstyle&&f.push(k.layoutStyles),p.axrange&&Z(f,c.rangesAltered),p.ticks&&f.push(k.doTicksRelayout),p.modebar&&f.push(k.doModeBar),p.camera&&f.push(k.doCamera),f.push(C)),f.push(h.rehover,h.redrag),u.add(t,J,[t,s.undoit,c.undoit,s.traces],J,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function Q(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var $=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=t.match(n.pattern);if(i)return{head:i[1],attr:n.attr}}}function rt(t,e){var r=s(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function it(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function at(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function ot(t,e,r,n){var i,a,l,u=n.getValObject,c=n.flags,p=n.immutable,h=n.inArray,f=n.arrayIndex;function d(){var t=i.editType;h&&-1!==t.indexOf("arraydraw")?o.pushUnique(c.arrays[h],f):(A.update(c,i),"none"!==t&&c.nChanges++,n.transition&&i.anim&&c.nChangesAnim++,(G.test(l)||X.test(l))&&(c.rangesAltered[r[0]]=1),W.test(l)&&s(e,"_inputDomain").set(null),"datarevision"===a&&(c.newDataRevision=1))}function m(t){return"data_array"===t.valType||t.arrayOk}for(a in t){if(c.calc&&!n.transition)return;var g=t[a],y=e[a],v=r.concat(a);if(l=v.join("."),"_"!==a.charAt(0)&&"function"!=typeof g&&g!==y){if(("tick0"===a||"dtick"===a)&&"geo"!==r[0]){var _=e.tickmode;if("auto"===_||"array"===_||!_)continue}if(("range"!==a||!e.autorange)&&("zmin"!==a&&"zmax"!==a||"contourcarpet"!==e.type)&&(i=u(v))&&(!i._compareAsJSON||JSON.stringify(g)!==JSON.stringify(y))){var x,b=i.valType,w=m(i),T=Array.isArray(g),k=Array.isArray(y);if(T&&k){var M="_input_"+a,S=t[M],C=e[M];if(Array.isArray(S)&&S===C)continue}if(void 0===y)w&&T?c.calc=!0:d();else if(i._isLinkedToArray){var L=[],E=!1;h||(c.arrays[a]=L);var I=Math.min(g.length,y.length),z=Math.max(g.length,y.length);if(I!==z){if("arraydraw"!==i.editType){d();continue}E=!0}for(x=0;x<I;x++)ot(g[x],y[x],v.concat(x),o.extendFlat({inArray:a,arrayIndex:x},n));if(E)for(x=I;x<z;x++)L.push(x)}else!b&&o.isPlainObject(g)?ot(g,y,v,n):w?T&&k?(p&&(c.calc=!0),(p||n.newDataRevision)&&d()):T!==k?c.calc=!0:d():T&&k&&g.length===y.length&&String(g)===String(y)||d()}}}for(a in e)if(!(a in t)&&"_"!==a.charAt(0)&&"function"!=typeof e[a]){if(m(i=u(r.concat(a)))&&Array.isArray(e[a]))return void(c.calc=!0);d()}}function st(t){var e=t._fullLayout,r=t.getBoundingClientRect();if(!o.equalDomRects(r,e._lastBBox)){var n=e._invTransform=o.inverseTransformMatrix(o.getFullTransformMatrix(t));e._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),e._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),e._lastBBox=r}}function lt(t){var e=n.select(t),r=t._fullLayout;if(r._calcInverseTransform=st,r._calcInverseTransform(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),delete r._modeBar,r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var i={};n.selectAll("defs").each((function(){this.id&&(i[this.id.split("-")[1]]=1)})),r._uid=o.randstr(i)}r._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var s=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var i=(r=h.supplyAnimationDefaults(r)).transition,a=r.frame;function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(a,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,T.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,g=0;function y(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:y(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d<n._frames.length;d++)(m=n._frames[d])&&(_||String(m.group)===String(e))&&v.push({type:"byname",name:String(m.name),data:y({name:m.name})});else if(x)for(d=0;d<e.length;d++){var b=e[d];-1!==["number","string"].indexOf(typeof b)?(b=String(b),v.push({type:"byname",name:b,data:y({name:b})})):o.isPlainObject(b)&&v.push({type:"object",data:y(o.extendFlat({},b))})}for(d=0;d<v.length;d++)if("byname"===(m=v[d]).type&&!n._frameHash[m.data.name])return o.warn('animate failure: frame not found: "'+m.data.name+'"'),void c();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&v.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var k=-1;for(d=0;d<v.length;d++)if("byname"===(m=v[d]).type&&m.name===w){k=d;break}if(k>0&&k<v.length-1){var A=[];for(d=0;d<v.length;d++)m=v[d],("byname"!==v[d].type||d>k)&&A.push(m);v=A}}v.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var o;o="byname"===e[i].type?h.computeFrame(t,e[i].name):e[i].data;var p=l(i),d=s(i);d.duration=Math.min(d.duration,p.duration);var m={frame:o,name:e[i].name,frameOpts:p,transitionOpts:d};i===e.length-1&&(m.onComplete=u(a,2),m.onInterrupt=c),n._frameQueue.push(m)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||f()}}(v):(t.emit("plotly_animated"),a())}))},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,i,a,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var p=l.length+2*e.length,f=[],d={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(c[m]||d[m]||{}).name,y=e[n].name,v=c[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,o.warn('addFrames: overwriting frame "'+(c[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index<e.index?1:0}));var _=[],x=[],b=l.length;for(n=f.length-1;n>=0;n--){if("number"==typeof(i=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a<l.length&&(l[a]||{}).name!==i.name;a++);_.push({type:"replace",index:a,value:i}),x.unshift({type:"replace",index:a,value:l[a]})}else s=Math.max(0,Math.min(f[n].index,b)),_.push({type:"insert",index:s,value:i}),x.unshift({type:"delete",index:s}),b++}var w=h.modifyFrames,T=h.modifyFrames,k=[t,x],A=[t,_];return u&&u.add(t,w,k,T,A),h.modifyFrames(t,_)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],s=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,a];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,i),Array.isArray(n)||(n=[n]),n=n.map((function(t){return o.extendFlat({},t)})),T.cleanData(n),a=0;a<n.length;a++)e.data.push(n[a]);for(a=0;a<n.length;a++)l.push(-n.length+a);if("undefined"==typeof i)return s=r.redraw(e),u.add(e,c,h,p,f),s;Array.isArray(i)||(i=[i]);try{D(e,l,i)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return u.startSequence(e),u.add(e,c,h,p,f),s=r.moveTraces(e,l,i),u.stopSequence(e),s},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var i,a,s=[],l=r.addTraces,c=t,p=[e,s,n],h=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),P(e,n,"indices"),(n=z(n,e.data.length-1)).sort(o.sorterDes),i=0;i<n.length;i+=1)a=e.data.splice(n[i],1)[0],s.push(a);var f=r.redraw(e);return u.add(e,l,p,c,h),f},r.extendTraces=function t(e,n,i,a){function s(t,e,r){var n,i;if(o.isTypedArray(t))if(r<0){var a=new t.constructor(0),s=R(t,e);r<0?(n=s,i=a):(n=a,i=s)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),i.set(t),i.set(e.subarray(0,l),t.length)}else{var u=r-e.length,c=t.length-u;n.set(t.subarray(c)),n.set(e,u),i.set(t.subarray(0,c))}else n=t.concat(e),i=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,i]}var l=O(e=o.getGraphDiv(e),n,i,a,s),c=r.redraw(e),p=[e,l.update,i,l.maxPoints];return u.add(e,r.prependTraces,p,t,arguments),c},r.moveTraces=function t(e,n,i){var a,s=[],l=[],c=t,p=t,h=[e=o.getGraphDiv(e),i,n],f=[e,n,i];if(D(e,n,i),n=Array.isArray(n)?n:[n],"undefined"==typeof i)for(i=[],a=0;a<n.length;a++)i.push(-n.length+a);for(i=Array.isArray(i)?i:[i],n=z(n,e.data.length-1),i=z(i,e.data.length-1),a=0;a<e.data.length;a++)-1===n.indexOf(a)&&s.push(e.data[a]);for(a=0;a<n.length;a++)l.push({newIndex:i[a],trace:e.data[n[a]]});for(l.sort((function(t,e){return t.newIndex-e.newIndex})),a=0;a<l.length;a+=1)s.splice(l[a].newIndex,0,l[a].trace);e.data=s;var d=r.redraw(e);return u.add(e,c,h,p,f),d},r.prependTraces=function t(e,n,i,a){function s(t,e,r){var n,i;if(o.isTypedArray(t))if(r<=0){var a=new t.constructor(0),s=R(e,t);r<0?(n=s,i=a):(n=a,i=s)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),i.set(e.subarray(l)),i.set(t,l)}else{var u=r-e.length;n.set(e),n.set(t.subarray(0,u),e.length),i.set(t.subarray(u))}else n=e.concat(t),i=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,i]}var l=O(e=o.getGraphDiv(e),n,i,a,s),c=r.redraw(e),p=[e,l.update,i,l.maxPoints];return u.add(e,r.extendTraces,p,t,arguments),c},r.newPlot=function(t,e,n,i){return t=o.getGraphDiv(t),h.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),h.purge(t),r.plot(t,e,n,i)},r.plot=function(t,e,i,a){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,i=u.layout,a=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,i,a]))return Promise.reject();e||i||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),I(t,a),i||(i={}),n.select(t).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var p=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(T.cleanData(e),p?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!p||(t.layout=T.cleanLayout(i)),h.supplyDefaults(t);var g=t._fullLayout,v=g._has("cartesian");if(!g._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var i=n.select(t).selectAll(".plot-container").data([0]);i.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=i.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e);r&&(t.layout=r);f.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=f.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var s=t.framework.svg(),l=1,u=t._fullLayout.title?t._fullLayout.title.text:"";""!==u&&u||(l=0);var c=function(){this.call(_.convertToTspans,t)},p=s.select(".title-group text").call(c);if(t._context.edits.titleText){var d=o._(t,"Click to enter Plot title");u&&u!==d||(l=.2,p.attr({"data-unformatted":d}).text(d).style({opacity:l}).on("mouseover.opacity",(function(){n.select(this).transition().duration(100).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(1e3).style("opacity",0)})));var m=function(){this.call(_.makeEditable,{gd:t}).on("edit",(function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(c),this.call(m)})).on("cancel",(function(){var t=this.attr("data-unformatted");this.text(t).call(c)}))};p.call(m)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),h.addLinks(t),Promise.resolve()}(t,e,i);g._replotting=!0,(p||g._shouldCreateBgLayer)&&(lt(t),g._shouldCreateBgLayer&&delete g._shouldCreateBgLayer),t.framework!==lt&&(t.framework=lt,lt(t)),m.initGradients(t),p&&d.saveShowSpikeInitial(t);var x=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;x&&h.doCalcdata(t);for(var b=0;b<t.calcdata.length;b++)t.calcdata[b][0].trace=t._fullData[b];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){o.isHidden(t)||h.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var w=o.extendFlat({},g._size),A=0;function M(){if(h.clearAutoMarginIds(t),k.drawMarginPushers(t),d.allowAutoMargin(t),g._has("pie"))for(var e=t._fullData,r=0;r<e.length;r++){var n=e[r];"pie"===n.type&&n.automargin&&h.allowAutoMargin(t,"pie."+n.uid+".automargin")}return h.doAutoMargin(t),h.previousPromises(t)}function S(){t._transitioning||(k.doAutoRangeAndConstraints(t),p&&d.saveRangeInitial(t),c.getComponentMethod("rangeslider","calcAutorange")(t))}var L=[h.previousPromises,function(){if(s)return r.addFrames(t,s)},function e(){for(var r=g._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!g._glcanvas&&g._has("gl")&&(g._glcanvas=g._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(t){return t.key})),g._glcanvas.enter().append("canvas").attr("class",(function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"})),g._glcanvas){g._glcanvas.attr("width",g.width).attr("height",g.height);var i=g._glcanvas.data()[0].regl;if(i&&(Math.floor(g.width)!==i._gl.drawingBufferWidth||Math.floor(g.height)!==i._gl.drawingBufferHeight)){var a="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!A)return o.log(a+" Clearing graph and plotting again."),h.cleanPlot([],{},t._fullData,g),h.supplyDefaults(t),g=t._fullLayout,h.doCalcdata(t),A++,e();o.error(a)}}return"h"===g.modebar.orientation?g._modebardiv.style("height",null).style("width","100%"):g._modebardiv.style("width",null).style("height",g.height+"px"),h.previousPromises(t)},M,function(){if(h.didMarginChange(w,g._size))return o.syncOrAsync([M,k.layoutStyles],t)}];v&&L.push((function(){if(x)return o.syncOrAsync([c.getComponentMethod("shapes","calcAutorange"),c.getComponentMethod("annotations","calcAutorange"),S],t);S()})),L.push(k.layoutStyles),v&&L.push((function(){return d.draw(t,p?"":"redraw")}),(function(t){t._fullLayout._insideTickLabelsAutorange&&q(t,t._fullLayout._insideTickLabelsAutorange).then((function(){t._fullLayout._insideTickLabelsAutorange=void 0}))})),L.push(k.drawData,k.finalDraw,y,h.addLinks,h.rehover,h.redrag,h.doAutoMargin,(function(t){t._fullLayout._insideTickLabelsAutorange&&p&&d.saveRangeInitial(t,!0)}),h.previousPromises);var E=o.syncOrAsync(L,t);return E&&E.then||(E=Promise.resolve()),E.then((function(){return C(t),t}))},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return h.cleanPlot([],{},r,e),h.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,i){var a,l;t=o.getGraphDiv(t),T.clearPromiseQueue(t);var u=t._fullData,f=t._fullLayout;if(o.isPlotDiv(t)&&u&&f){if(o.isPlainObject(e)){var d=e;e=d.data,n=d.layout,i=d.config,a=d.frames}var m=!1;if(i){var g=o.extendDeep({},t._context);t._context=void 0,I(t,i),m=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var i=e[n],a=r[n];if(i!==a)if(o.isPlainObject(i)&&o.isPlainObject(a)){if(t(i,a))return!0}else{if(!Array.isArray(i)||!Array.isArray(a))return!0;if(i.length!==a.length)return!0;for(var s=0;s<i.length;s++)if(i[s]!==a[s]){if(!o.isPlainObject(i[s])||!o.isPlainObject(a[s]))return!0;if(t(i[s],a[s]))return!0}}}}(g,t._context)}t.data=e||[],T.cleanData(t.data),t.layout=n||{},T.cleanLayout(t.layout),function(t,e,r,n){var i,a,l,u,c,p,h,f,d=n._preGUI,m=[],g={};for(i in d){if(c=et(i,$)){if(a=c.attr||c.head+".uirevision",(u=(l=s(n,a).get())&&rt(a,e))&&u===l&&(null===(p=d[i])&&(p=void 0),at(f=(h=s(e,i)).get(),p))){void 0===f&&"autorange"===i.substr(i.length-9)&&m.push(i.substr(0,i.length-10)),h.set(B(s(n,i).get()));continue}}else o.warn("unrecognized GUI edit: "+i);delete d[i],"range["===i.substr(i.length-8,6)&&(g[i.substr(0,i.length-9)]=1)}for(var y=0;y<m.length;y++){var v=m[y];if(g[v]){var _=s(e,v).get();_&&delete _.autorange}}var x=n._tracePreGUI;for(var b in x){var w,T=x[b],k=null;for(i in T){if(!k){var A=nt(b,r);if(A<0){delete x[b];break}var M=it(b,t,(w=r[A]._fullInput).index);if(M<0){delete x[b];break}k=t[M]}if(c=et(i,tt)){if(c.attr?u=(l=s(n,c.attr).get())&&rt(c.attr,e):(l=w.uirevision,void 0===(u=k.uirevision)&&(u=e.uirevision)),u&&u===l&&(null===(p=T[i])&&(p=void 0),at(f=(h=s(k,i)).get(),p))){h.set(B(s(w,i).get()));continue}}else o.warn("unrecognized GUI edit: "+i+" in trace uid "+b);delete T[i]}}}(t.data,t.layout,u,f),h.supplyDefaults(t,{skipUpdateCalc:!0});var y=t._fullData,v=t._fullLayout,_=void 0===v.datarevision,x=v.transition,b=function(t,e,r,n,i){var a=A.layoutFlags();function o(t){return p.getLayoutValObject(r,t)}a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,ot(e,r,[],{getValObject:o,flags:a,immutable:n,transition:i,gd:t}),(a.plot||a.calc)&&(a.layoutReplot=!0);i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some");return a}(t,f,v,_,x),w=b.newDataRevision,M=function(t,e,r,n,i,a){var o=e.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,u=A.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var c={getValObject:function(t){var e=p.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e},flags:u,immutable:n,transition:i,newDataRevision:a,gd:t},f={};for(s=0;s<e.length;s++)if(r[s]){if(l=r[s]._fullInput,h.hasMakesDataTransform(l)&&(l=r[s]),f[l.uid])continue;f[l.uid]=1,ot(e[s]._fullInput,l,[],c)}(u.calc||u.plot)&&(u.fullReplot=!0);i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some");return u}(t,u,y,_,x,w);if(K(t)&&(b.layoutReplot=!0),M.calc||b.calc){t.calcdata=void 0;for(var S=Object.getOwnPropertyNames(v),L=0;L<S.length;L++){var E=S[L],z=E.substring(0,5);if("xaxis"===z||"yaxis"===z){var P=v[E]._emptyCategories;P&&P()}}}else h.supplyDefaultsUpdateCalc(t.calcdata,y);var D=[];if(a&&(t._transitionData={},h.createTransitionData(t),D.push((function(){return r.addFrames(t,a)}))),v.transition&&!m&&(M.anim||b.anim))b.ticks&&D.push(k.doTicksRelayout),h.doCalcdata(t),k.doAutoRangeAndConstraints(t),D.push((function(){return h.transitionFromReact(t,M,b,f)}));else if(M.fullReplot||b.layoutReplot||m)t._fullLayout._skipDefaults=!0,D.push(r.plot);else{for(var O in b.arrays){var R=b.arrays[O];if(R.length){var F=c.getComponentMethod(O,"drawOne");if(F!==o.noop)for(var N=0;N<R.length;N++)F(t,R[N]);else{var U=c.getComponentMethod(O,"draw");if(U===o.noop)throw new Error("cannot draw components: "+O);U(t)}}}D.push(h.previousPromises),M.style&&D.push(k.doTraceStyle),(M.colorbars||b.colorbars)&&D.push(k.doColorBars),b.legend&&D.push(k.doLegend),b.layoutstyle&&D.push(k.layoutStyles),b.axrange&&Z(D),b.ticks&&D.push(k.doTicksRelayout),b.modebar&&D.push(k.doModeBar),b.camera&&D.push(k.doCamera),D.push(C)}D.push(h.rehover,h.redrag),(l=o.syncOrAsync(D,t))&&l.then||(l=Promise.resolve(t))}else l=r.newPlot(t,e,n,i);return l.then((function(){return t.emit("plotly_react",{data:e,layout:n}),t}))},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return T.cleanData(t.data),T.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then((function(){return t.emit("plotly_redraw"),t}))},r.relayout=q,r.restyle=F,r.setPlotConfig=function(t){return o.extendFlat(b,t)},r.update=J,r._guiRelayout=Q(q),r._guiRestyle=Q(F),r._guiUpdate=Q(J),r._storeDirectGUIEdit=function(t,e,r){for(var n in r){U(n,s(t,n).get(),r[n],e)}}},{"../components/color":83,"../components/drawing":105,"../constants/xmlns_namespaces":190,"../lib":212,"../lib/events":203,"../lib/queue":227,"../lib/svg_text_utils":234,"../plots/cartesian/axes":258,"../plots/cartesian/constants":264,"../plots/cartesian/graph_interact":267,"../plots/cartesian/select":277,"../plots/plots":299,"../plots/polar/legacy":302,"../registry":308,"./edit_types":240,"./helpers":241,"./manage_arrays":243,"./plot_config":245,"./plot_schema":246,"./subroutines":248,d3:16,"fast-isnumeric":18,"has-hover":49}],245:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(n,i),e.exports={configAttributes:n,dfltConfig:i}},{}],246:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("./plot_config").configAttributes,c=t("../plots/polar/legacy/area_attributes"),p=t("../plots/polar/legacy/axis_attributes"),h=t("./edit_types"),f=i.extendFlat,d=i.extendDeepAll,m=i.isPlainObject,g=i.isArrayOrTypedArray,y=i.nestedProperty,v=i.valObjectMeta,_=["_isSubplotObj","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function x(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(b(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!m(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!b(e[++r]))return!1}else if("info_array"===t.valType){var i=e[++r];if(!b(i))return!1;var a=t.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function b(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i<e.attr.length;i++)A(r,e,e.attr[i]);else A(r,e,"subplot"===e.attr?e.name:e.attr)}for(t in r=function(t){return f(t,{radialaxis:p.radialaxis,angularaxis:p.angularaxis}),f(t,p.layout),t}(r),n.componentsRegistry){var a=(e=n.componentsRegistry[t]).schema;if(a&&(a.subplots||a.layout)){var s=a.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else"colorscale"===e.name?d(r,e.layoutAttributes):e.layoutAttributes&&M(r,e.layoutAttributes,e.name)}return{layoutAttributes:k(r)}}function T(){var t={frames:d({},s)};return k(t),t.frames}function k(t){return function(t){r.crawl(t,(function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):m(t)&&(t.role="object")}))}(t),function(t){r.crawl(t,(function(t,e,r){if(t){var n=t._isLinkedToArray;n&&(delete t._isLinkedToArray,r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}))}(t),function(t){!function t(e){for(var r in e)if(m(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function A(t,e,r){var n=y(t,r),i=d({},e.layoutAttributes);i._isSubplotObj=!0,n.set(i)}function M(t,e,r){var n=y(t,r);n.set(d(n.get()||{},e))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=_,r.get=function(){var t={};n.allTypes.concat("area").forEach((function(e){t[e]=function(t){var e,i;"area"===t?(e={attributes:c},i={}):(e=n.modules[t]._module,i=e.basePlotModule);var o={type:null},s=d({},a),l=d({},e.attributes);r.crawl(l,(function(t,e,r,n,i){y(s,i).set(void 0),void 0===t&&y(l,i).set(void 0)})),d(o,s),n.traceIs(t,"noOpacity")&&delete o.opacity;n.traceIs(t,"showLegend")||(delete o.showlegend,delete o.legendgroup);n.traceIs(t,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel);e.selectPoints||delete o.selectedpoints;d(o,l),i.attributes&&d(o,i.attributes);o.type=t;var u={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:k(o)};if(e.layoutAttributes){var p={};d(p,e.layoutAttributes),u.layoutAttributes=k(p)}e.animatable||r.crawl(u,(function(t){r.isValObject(t)&&"anim"in t&&delete t.anim}));return u}(e)}));var e={};return Object.keys(n.transformsRegistry).forEach((function(t){e[t]=function(t){var e=n.transformsRegistry[t],r=d({},e.attributes);return Object.keys(n.componentsRegistry).forEach((function(e){var i=n.componentsRegistry[e];i.schema&&i.schema.transforms&&i.schema.transforms[t]&&Object.keys(i.schema.transforms[t]).forEach((function(e){M(r,i.schema.transforms[t][e],e)}))})),{attributes:k(r)}}(t)})),{defs:{valObjects:v,metaKeys:_.concat(["description","role","editType","impliedEdits"]),editType:{traces:h.traces,layout:h.layout},impliedEdits:{}},traces:t,layout:w(),transforms:e,frames:T(),animation:k(l),config:k(u)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===_.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||m(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}}))},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,i=[],o=[],s=[];function l(t,r,a,l){o=o.slice(0,l).concat([r]),s=s.slice(0,l).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===o[l-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,a){var l=e[o[r]],u=a+o[r];if(r===o.length-1)g(l)&&i.push(n+u);else if(s[r]){if(Array.isArray(l))for(var c=0;c<l.length;c++)m(l[c])&&t(l[c],r+1,u+"["+c+"].")}else m(l)&&t(l,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(a,l),t._module&&t._module.attributes&&r.crawl(t._module.attributes,l);var u=t.transforms;if(u)for(var c=0;c<u.length;c++){var p=u[c],h=p._module;h&&(n="transforms["+c+"].",e=p,r.crawl(h.attributes,l))}return i},r.getTraceValObject=function(t,e){var r,i,o=e[0],s=1;if("transforms"===o){if(1===e.length)return a.transforms;var l=t.transforms;if(!Array.isArray(l)||!l.length)return!1;var u=e[1];if(!b(u)||u>=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var p=t._module;if(p||(p=(n.modules[t.type||a.type.dflt]||{})._module),!p)return!1;if(!(i=(r=p.attributes)&&r[o])){var h=p.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return x(i,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r<l.length;r++){if((a=l[r]).attrRegex&&a.attrRegex.test(e)){if(a.layoutAttrOverrides)return a.layoutAttrOverrides;!u&&a.layoutAttributes&&(u=a.layoutAttributes)}var c=a.baseLayoutAttrOverrides;if(c&&e in c)return c[e]}if(u)return u}var h=t._modules;if(h)for(r=0;r<h.length;r++)if((s=h[r].layoutAttributes)&&e in s)return s[e];for(i in n.componentsRegistry){if("colorscale"===(a=n.componentsRegistry[i]).name&&0===e.indexOf("coloraxis"))return a.layoutAttributes[e];if(!a.schema&&e===a.name)return a.layoutAttributes}if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return p[e];return p.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":212,"../plots/animation_attributes":252,"../plots/attributes":254,"../plots/frame_attributes":287,"../plots/layout_attributes":290,"../plots/polar/legacy/area_attributes":300,"../plots/polar/legacy/axis_attributes":301,"../registry":308,"./edit_types":240,"./plot_config":245}],247:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/attributes"),a={name:{valType:"string",editType:"none"}};function o(t){return t&&"string"==typeof t}function s(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}a.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=a.name,e.templateitemname=a.templateitemname,e},r.traceTemplater=function(t){var e,r,a={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(a[e]=0);return{newTrace:function(o){var s={type:e=n.coerce(o,{},i,"type"),_template:null};if(e in a){r=t[e];var l=a[e]%r.length;a[e]++,s._template=r[l]}return s}}},r.newContainer=function(t,e,r){var i=t._template,a=i&&(i[e]||r&&i[r]);return n.isPlainObject(a)||(a=null),t[e]={_template:a}},r.arrayTemplater=function(t,e,r){var n=t._template,i=n&&n[s(e)],a=n&&n[e];Array.isArray(a)&&a.length||(a=[]);var l={};return{newItem:function(t){var e={name:t.name,_input:t},n=e.templateitemname=t.templateitemname;if(!o(n))return e._template=i,e;for(var s=0;s<a.length;s++){var u=a[s];if(u.name===n)return l[n]=1,e._template=u,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<a.length;e++){var r=a[e],n=r.name;if(o(n)&&!l[n]){var i={_template:r,name:n,_input:{_templateitemname:n}};i.templateitemname=r.templateitemname,t.push(i),l[n]=1}}return t}}},r.arrayDefaultKey=s,r.arrayEditor=function(t,e,r){var i=(n.nestedProperty(t,e).get()||[]).length,a=r._index,o=a>=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var i=p();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":212,"../plots/attributes":254}],248:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,y=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&(a[0]<e[1]&&a[1]>e[0]))return!0}return!1}function _(t){var e,i,s,c,d,m,g=t._fullLayout,y=g._size,_=y.p,b=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(u.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!g._has("cartesian"))return a.previousPromises(t);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-_-n:e._offset+e._length+_+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:y.l+y.w*(t.position||0)+n%1}for(e=0;e<b.length;e++){var k=(c=b[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=T(c,k,c.side),c._mainMirrorPosition=c.mirror&&k?T(c,k,f.OPPOSITE_SIDE[c.side]):null}var A=[],M=[],S=[],C=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,E=s.yaxis.domain,I=s.plotgroup;if(v(L,E,S)){var z=I.node(),P=s.bg=o.ensureSingle(I,"rect","bg");z.insertBefore(P.node(),z.childNodes[0]),M.push(i)}else I.select("rect.bg").remove(),S.push([L,E]),C||(A.push(i),M.push(i))}var D,O,R,F,B,N,U,j,V,q,H,Z,G,X=g._bgLayer.selectAll(".bg").data(A);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each((function(t){g._plots[t].bg=n.select(this)})),e=0;e<M.length;e++)s=g._plots[M[e]],d=s.xaxis,m=s.yaxis,s.bg&&void 0!==d._offset&&void 0!==m._offset&&s.bg.call(u.setRect,d._offset-_,m._offset-_,d._length+2*_,m._length+2*_).call(l.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(i in g._plots){s=g._plots[i],d=s.xaxis,m=s.yaxis;var W,Y,K=s.clipId="clip"+g._uid+i+"plot",J=o.ensureSingleById(g._clips,"clipPath",K,(function(t){t.classed("plotclip",!0).append("rect")}));s.clipRect=J.select("rect").attr({width:d._length,height:m._length}),u.setTranslate(s.plot,d._offset,m._offset),s._hasClipOnAxisFalse?(W=null,Y=K):(W=K,Y=null),u.setClipUrl(s.plot,W,t),s.layerClipId=Y}function Q(t){return"M"+D+","+t+"H"+O}function $(t){return"M"+d._offset+","+t+"h"+d._length}function tt(t){return"M"+t+","+j+"V"+U}function et(t){return"M"+t+","+m._offset+"v"+m._length}function rt(t,e,r){if(!t.showline||i!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(i in g._plots){s=g._plots[i],d=s.xaxis,m=s.yaxis;var nt="M0,0";x(d,i)&&(B=w(d,"left",m,b),D=d._offset-(B?_+B:0),N=w(d,"right",m,b),O=d._offset+d._length+(N?_+N:0),R=T(d,m,"bottom"),F=T(d,m,"top"),!(G=!d._anchorAxis||i!==d._mainSubplot)||"allticks"!==d.mirror&&"all"!==d.mirror||(d._linepositions[i]=[R,F]),nt=rt(d,Q,$),G&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(nt+=Q(R)+Q(F)),s.xlines.style("stroke-width",d._lw+"px").call(l.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),s.xlines.attr("d",nt);var it="M0,0";x(m,i)&&(H=w(m,"bottom",d,b),U=m._offset+m._length+(H?_:0),Z=w(m,"top",d,b),j=m._offset-(Z?_:0),V=T(m,d,"left"),q=T(m,d,"right"),!(G=!m._anchorAxis||i!==m._mainSubplot)||"allticks"!==m.mirror&&"all"!==m.mirror||(m._linepositions[i]=[V,q]),it=rt(m,tt,et),G&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(it+=tt(V)+tt(q)),s.ylines.style("stroke-width",m._lw+"px").call(l.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),s.ylines.attr("d",it)}return h.makeClipPaths(t),a.previousPromises(t)}function x(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function b(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=f.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function w(t,e,r,n){if(b(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&b(t,e,a))return a._lw}return 0}function T(t,e){var r=t.title,n=t._size,i=0;switch("start"===e?i=r.pad.l:"end"===e&&(i=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+i;case"container":default:return t.width*r.x+i}}function k(t,e){var r=t.title,n=t._size,i=0;if("0em"!==e&&e?e===f.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+i;case"container":default:return t.height-t.height*r.y+i}}r.layoutStyles=function(t){return o.syncOrAsync([a.doAutoMargin,_],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r="middle";o.isRightAnchor(e)?r="end":o.isLeftAnchor(e)&&(r="start");return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=f.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=f.MID_SHIFT+"em");return r}(e);c.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:T(e,r),y:k(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var l=n[e],u=l[0]||{},c=u.trace||{},p=c._module||{},h=p.arraysToCalcdata;h&&h(l,c);var f=p.editStyle;f&&o.push({fn:f,cd0:u})}if(o.length){for(e=0;e<o.length;e++){var d=o[e];d.fn(t,d.cd0)}s(t),r.redrawReglTraces(t)}return a.style(t),i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doColorBars=function(t){return i.getComponentMethod("colorbar","draw")(t),a.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,i.call("plot",t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doTicksRelayout=function(t){return h.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(i.subplotsRegistry.splom.updateGrid(t),s(t),r.redrawReglTraces(t)),r.drawMainTitle(t),a.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;p.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return a.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setViewport(i)}},r.drawData=function(t){var e=t._fullLayout;s(t);for(var n=e._basePlotModules,o=0;o<n.length;o++)n[o].plot(t);return r.redrawReglTraces(t),a.style(t),i.getComponentMethod("shapes","draw")(t),i.getComponentMethod("annotations","draw")(t),i.getComponentMethod("images","draw")(t),e._replotting=!1,a.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,i=t._fullData,a=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<i.length;r++){var l=i[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?o.pushUnique(a,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&o.pushUnique(s,l.subplot))}for(r=0;r<a.length;r++)(n=e._plots[a[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e,r=h.list(t,"",!0),n={},i=0;i<r.length;i++)if(!n[(e=r[i])._id]){n[e._id]=1,g(t,e),y(t,e);var a=e._matchGroup;if(a)for(var o in a){var s=h.getFromId(t,o);y(t,s,e.range),n[o]=1}}m(t)},r.finalDraw=function(t){i.getComponentMethod("rangeslider","draw")(t),i.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){i.getComponentMethod("legend","draw")(t),i.getComponentMethod("rangeselector","draw")(t),i.getComponentMethod("sliders","draw")(t),i.getComponentMethod("updatemenus","draw")(t),i.getComponentMethod("colorbar","draw")(t)}},{"../components/color":83,"../components/drawing":105,"../components/modebar":143,"../components/titles":178,"../constants/alignment":185,"../lib":212,"../lib/clear_gl_canvases":198,"../plots/cartesian/autorange":257,"../plots/cartesian/axes":258,"../plots/cartesian/constraints":265,"../plots/plots":299,"../registry":308,d3:16}],249:[function(t,e,r){"use strict";var n=t("../lib"),i=n.isPlainObject,a=t("./plot_schema"),o=t("../plots/plots"),s=t("../plots/attributes"),l=t("./plot_template"),u=t("./plot_config").dfltConfig;function c(t,e){t=n.extendDeep({},t);var r,a,o=Object.keys(t).sort();function s(e,r,n){if(i(r)&&i(e))c(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=l.arrayTemplater({_template:t},n);for(a=0;a<r.length;a++){var s=r[a],u=o.newItem(s)._template;u&&c(u,s)}var p=o.defaultItems();for(a=0;a<p.length;a++)r.push(p[a]._template);for(a=0;a<r.length;a++)delete r[a].templateitemname}}for(r=0;r<o.length;r++){var u=o[r],h=t[u];if(u in e?s(h,e[u],u):e[u]=h,p(u)===u)for(var f in e){var d=p(f);f===d||d!==u||f in t||s(h,e[f],u)}}}function p(t){return t.replace(/[0-9]+$/,"")}function h(t,e,r,a,o){var s=o&&r(o);for(var u in t){var c=t[u],f=m(t,u,a),d=m(t,u,o),g=r(d);if(!g){var y=p(u);y!==u&&(g=r(d=m(t,y,o)))}if((!s||s!==g)&&!(!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(c)))if(!g.valType&&i(c))h(c,e,r,f,d);else if(g._isLinkedToArray&&Array.isArray(c))for(var v=!1,_=0,x={},b=0;b<c.length;b++){var w=c[b];if(i(w)){var T=w.name;if(T)x[T]||(h(w,e,r,m(c,_,f),m(c,_,d)),_++,x[T]=1);else if(!v){var k=m(t,l.arrayDefaultKey(u),a),A=m(c,_,f);h(w,e,r,A,m(c,_,d));var M=n.nestedProperty(e,A);n.nestedProperty(e,k).set(M.get()),M.set(null),v=!0}}}else{n.nestedProperty(e,f).set(c)}}}function f(t,e){return a.getLayoutValObject(t,n.nestedProperty({},e).parts)}function d(t,e){return a.getTraceValObject(t,n.nestedProperty({},e).parts)}function m(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function g(t){for(var e=0;e<t.length;e++)if(i(t[e]))return!0}function y(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:u},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var a={data:{},layout:{}};e.forEach((function(t){var e={};h(t,e,d.bind(null,t));var r=n.coerce(t,{},s,"type"),i=a.data[r];i||(i=a.data[r]=[]),i.push(e)})),h(r,a.layout,f.bind(null,r)),delete a.layout.template;var l=r.template;if(i(l)){var p,m,g,y,v,_,x=l.layout;i(x)&&c(x,a.layout);var b=l.data;if(i(b)){for(m in a.data)if(g=b[m],Array.isArray(g)){for(_=(v=a.data[m]).length,y=g.length,p=0;p<_;p++)c(g[p%y],v[p]);for(p=_;p<y;p++)v.push(n.extendDeep({},g[p]))}for(m in b)m in a.data||(a.data[m]=n.extendDeep([],b[m]))}}return a},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:u,data:t.data,layout:t.layout}),a=r.layout||{};i(e)||(e=a.template||{});var s=e.layout,l=e.data,c=[];r.layout=a,r.layout.template=e,o.supplyDefaults(r);var h=r._fullLayout,f=r._fullData,d={};if(i(s)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&i(e[n])){var a,o=p(n),s=[];for(a=0;a<r.length;a++)s.push(m(e,n,r[a])),o!==n&&s.push(m(e,o,r[a]));for(a=0;a<s.length;a++)d[s[a]]=1;t(e[n],s)}}(h,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&i(e[n])){var a=m(e,n,r);d[a]?t(e[n],a):c.push({code:"unused",path:a})}}(s,"layout")):c.push({code:"layout"}),i(l)){for(var v,_={},x=0;x<f.length;x++){var b=f[x];_[v=b.type]=(_[v]||0)+1,b._fullInput._template||c.push({code:"missing",index:b._fullInput.index,traceType:v})}for(v in l){var w=l[v].length,T=_[v]||0;w>T?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:f,layout:h},""),c.length)return c.map(y)}},{"../lib":212,"../plots/attributes":254,"../plots/plots":299,"./plot_config":245,"./plot_schema":246,"./plot_template":247}],250:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var g={};function y(t,r){return o.coerce(e,g,p,t,r)}var v=y("format"),_=y("width"),x=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);_?A.width=_:null===e.width&&n(d.width)&&(A.width=d.width),x?A.height=x:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=a.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.plot(k,r,A,M).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":212,"../plots/plots":299,"../snapshot/helpers":312,"../snapshot/svgtoimg":314,"../snapshot/tosvg":316,"../version":378,"./plot_api":244,"fast-isnumeric":18}],251:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var p=Object.keys(t),h=0;h<p.length;h++){var f=p[h];if("transforms"!==f){var y=o.slice();y.push(f);var v=t[f],_=e[f],x=g(r,f),b=(x||{}).valType,w="info_array"===b,T="colorscale"===b,k=(x||{}).items;if(m(r,f))if(s(v)&&s(_)&&"any"!==b)c(v,_,x,i,a,y);else if(w&&l(v)){v.length>_.length&&i.push(d("unused",a,y.concat(_.length)));var A,M,S,C,L,E=_.length,I=Array.isArray(k);if(I&&(E=Math.min(E,k.length)),2===x.dimensions)for(M=0;M<E;M++)if(l(v[M])){v[M].length>_[M].length&&i.push(d("unused",a,y.concat(M,_[M].length)));var z=_[M].length;for(A=0;A<(I?Math.min(z,k[M].length):z);A++)S=I?k[M][A]:k,C=v[M][A],L=_[M][A],n.validate(C,S)?L!==C&&L!==+C&&i.push(d("dynamic",a,y.concat(M,A),C,L)):i.push(d("value",a,y.concat(M,A),C))}else i.push(d("array",a,y.concat(M),v[M]));else for(M=0;M<E;M++)S=I?k[M]:k,C=v[M],L=_[M],n.validate(C,S)?L!==C&&L!==+C&&i.push(d("dynamic",a,y.concat(M),C,L)):i.push(d("value",a,y.concat(M),C))}else if(x.items&&!w&&l(v)){var P,D,O=k[Object.keys(k)[0]],R=[];for(P=0;P<_.length;P++){var F=_[P]._index||P;if((D=y.slice()).push(F),s(v[F])&&s(_[P])){R.push(F);var B=v[F],N=_[P];s(B)&&!1!==B.visible&&!1===N.visible?i.push(d("invisible",a,D)):c(B,N,O,i,a,D)}}for(P=0;P<v.length;P++)(D=y.slice()).push(P),s(v[P])?-1===R.indexOf(P)&&i.push(d("unused",a,D)):i.push(d("object",a,D,v[P]))}else!s(v)&&s(_)?i.push(d("object",a,y,v)):u(v)||!u(_)||w||T?f in e?n.validate(v,x)?"enumerated"===x.valType&&(x.coerceNumber&&v!==+_||v!==_)&&i.push(d("dynamic",a,y,v,_)):i.push(d("value",a,y,v)):i.push(d("unused",a,y,v)):i.push(d("array",a,y,v));else i.push(d("schema",a,y))}}return i}function p(t,e){for(var r=t.layout.layoutAttributes,i=0;i<e.length;i++){var a=e[i],o=t.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}e.exports=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var r,u,h=a.get(),f=[],m={_context:n.extendFlat({},o)};l(t)?(m.data=n.extendDeep([],t),r=t):(m.data=[],r=[],f.push(d("array","data"))),s(e)?(m.layout=n.extendDeep({},e),u=e):(m.layout={},u={},arguments.length>1&&f.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,y=r.length,v=0;v<y;v++){var _=r[v],x=["data",v];if(s(_)){var b=g[v],w=b.type,T=h.traces[w].attributes;T.type={valType:"enumerated",values:[w]},!1===b.visible&&!1!==_.visible&&f.push(d("invisible",x)),c(_,b,T,f,x);var k=_.transforms,A=b.transforms;if(k){l(k)||f.push(d("array",x,["transforms"])),x.push("transforms");for(var M=0;M<k.length;M++){var S=["transforms",M],C=k[M].type;if(s(k[M])){var L=h.transforms[C]?h.transforms[C].attributes:{};L.type={valType:"enumerated",values:Object.keys(h.transforms)},c(k[M],A[M],L,f,x,S)}else f.push(d("object",x,S))}}}else f.push(d("object",x))}var E=m._fullLayout,I=p(h,g);return c(u,E,I,f,"layout"),0===f.length?void 0:f};var h={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":f(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":f(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return f(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=s(r)?"container":"key";return f(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[f(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?f(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[f(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function f(t){return l(t)?"In data trace "+t[1]+", ":"In "+t+", "}function d(t,e,r,i,a){var o,s;r=r||"",l(e)?(o=e[0],s=e[1]):(o=e,s=null);var u=function(t){if(!l(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),c=h[t](e,u,i,a);return n.log(c),{code:t,container:o,trace:s,path:r,astr:u,msg:c}}function m(t,e){var r=v(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function g(t,e){return e in t?t[e]:t[v(e).keyMinusId]}var y=n.counterRegex("([a-z]+)");function v(t){var e=t.match(y);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":212,"../plots/plots":299,"./plot_config":245,"./plot_schema":246}],252:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],253:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_template");e.exports=function(t,e,r){var a,o,s=r.name,l=r.inclusionAttr||"visible",u=e[s],c=n.isArrayOrTypedArray(t[s])?t[s]:[],p=e[s]=[],h=i.arrayTemplater(e,s,l);for(a=0;a<c.length;a++){var f=c[a];n.isPlainObject(f)?o=h.newItem(f):(o=h.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&r.handleItemDefaults(f,o,e,r),p.push(o)}var d=h.defaultItems();for(a=0;a<d.length;a++)(o=d[a])._index=p.length,r.handleItemDefaults({},o,e,r,{}),p.push(o);if(n.isArrayOrTypedArray(u)){var m=Math.min(u.length,p.length);for(a=0;a<m;a++)n.relinkPrivateKeys(p[a],u[a])}return p}},{"../lib":212,"../plot_api/plot_template":247}],254:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":114}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=i.dateTime2ms,o=i.incrementMonth,s=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e,r,i){if("date"!==e.type)return i;var l=t[r+"periodalignment"];if(!l)return i;var u,c=t[r+"period"];if(n(c)){if((c=+c)<=0)return i}else if("string"==typeof c&&"M"===c.charAt(0)){var p=+c.substring(1);if(!(p>0&&Math.round(p)===p))return i;u=p}for(var h=e.calendar,f="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,h)||0,y=[],v=i.length,_=0;_<v;_++){var x,b,w,T=i[_];if(u){for(x=Math.round((T-g)/(u*s)),w=o(g,u*x,h);w>T;)w=o(w,-u,h);for(;w<=T;)w=o(w,u,h);b=o(w,-u,h)}else{for(w=g+(x=Math.round((T-g)/c))*c;w>T;)w-=c;for(;w<=T;)w+=c;b=w-c}y[_]=f?b:d?w:(b+w)/2}return y}},{"../../constants/numerical":189,"../../lib":212,"fast-isnumeric":18}],256:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],257:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").FP_SAFE,o=t("../../registry"),s=t("./axis_ids"),l=s.getFromId,u=s.isLinked;function c(t,e){var r,n,a=[],o=t._fullLayout,s=h(o,e,0),l=h(o,e,1),u=f(t,e),c=u.min,d=u.max;if(0===c.length||0===d.length)return i.simpleMap(e.range,e.r2l);var m=c[0].val,g=d[0].val;for(r=1;r<c.length&&m===g;r++)m=Math.min(m,c[r].val);for(r=1;r<d.length&&m===g;r++)g=Math.max(g,d[r].val);var y=!1;if(e.range){var v=i.simpleMap(e.range,e.r2l);y=v[1]<v[0]}"reversed"===e.autorange&&(y=!0,e.autorange=!0);var _,x,b,w,T,k,A=e.rangemode,M="tozero"===A,S="nonnegative"===A,C=e._length,L=C/10,E=0;for(r=0;r<c.length;r++)for(_=c[r],n=0;n<d.length;n++)(k=(x=d[n]).val-_.val-p(e,_.val,x.val))>0&&((T=C-s(_)-l(x))>L?k/T>E&&(b=_,w=x,E=k/T):k/C>E&&(b={val:_.val,nopad:1},w={val:x.val,nopad:1},E=k/C));if(m===g){var I=m-1,z=m+1;if(M)if(0===m)a=[0,1];else{var P=(m>0?d:c).reduce((function(t,e){return Math.max(t,l(e))}),0),D=m/(1-Math.min(.5,P/C));a=m>0?[0,D]:[D,0]}else a=S?[Math.max(0,I),Math.max(1,z)]:[I,z]}else M?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-E*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),E=(w.val-b.val-p(e,_.val,x.val))/(C-s(b)-l(w)),a=[b.val-E*s(b),w.val+E*l(w)];return y&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a<i.length;a++){var o=i[a];n+=o.max-o.min}return n}function h(t,e,r){var n=.05*e._length,a=e._anchorAxis||{};if(-1!==(e.ticklabelposition||"").indexOf("inside")||-1!==(a.ticklabelposition||"").indexOf("inside")){var o="reversed"===e.autorange;if(!o){var s=i.simpleMap(e.range,e.r2l);o=s[1]<s[0]}o&&(r=!r)}var l=0;return u(t,e._id)||(l=function(t,e){var r=0,n=t._anchorAxis||{};if(-1!==(n.ticklabelposition||"").indexOf("inside")&&(!e&&("left"===n.side||"bottom"===n.side)||e&&("top"===n.side||"right"===n.side))){var a="x"===t._id.charAt(0);if(n._vals){var o=i.deg2rad(n._tickAngles[n._id+"tick"]||0),s=Math.abs(Math.cos(o)),l=Math.abs(Math.sin(o));n._vals.forEach((function(t){if(t.bb){var e=6+t.bb.width,n=6+t.bb.height;r=Math.max(r,a?Math.max(e*s,n*l):Math.max(n*s,e*l))}}))}"inside"===n.ticks&&"inside"===n.ticklabelposition&&(r+=n.ticklen||0)}return r}(e,r)),n=Math.max(l,n),"domain"===e.constrain&&e._inputDomain&&(n*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(t){return t.nopad?0:t.pad+(t.extrapad?n:l)}}e.exports={getAutoRange:c,makePadFn:h,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():c(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=c(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,c,p,h,f,g=[],v=[],_=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(h=1/0,f=-1/0,w)for(i=0;i<_;i++)(o=e[i])<h&&o>0&&(h=o),o>f&&o<a&&(f=o);else for(i=0;i<_;i++)(o=e[i])<h&&o>-a&&(h=o),o>f&&o<a&&(f=o);e=[h,f],_=2}var E={tozero:b,extrapad:x};function I(r){s=e[r],n(s)&&(c=M(r),p=S(r),k?(l=t.c2l(s)-L(r),u=t.c2l(s)+C(r)):(h=s-L(r),f=s+C(r),w&&h<f/10&&(h=f/10),l=t.c2l(h),u=t.c2l(f)),b&&(l=Math.min(0,l),u=Math.max(0,u)),y(l)&&d(g,l,p,E),y(u)&&m(v,u,c,E))}var z=Math.min(6,_);for(i=0;i<z;i++)I(i);for(i=_-1;i>=z;i--)I(i);return{min:g,max:v,opts:r}},concatExtremes:f};function f(t,e,r){var n,i,a,o=e._id,s=t._fullData,u=t._fullLayout,c=[],p=[];function h(t,e){for(n=0;n<e.length;n++){var r=t[e[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(i=0;i<s.min.length;i++)a=s.min[i],d(c,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],m(p,a.val,a.pad,{extrapad:a.extrapad})}}}if(h(s,e._traceIndices),h(u.annotations||[],e._annIndices||[]),h(u.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r)for(var g in e._matchGroup)if(g!==e._id){var y=l(t,g),v=f(t,y,!0),_=e._length/y._length;for(i=0;i<v.min.length;i++)a=v.min[i],d(c,a.val,a.pad*_,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],m(p,a.val,a.pad*_,{extrapad:a.extrapad})}return{min:c,max:p}}function d(t,e,r,n){g(t,e,r,n,v)}function m(t,e,r,n){g(t,e,r,n,_)}function g(t,e,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var u=t[l];if(i(u.val,e)&&u.pad>=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function y(t){return n(t)&&Math.abs(t)<a}function v(t,e){return t<=e}function _(t,e){return t>=e}},{"../../constants/numerical":189,"../../lib":212,"../../registry":308,"./axis_ids":261,"fast-isnumeric":18}],258:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),p=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,_=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,A=m.ONEWEEK,M=m.ONEDAY,S=M/2,C=m.ONEHOUR,L=m.ONEMIN,E=m.ONESEC,I=m.MINUS_SIGN,z=m.BADNUM,P=t("../../constants/alignment"),D=P.MID_SHIFT,O=P.CAP_SHIFT,R=P.LINE_SPACING,F=P.OPPOSITE_SIDE,B=e.exports={};B.setConvert=t("./set_convert");var N=t("./axis_autotype"),U=t("./axis_ids"),j=U.idSort,V=U.isLinked;B.id2name=U.id2name,B.name2id=U.name2id,B.cleanId=U.cleanId,B.list=U.list,B.listIds=U.listIds,B.getFromId=U.getFromId,B.getFromTrace=U.getFromTrace;var q=t("./autorange");B.getAutoRange=q.getAutoRange,B.findExtremes=q.findExtremes;function H(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}B.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,c,u)},B.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},B.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==B.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var u=B.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},B.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:B.getFromId(e,r).cleanPos)(t)},B.redrawComponents=function(t,e){e=e||B.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c<e.length;c++)for(var p=r[B.id2name(e[c])][a],h=0;h<p.length;h++){var f=p[h];if(!u[f]&&(l(t,f),u[f]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var Z=B.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:N(n,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},B.setConvert(i),"category"===i.type)for(var o=0;o<n.length;o++)i.d2c(n[o])}else i=B.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:X,c2d:X}:{d2c:G,c2d:G}};function G(t){return+t}function X(t){return String(t)}function W(t){return+t.substring(1)}B.getDataToCoordFunc=function(t,e,r,n){return Z(t,e,r,n).d2c},B.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},B.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&!1===a.autorange||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},B.saveShowSpikeInitial=function(t,e){for(var r=B.list(t,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==i||o.showspikes||(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,n},B.autoBin=function(t,e,r,n,a,o){var l,u=s.aggNums(Math.min,null,t),c=s.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:u-.5,end:c+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:c-u};if(a||(a=e.calendar),l="log"===e.type?{type:"linear",range:[u,c]}:{type:e.type,range:s.simpleMap([u,c],e.c2r,0,a),calendar:a},B.setConvert(l),o=o&&d.dtick(o,l.type))l.dtick=o,l.tick0=d.tick0(void 0,l.type,a);else{var p;if(r)p=(c-u)/r;else{var h=s.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(h.minDiff)/Math.LN10)),m=f*s.roundUp(h.minDiff/f,[.9,1.9,4.9,9.9],!0);p=Math.max(m,2*s.stdev(t)/Math.pow(t.length,n?.25:.4)),i(p)||(p=1)}B.autoTicks(l,p)}var g,y=l.dtick,v=B.tickIncrement(B.tickFirst(l),y,"reverse",a);if("number"==typeof y)g=(v=function(t,e,r,n,a){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/r.dtick)%100<2}for(var p=0;p<e.length;p++)e[p]%1==0?l++:i(e[p])||u++,c(e[p])&&o++,c(e[p]+r.dtick/2)&&s++;var h=e.length-u;if(l===h&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*h&&(o>.3*h||c(n)||c(a))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}(v,t,l,u,c))+(1+Math.floor((c-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(t,e,r,n,i){var a=s.findExactDates(e,i);if(a.exactDays>.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=B.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,u,a)),g=v,0;g<=c;)g=B.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:c-u}},B.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,B.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=B.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=C,o&&!n&&t.dtick<C&&(t.dtick=C)):/%p/.test(a)?(e=S,o&&!n&&t.dtick<S&&(t.dtick=S)):/%[Aadejuwx]/.test(a)?(e=M,o&&!n&&t.dtick<M&&(t.dtick=M)):/%[UVW]/.test(a)?(e=A,o&&!n&&t.dtick<A&&(t.dtick=A)):/%[Bbm]/.test(a)?(e=T,o&&(n?W(t.dtick)<1:t.dtick<k)&&(t.dtick="M1")):/%[q]/.test(a)?(e=x,o&&(n?W(t.dtick)<3:t.dtick<b)&&(t.dtick="M3")):/%[Yy]/.test(a)&&(e=y,o&&(n?W(t.dtick)<12:t.dtick<v)&&(t.dtick="M12")))}(n=r())&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0);t._definedDelta=e}(t),t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),nt(t)},B.calcTicks=function(t,e){B.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=H(s.simpleMap(t.range,t.r2l)),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;c<e.length;c++){var p=u(e[c]);p>a&&p<o&&(void 0===r[c]?n[l]=B.tickText(t,p):n[l]=it(t,p,String(r[c])),l++)}l<e.length&&n.splice(l,e.length-l);t.rangebreaks&&(n=n.filter((function(e){return t.maskBreaks(e.x)!==z})));return n}(t);var n=H(r),a=n[0],o=n[1],l=r[1]<r[0],u=Math.min(r[0],r[1]),c=Math.max(r[0],r[1]),p="log"===t.type&&!(i(t.dtick)||"L"===t.dtick.charAt(0)),h="period"===t.ticklabelmode;if(t._tmin=B.tickFirst(t,e),t._tmin<a!==l)return[];"category"!==t.type&&"multicategory"!==t.type||(o=l?Math.max(-.5,o):Math.min(t._categories.length-.5,o));var f=t._tmin;t.rangebreaks&&t._tick0Init!==t.tick0&&(f=wt(f,t),l||(f=B.tickIncrement(f,t.dtick,!l,t.calendar))),h&&(f=B.tickIncrement(f,t.dtick,!l,t.calendar));for(var d,m=Math.max(1e3,t._length||0),L=[],E=null;l?f>=o:f<=o;f=B.tickIncrement(f,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(f<a)continue;if(t.maskBreaks(f)===z&&wt(f,t)>=c)break}if(L.length>m||f===E)break;E=f;var I=!1;p&&f!==(0|f)&&(I=!0),L.push({minor:I,value:f})}if(h&&function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n].value,a=n,o=n+1;n<t.length-1?(a=n,o=n+1):n>0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,u=t[o].value,c=Math.abs(u-l),p=r||c,h=0;p>=v?h=c>=v&&c<=g?c:y:r===x&&p>=b?h=c>=b&&c<=_?c:x:p>=k?h=c>=k&&c<=w?c:T:r===A&&p>=A?h=A:p>=M?h=M:r===S&&p>=S?h=S:r===C&&p>=C&&(h=C),h>=c&&(h=c,s=!0);var f=i+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(i*(1-L)+L*f)!==z&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>A&&(h=c)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(L,t,t._definedDelta),t.rangebreaks){var P="y"===t._id.charAt(0),D=1;"auto"===t.tickmode&&(D=t.tickfont?t.tickfont.size:12);var O=NaN;for(d=L.length-1;d>-1;d--)if(L[d].drop)L.splice(d,1);else{L[d].value=wt(L[d].value,t);var R=t.c2p(L[d].value);(P?O>R-D:O<R+D)?L.splice(l?d+1:d,1):O=R}}bt(t)&&360===Math.abs(r[1]-r[0])&&L.pop(),t._tmax=(L[L.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var F,N,U=[];for(d=0;d<L.length;d++){var j=L[d].minor,V=L[d].value;F=B.tickText(t,V,!1,j),void 0!==(N=L[d].periodX)&&(F.periodX=N,(N>c||N<u)&&(N>c&&(F.periodX=c),N<u&&(F.periodX=u),F.text=" ",t._prevDateHead="")),U.push(F)}return t._inCalcTicks=!1,U};var Y=[2,5,10],K=[1,2,3,6,12],J=[1,2,5,10,15,30],Q=[1,2,3,7,14],$=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],tt=[-.301,0,.301,.699,1],et=[15,30,45,90,180];function rt(t,e,r){return e*s.roundUp(t/e,r)}function nt(t){var e=t.dtick;if(t._tickexponent=0,i(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=L&&a<=16||e>=C)t._tickround="M";else if(e>=E&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ot(t.exponentformat)&&!st(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function it(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}B.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var a=2*e;if(a>y)e/=y,r=n(10),t.dtick="M"+12*rt(e,r,Y);else if(a>T)e/=T,t.dtick="M"+rt(e,1,K);else if(a>M){t.dtick=rt(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:Q);var o=B.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else a>C?t.dtick=rt(e,C,K):a>L?t.dtick=rt(e,L,J):a>E?t.dtick=rt(e,E,J):(r=n(10),t.dtick=rt(e,r,Y))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+rt(e,r,Y)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):bt(t)?(t.tick0=0,r=1,t.dtick=rt(e,r,et)):(t.tick0=0,r=n(10),t.dtick=rt(e,r,Y));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},B.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?tt:$,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1]<a[0],l=o?Math.floor:Math.ceil,u=H(a)[0],c=t.dtick,p=r(t.tick0);if(i(c)){var h=l((u-p)/c)*c+p;return"category"!==t.type&&"multicategory"!==t.type||(h=s.constrain(h,0,t._categories.length-1)),h}var f=c.charAt(0),d=Number(c.substr(1));if("M"===f){for(var m,g,y,v=0,_=p;v<10;){if(((m=B.tickIncrement(_,c,o,t.calendar))-u)*(_-u)<=0)return o?Math.min(_,m):Math.max(_,m);g=(u-(_+m)/2)/(m-_),y=f+(Math.abs(Math.round(g))||1)*d,_=B.tickIncrement(_,y,g<0?!o:o,t.calendar),v++}return s.error("tickFirst did not converge",t),_}if("L"===f)return Math.log(l((Math.pow(10,u)-p)/d)*d+p)/Math.LN10;if("D"===f){var x="D2"===c?tt:$,b=s.roundUp(s.mod(u,1),x,o);return Math.floor(u)+Math.log(n.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},B.tickText=function(t,e,r,n){var a,o=it(t,e),l="array"===t.tickmode,u=r||l,c=t.type,p="category"===c?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var h=s.simpleMap(t.range,t.r2l),f=(Math.abs(h[1]-h[0])-(t._lBreaks||0))/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<f);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}function d(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==i}var m=r?"never":"none"!==t.exponentformat&&d(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,n){var a=t._tickround,o=r&&t.hoverformat||B.getTickFormat(t);n&&(a=i(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,u=s.formatDate(e.x,o,a,t._dateFormat,t.calendar,t._extraFormat),c=u.indexOf("\n");-1!==c&&(l=u.substr(c+1),u=u.substr(0,c));n&&("00:00:00"===u||"00:00"===u?(u=l,l=""):8===u.length&&(u=u.replace(/:00$/,"")));if(l)if(r)"d"===a?u+=", "+l:u=l+(u?", "+u:"");else if(t._inCalcTicks&&t._prevDateHead===l){var p=-1!==(t.ticklabelposition||"").indexOf("inside"),h=t._realSide||t.side;(!p&&"top"===h||p&&"bottom"===h)&&(u+="<br> ")}else t._prevDateHead=l,u+="<br>"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=lt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||ot(f)&&st(p)?(e.text=0===p?1:1===p?"10":"10<sup>"+(p>1?"":I)+h+"</sup>",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":I)+h:(e.text=lt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):bt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=lt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=lt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),l&&(e.text=I+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=lt(e.x,t,i,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},B.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return B.hoverLabelText(t,e)+" - "+B.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=B.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":I+i:i};var at=["f","p","n","\u03bc","m","","k","M","G","T"];function ot(t){return"SI"===t||"B"===t}function st(t){return t>14||t<-15}function lt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=B.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};nt(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,I);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,u&&(t*=Math.pow(10,-u),o+=u),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var m=o;m<0;m++)t+="0"}else{var g=(t=String(t)).indexOf(".")+1;g&&(t=t.substr(0,g+o).replace(/\.?0+$/,""))}t=s.numSeparate(t,e._separators,p)}u&&"hide"!==l&&(ot(l)&&st(u)&&(l="power"),f=u<0?I+-u:"power"!==l?"+"+u:String(u),"e"===l||"E"===l?t+=l+f:"power"===l?t+="\xd710<sup>"+f+"</sup>":"B"===l&&9===u?t+="B":ot(l)&&(t+=at[u/3+5]));return a?I+t:t}function ut(t,e){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var o in n)r.push(it(t,s.interp(n[o],.5),o));return r}function ct(t){return void 0!==t.periodX?t.periodX:t.x}function pt(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function ht(t){var e=t.title.font.size,r=(t.title.text.match(u.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(O+r*R):e*O:r?e*(r+1)*R:e}function ft(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function dt(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function mt(t){return t._id+".automargin"}function gt(t){return mt(t)+".mirror"}function yt(t){return t._id+".rangeslider"}function vt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function _t(t,e,r){var n,i,a=[],o=[],l=t.layout;for(n=0;n<e.length;n++)a.push(B.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(B.getFromId(t,r[n]));var u=Object.keys(f),c=["anchor","domain","overlaying","position","side","tickangle","editType"],p=["linear","log"];for(n=0;n<u.length;n++){var h=u[n],d=a[0][h],m=o[0][h],g=!0,y=!1,v=!1;if("_"!==h.charAt(0)&&"function"!=typeof d&&-1===c.indexOf(h)){for(i=1;i<a.length&&g;i++){var _=a[i][h];"type"===h&&-1!==p.indexOf(d)&&-1!==p.indexOf(_)&&d!==_?y=!0:_!==d&&(g=!1)}for(i=1;i<o.length&&g;i++){var x=o[i][h];"type"===h&&-1!==p.indexOf(m)&&-1!==p.indexOf(x)&&m!==x?v=!0:o[i][h]!==m&&(g=!1)}g&&(y&&(l[a[0]._name].type="linear"),v&&(l[o[0]._name].type="linear"),xt(l,h,a,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&s.swapAttrs(l.annotations[n],["?"])}}function xt(t,e,r,n,i){var a,o=s.nestedProperty,l=o(t[r[0]._name],e).get(),u=o(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===i.x&&(l.text=i.y),u&&u.text===i.y&&(u.text=i.x)),a=0;a<r.length;a++)o(t,r[a]._name+"."+e).set(u);for(a=0;a<n.length;a++)o(t,n[a]._name+"."+e).set(l)}function bt(t){return"angularaxis"===t._id}function wt(t,e){for(var r=e._rangebreaks.length,n=0;n<r;n++){var i=e._rangebreaks[n];if(t>=i.min&&t<i.max)return i.max}return t}B.getTickFormat=function(t){var e,r,n,i,a,o,s,l;function u(t){return"string"!=typeof t?t:Number(t.replace("M",""))*T}function c(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function p(t,e){var r=null===e[0],n=null===e[1],i=c(t,e[0])>=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(i=t.dtick,a=n.dtickrange,o=void 0,s=void 0,l=void 0,o=u||function(t){return t},s=a[0],l=a[1],(!s&&"number"!=typeof s||o(s)<=o(i))&&(!l&&"number"!=typeof l||o(l)>=o(i)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&p(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},B.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?B.findSubplotsWithAxis(n,e):n;return i.sort((function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),i},B.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},B.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,i,a={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=B.list(t,"x",!0),l=B.list(t,"y",!0),u=[];for(r=0;r<s.length;r++)for(u.push({x:s[r],y:o}),i=0;i<l.length;i++)0===r&&u.push({x:a,y:l[i]}),u.push({x:s[r],y:l[i]});var c=e._clips.selectAll(".axesclip").data(u,(function(t){return t.x._id+t.y._id}));c.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),c.exit().remove(),c.each((function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})}))}},B.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each((function(t){var e=t[0],r=n._plots[e];if(r){var i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()}}));var i=e&&"redraw"!==e?e:B.listIds(t);return s.syncOrAsync(i.map((function(e){return function(){if(e){var n=B.getFromId(t,e),i=B.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},B.drawOne=function(t,e,r){var n,i,l;r=r||{},e.setScale();var u=t._fullLayout,f=e._id,d=f.charAt(0),m=B.counterLetter(f),g=u._plots[e._mainSubplot];if(g){var y=g[d+"axislayer"],v=e._mainLinePosition,_=e._mainMirrorPosition,x=e._vals=B.calcTicks(e),b=[e.mirror,v,_].join("_");for(n=0;n<x.length;n++)x[n].axInfo=b;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var w={};if(e.visible){var T,k,A=B.makeTransTickFn(e),M=B.makeTransTickLabelFn(e),S="inside"===e.ticks,C="outside"===e.ticks;if("boundaries"===e.tickson){var L=function(t,e){var r,n=[],i=function(t,e){var r=t.xbnd[e];null!==r&&n.push(s.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)i(e[r],0);i(e[r-1],1)}return n}(0,x);k=B.clipEnds(e,L),T=S?k:L}else k=B.clipEnds(e,x),T=S&&"period"!==e.ticklabelmode?k:x;var E=e._gridVals=k,I=function(t,e){var r,n,i=[],a=e.length&&e[e.length-1].x<e[0].x,o=function(t,e){var r=t.xbnd[e];null!==r&&i.push(s.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var l=e[r];l.text2!==n&&o(l,a?1:0),n=l.text2}o(e[r-1],a?0:1)}return i}(e,x);if(!u._hasOnlyLargeSploms){var z=e._subplotsWith,P={};for(n=0;n<z.length;n++){i=z[n];var D=(l=u._plots[i])[m+"axis"],O=D._mainAxis._id;if(!P[O]){P[O]=1;var N="x"===d?"M0,"+D._offset+"v"+D._length:"M"+D._offset+",0h"+D._length;B.drawGrid(t,e,{vals:E,counterAxis:D,layer:l.gridlayer.select("."+f),path:N,transFn:A}),B.drawZeroLine(t,e,{counterAxis:D,layer:l.zerolinelayer,path:N,transFn:A})}}}var U=B.getTickSigns(e),j=[];if(e.ticks){var V,q,H,Z=B.makeTickPath(e,v,U[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(V=B.makeTickPath(e,_,U[3]),q=Z+V):(V="",q=Z),e.showdividers&&C&&"boundaries"===e.tickson){var G={};for(n=0;n<I.length;n++)G[I[n].x]=1;H=function(t){return G[t.x]?V:q}}else H=q;B.drawTicks(t,e,{vals:T,layer:y,path:H,transFn:A}),"allticks"===e.mirror&&(j=Object.keys(e._linepositions||{}))}for(n=0;n<j.length;n++){i=j[n],l=u._plots[i];var X=e._linepositions[i]||[],W=B.makeTickPath(e,X[0],U[0])+B.makeTickPath(e,X[1],U[1]);B.drawTicks(t,e,{vals:T,layer:l[d+"axislayer"],path:W,transFn:A})}var Y=[];if(Y.push((function(){return B.drawLabels(t,e,{vals:x,layer:y,transFn:M,labelFns:B.makeLabelFns(e,v)})})),"multicategory"===e.type){var K={x:2,y:10}[d];Y.push((function(){var r={x:"height",y:"width"}[d],n=Q()[r]+K+(e._tickAngles[f+"tick"]?e.tickfont.size*R:0);return B.drawLabels(t,e,{vals:ut(e,x),layer:y,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:A,labelFns:B.makeLabelFns(e,v+n*U[4])})})),Y.push((function(){return e._depth=U[4]*(Q("tick2")[e.side]-v),function(t,e,r){var n=e._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,pt);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(p.stroke,e.dividercolor).style("stroke-width",h.crispRound(t,e.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:I,layer:y,path:B.makeTickPath(e,v,U[4],e._depth),transFn:A})}))}else e.title.hasOwnProperty("standoff")&&Y.push((function(){e._depth=U[4]*(Q()[e.side]-v)}));var J=o.getComponentMethod("rangeslider","isVisible")(e);return Y.push((function(){var r,n,i,s,l=e.side.charAt(0),c=F[e.side].charAt(0),p=B.getPxPosition(t,e),h=C?e.ticklen:0;if((e.automargin||J)&&("multicategory"===e.type?r=Q("tick2"):(r=Q(),"x"===d&&"b"===l&&(e._depth=Math.max(r.width>0?r.bottom-p:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,h),f.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var y=e._offset-r.left;y>0&&(n.xl=0,n.l=y)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,h),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==u._dfltTitle[d]&&(n[l]+=ht(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[c]+=h),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}J&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,mt(e),n),a.autoMargin(t,gt(e),i),a.autoMargin(t,yt(e),s)})),r.skipTitle||J&&"bottom"===e.side||Y.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+ht(e);else{var s=-1!==(e.ticklabelposition||"").indexOf("inside");if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,p,f,d,m=B.getPxPosition(t,e);"x"===a?(p=e._offset+e._length/2,f="top"===e.side?m-r:m+r):(f=e._offset+e._length/2,p="right"===e.side?m+r:m-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var y=h.getTranslate(g.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:u,attributes:{x:p,y:f,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Y)}}function Q(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=dt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},B.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},B.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},B.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,p=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*O,p+=(t.linewidth||0)/2);(i||a)&&(c+=(t.linewidth||0)/2,p+=3);s&&"top"===u&&(p-=h*(1-O));(i||n)&&(c=-c);"bottom"!==u&&"right"!==u||(p=-p);return[l?c:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(ct(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(ct(e)))}},B.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},B.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),u=a("right"),c=a("bottom")||l||o||u,p=a("inside"),h="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=h?t.ticklen:0;if(p?m*=-1:c&&(m=0),h&&(f+=m,r)){var g=s.deg2rad(r);f=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(f+=.2*t.tickfont.size);var y,v,_,x,b,w={labelStandoff:f+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)x=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(x*=-1),y=d*x,v=e+f*x,_=b?1:-.2,90===Math.abs(M)&&(p?_+=D:_=-90===M&&"bottom"===k?O:90===M&&"top"===k?D:.5,T=D/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*_},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return i(e)&&0!==e&&180!==e?e*x<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===A){if(x=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(x*=-1),y=f,v=d*x,_=0,p||90!==Math.abs(M)||(_=-90===M&&"left"===k||90===M&&"right"===k?O:.5),p){var S=i(M)?+M:0;if(0!==S){var C=s.deg2rad(S);T=Math.abs(Math.sin(C))*O*x,_=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*_)*x+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*D},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},B.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.vals;"period"===e.ticklabelmode&&(i=i.slice()).shift();var a=r.layer.selectAll("path."+n).data(e.ticks?i:[],pt);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(p.stroke,e.tickcolor).style("stroke-width",h.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},B.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&B.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s<i.length;s++){var l=i[s].x;if(o?!l:Math.abs(l)<e.dtick/100){if(i=i.slice(0,s).concat(i.slice(s+1)),!o)break;s--}}var u=r.layer.selectAll("path."+n).data(i,pt);u.exit().remove(),u.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=h.crispRound(t,e.gridwidth,1),u.attr("transform",r.transFn).attr("d",r.path).call(p.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&u.attr("d",r.path)},B.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=B.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return j(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(p.stroke,e.zerolinecolor||p.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},B.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,c=o.charAt(0),p=r.cls||o+"tick",f=r.vals,d=r.labelFns,m=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[p],y=r.layer.selectAll("g."+p).data(e.showticklabels?f:[],pt),v=[];function _(t,a){var o=-1!==(e.ticklabelposition||"").indexOf("inside");t.each((function(t){var s=n.select(this),c=s.select(".text-math-group"),p=d.anchorFn(t,a),f=r.transFn.call(s.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),m=u.lineCount(s),g=R*t.fontSize,y=d.heightFn(t,i(a)?+a:0,(m-1)*g);if(y&&(f+=l(0,y)),c.empty()){var v=s.select("text");v.attr({transform:f,"text-anchor":p}),o&&(v.style({opacity:100}),e._hideOutOfRangeInsideTickLabels&&e._hideOutOfRangeInsideTickLabels())}else{var _=h.bBox(c.node()).width*{end:-.5,start:.5}[p];c.attr("transform",f+l(_,0))}}))}y.enter().append("g").classed(p,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(u.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(u.convertToTspans,t),t._promises[i]?v.push(t._promises.pop().then((function(){_(r,m)}))):_(r,m)})),y.exit().remove(),r.repositionOnUpdate&&y.each((function(t){n.select(this).select("text").call(u.positionText,d.xFn(t),d.yFn(t))})),e._hideOutOfRangeInsideTickLabels=void 0,-1!==(e.ticklabelposition||"").indexOf("inside")&&(e._hideOutOfRangeInsideTickLabels=function(){var t=s.simpleMap(e.range,e.r2l),r=e.l2p(t[0]),i=e.l2p(t[1]),a=Math.min(r,i)+e._offset,o=Math.max(r,i)+e._offset,l="x"===e._id.charAt(0);y.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=h.bBox(r.node()),s=!1;l?(i.right>o||i.left<a)&&(s=!0):(i.bottom>o||i.top+(e.tickangle?0:t.fontSize/4)<a)&&(s=!0),s&&r.select("text").style({opacity:0})}}))}),_(y,g+1?g:m);var x=null;e._selections&&(e._selections[p]=y);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(x=90,b.push((function(){_(y,g)}))):b.push((function(){if(_(y,m),f.length&&"x"===c&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(y.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=dt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=f.length,l=Math.abs((f[o-1].x-f[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",p=function(t){return-1!==u.indexOf(t)},d=p("top"),g=p("left"),v=p("right"),b=p("bottom")||g||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t<a.length-1;t++)if(s.bBoxIntersect(a[t],a[t+1],b)){x=w?90:30;break}}else{var T=2;for(e.ticks&&(T+=e.tickwidth/2),t=0;t<a.length;t++){var k=f[t].xbnd,A=a[t];if(null!==k[0]&&A.left-e.l2p(k[0])<T||null!==k[1]&&e.l2p(k[1])-A.right<T){x=90;break}}}x&&_(y,x)}})),e._tickAngles&&b.push((function(){e._tickAngles[p]=null===x?i(m)?m:0:x}));var w=e._anchorAxis;w&&w.autorange&&-1!==(e.ticklabelposition||"").indexOf("inside")&&!V(a,e._id)&&(a._insideTickLabelsAutorange||(a._insideTickLabelsAutorange={}),a._insideTickLabelsAutorange[w._name+".autorange"]=w.autorange,b.push((function(){y.each((function(t,r){var n=dt(this);e._vals[r].bb=h.bBox(n.node())}))})));var T=s.syncOrAsync(b);return T&&T.then&&t._promises.push(T),T},B.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},B.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===z)&&(ft(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(!i)return;var a=t._fullLayout,o=e._id.charAt(0),s=B.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function u(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var i=t._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}var c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return u(r);for(var p=B.list(t,s),h=0;h<p.length;h++){var f=p[h];if(f._mainAxis===i&&u(f))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,i=e._id.charAt(0),a=0;a<r.length;a++){var s=r[a];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(o.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[i])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===i)return!0}}return!1}(t,e))},B.clipEnds=function(t,e){return e.filter((function(e){return ft(t,e.x)}))},B.allowAutoMargin=function(t){for(var e=B.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(a.allowAutoMargin(t,mt(n)),n.mirror&&a.allowAutoMargin(t,gt(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&a.allowAutoMargin(t,yt(n))}},B.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],vt(u.x,l.x),vt(u.y,l.y);vt(u.x,[o]),vt(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}(t,e),n=0;n<r.length;n++)_t(t,r[n].x,r[n].y)}},{"../../components/color":83,"../../components/drawing":105,"../../components/titles":178,"../../constants/alignment":185,"../../constants/numerical":189,"../../lib":212,"../../lib/svg_text_utils":234,"../../plots/plots":299,"../../registry":308,"./autorange":257,"./axis_autotype":259,"./axis_ids":261,"./clean_ticks":263,"./layout_attributes":272,"./set_convert":278,d3:16,"fast-isnumeric":18}],259:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=i.isArrayOrTypedArray,s=i.isDateTime,l=i.cleanNumber,u=Math.round;function c(t,e){return e?n(t):"number"==typeof t}function p(t){return Math.max(1,(t-1)/1e3)}e.exports=function(t,e,r){var i=t,h=r.noMultiCategory;if(o(i)&&!i.length)return"-";if(!h&&function(t){return o(t[0])&&o(t[1])}(i))return"multicategory";if(h&&Array.isArray(i[0])){for(var f=[],d=0;d<i.length;d++)if(o(i[d]))for(var m=0;m<i[d].length;m++)f.push(i[d][m]);i=f}if(function(t,e){for(var r=t.length,i=p(r),a=0,o=0,l={},c=0;c<r;c+=i){var h=u(c),f=t[h],d=String(f);l[d]||(l[d]=1,s(f,e)&&a++,n(f)&&o++)}return a>2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),i=0,o=0,s={},c=0;c<r;c+=n){var h=u(c),f=t[h],d=String(f);if(!s[d]){s[d]=1;var m=typeof f;"boolean"===m?o++:(e?l(f)!==a:"number"===m)?i++:"string"===m&&o++}}return o>2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n<r;n++)if(c(t[n],e))return!0;return!1}(i,g)?"linear":"-"}},{"../../constants/numerical":189,"../../lib":212,"fast-isnumeric":18}],260:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("../array_container_defaults"),s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),p=t("./category_order_defaults"),h=t("./line_grid_defaults"),f=t("./set_convert"),d=t("./constants").WEEKDAY_PATTERN,m=t("./constants").HOUR_PATTERN;function g(t,e,r){function i(r,n){return a.coerce(t,e,s.rangebreaks,r,n)}if(i("enabled")){var o=i("bounds");if(o&&o.length>=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=v(o[l])){c=d;break}var p=i("pattern",c);if(p===d)for(l=0;l<2;l++)(u=v(o[l]))&&(e.bounds[l]=o[l]=u-1);if(p)for(l=0;l<2;l++)switch(u=o[l],p){case d:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case m:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var h=r.range;if(h[0]<h[1]){if(o[0]<h[0]&&o[1]>h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]<h[1])return void(e.enabled=!1)}}else{var f=i("values");if(!f||!f.length)return void(e.enabled=!1);i("dvalue")}}}e.exports=function(t,e,r,n,m){var y,v=n.letter,_=n.font||{},x=n.splomStash||{},b=r("visible",!n.visibleDflt),w=e._template||{},T=e.type||w.type||"-";"date"===T&&(i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",n.calendar),n.noTicklabelmode||(y=r("ticklabelmode")));n.noTicklabelposition&&"multicategory"!==T||a.coerce(t,e,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===y?["outside","inside"]:"x"===v?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition"),f(e,m);var k=!e.isValidRange(t.range);k&&n.reverseDflt&&(k="reversed"),!r("autorange",k)||"linear"!==T&&"-"!==T||r("rangemode"),r("range"),e.cleanRange(),p(t,e,r,n),"category"===T||n.noHover||r("hoverformat");var A=r("color"),M=A!==s.color.dflt?A:_.color,S=x.label||m._dfltTitle[v];if(c(t,e,r,T,n,{pass:1}),!b)return e;r("title.text",S),a.coerceFont(r,"title.font",{family:_.family,size:Math.round(1.2*_.size),color:M}),l(t,e,r,T),c(t,e,r,T,n,{pass:2}),u(t,e,r,n),h(t,e,r,{dfltColor:A,bgColor:n.bgColor,showGrid:n.showGrid,attributes:s}),(e.showline||e.ticks)&&r("mirror"),n.automargin&&r("automargin");var C,L="multicategory"===T;n.noTickson||"category"!==T&&!L||!e.ticks&&!e.showgrid||(L&&(C="boundaries"),"boundaries"===r("tickson",C)&&delete e.ticklabelposition);L&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));if("date"===T)if(o(t,e,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:g}),e.rangebreaks.length){for(var E=0;E<e.rangebreaks.length;E++)if(e.rangebreaks[E].pattern===d){e._hasDayOfWeekBreaks=!0;break}if(f(e,m),m._has("scattergl")||m._has("splom"))for(var I=0;I<n.data.length;I++){var z=n.data[I];"scattergl"!==z.type&&"splom"!==z.type||(z.visible=!1,a.warn(z.type+" traces do not work on axes with rangebreaks. Setting trace "+z.index+" to `visible: false`."))}}else delete e.rangebreaks;return e};var y={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function v(t){if("string"==typeof t)return y[t.substr(0,3).toLowerCase()]}},{"../../lib":212,"../../registry":308,"../array_container_defaults":253,"./category_order_defaults":262,"./constants":264,"./layout_attributes":272,"./line_grid_defaults":274,"./set_convert":278,"./tick_label_defaults":279,"./tick_mark_defaults":280,"./tick_value_defaults":281,"fast-isnumeric":18}],261:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./constants");function a(t,e){if(e&&e.length)for(var r=0;r<e.length;r++)if(e[r][t])return!0;return!1}r.id2name=function(t){if("string"==typeof t&&t.match(i.AX_ID_PATTERN)){var e=t.split(" ")[0].substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(i.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e,r){var n=/( domain)$/.test(t);if("string"==typeof t&&t.match(i.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)&&(!n||r)){var a=t.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===a&&(a=""),t.charAt(0)+a+(n&&r?" domain":"")}},r.list=function(t,e,n){var i=t._fullLayout;if(!i)return[];var a,o=r.listIds(t,e),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var u=i._subplots.gl3d||[];for(a=0;a<u.length;a++){var c=i[u[a]];e?s.push(c[e+"axis"]):s.push(c.xaxis,c.yaxis,c.zaxis)}}return s},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var i=t._fullLayout;return e=void 0===e||"string"!=typeof e?e:e.replace(" domain",""),"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),i[r.id2name(e)]},r.getFromTrace=function(t,e,i){var a=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=r.getFromId(t,e[i+"axis"]||i);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":308,"./constants":264}],262:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var s=e.data[n];s[a+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var u=l[i];null!=u&&(o[u]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===l?e._initialCategories=s:"category descending"===l&&(e._initialCategories=s.reverse()))}}},{}],263:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical"),o=a.ONEDAY,s=a.ONEWEEK;r.dtick=function(t,e){var r="log"===e,i="date"===e,a="category"===e,s=i?o:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:a?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if("string"!=typeof t||!i&&!r)return s;var l=t.charAt(0),u=t.substr(1);return(u=n(u)?Number(u):0)<=0||!(i&&"M"===l&&u===Math.round(u)||r&&"L"===l||r&&"D"===l&&(1===u||2===u))?s:t},r.tick0=function(t,e,r,a){return"date"===e?i.cleanDate(t,i.dateTick0(r,a%s==0?1:0)):"D1"!==a&&"D2"!==a?n(t)?Number(t):0:void 0}},{"../../constants/numerical":189,"../../lib":212,"fast-isnumeric":18}],264:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":228}],265:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./autorange"),a=t("./axis_ids").id2name,o=t("./layout_attributes"),s=t("./scale_zoom"),l=t("./set_convert"),u=t("../../constants/numerical").ALMOST_EQUAL,c=t("../../constants/alignment").FROM_BL;function p(t,e,r){var i=r.axIds,s=r.layoutOut,l=r.hasImage,u=s._axisConstraintGroups,c=s._axisMatchGroups,p=e._id,m=p.charAt(0),g=((s._splomAxes||{})[m]||{})[p]||{},y=e._id,v="x"===y.charAt(0);function _(r,i){return n.coerce(t,e,o,r,i)}e._matchGroup=null,e._constraintGroup=null,_("constrain",l?"domain":"range"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var x,b,w=e.type,T=[];for(x=0;x<i.length;x++){if((b=i[x])!==y)s[a(b)].type===w&&T.push(b)}var k=f(u,y);if(k){var A=[];for(x=0;x<T.length;x++)k[b=T[x]]||A.push(b);T=A}var M,S,C=T.length;C&&(t.matches||g.matches)&&(M=n.coerce(t,e,{matches:{valType:"enumerated",values:T,dflt:-1!==T.indexOf(g.matches)?g.matches:void 0}},"matches"));var L=l&&!v?e.anchor:void 0;if(C&&!M&&(t.scaleanchor||L)&&(S=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:T}},"scaleanchor",L)),M){e._matchGroup=d(c,y,M,1);var E=s[a(M)],I=h(s,e)/h(s,E);v!==("x"===M.charAt(0))&&(I=(v?"x":"y")+I),d(u,y,M,I)}else t.matches&&-1!==i.indexOf(t.matches)&&n.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(S){var z=_("scaleratio");z||(z=e.scaleratio=1),d(u,y,S,z)}else t.scaleanchor&&-1!==i.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function h(t,e){var r=e.domain;return r||(r=t[a(e.overlaying)].domain),r[1]-r[0]}function f(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function d(t,e,r,n){var i,a,o,s,l,u=f(t,e);null===u?((u={})[e]=1,l=t.length,t.push(u)):l=t.indexOf(u);var c=Object.keys(u);for(i=0;i<t.length;i++)if(o=t[i],i!==l&&o[r]){var p=o[r];for(a=0;a<c.length;a++)o[s=c[a]]=m(p,m(n,u[s]));return void t.splice(l,1)}if(1!==n)for(a=0;a<c.length;a++){var h=c[a];u[h]=m(n,u[h])}u[r]=1}function m(t,e){var r,n,i="",a="";"string"==typeof t&&(r=(i=t.match(/^[xy]*/)[0]).length,t=+t.substr(r)),"string"==typeof e&&(n=(a=e.match(/^[xy]*/)[0]).length,e=+e.substr(n));var o=t*e;return r||n?r&&n&&i.charAt(0)!==a.charAt(0)?r===n?o:(r>n?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;o<a.length;o++){var s=a[o],l=t[s];if("string"==typeof l){var u=l.match(/^[xy]*/)[0],c=u.length;l=+l.substr(c);for(var p="y"===u.charAt(0)?n:1/n,h=0;h<c;h++)l*=p}i[s]=l}return i}function y(t,e){var r=t._inputDomain,n=c[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}r.handleDefaults=function(t,e,r){var i,o,s,u,c,h,f,d,m=r.axIds,g=r.axHasImage,y=e._axisConstraintGroups=[],v=e._axisMatchGroups=[];for(i=0;i<m.length;i++)p(c=t[u=a(m[i])],h=e[u],{axIds:m,layoutOut:e,hasImage:g[u]});function _(t,r){for(i=0;i<t.length;i++)for(s in o=t[i])e[a(s)][r]=o}for(_(v,"_matchGroup"),i=0;i<y.length;i++)for(s in o=y[i])if((h=e[a(s)]).fixedrange){for(var x in o){var b=a(x);!1===(t[b]||{}).fixedrange&&n.warn("fixedrange was specified as false for axis "+b+" but was overridden because another axis in its constraint group has fixedrange true"),e[b].fixedrange=!0}break}for(i=0;i<y.length;){for(s in o=y[i]){(h=e[a(s)])._matchGroup&&Object.keys(h._matchGroup).length===Object.keys(o).length&&(y.splice(i,1),i--);break}i++}_(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],T=!1,k=!1;function A(){d=h[f],"rangebreaks"===f&&(k=h._hasDayOfWeekBreaks)}for(i=0;i<v.length;i++){o=v[i];for(var M=0;M<w.length;M++){var S;for(s in f=w[M],d=null,o)if(c=t[u=a(s)],h=e[u],f in h){if(!h.matches&&(S=h,f in c)){A();break}null===d&&f in c&&A()}if("range"===f&&d&&(T=!0),"autorange"===f&&null===d&&T&&(d=!1),null===d&&f in S&&(d=S[f]),null!==d)for(s in o)(h=e[a(s)])[f]="range"===f?d.slice():d,"rangebreaks"===f&&(h._hasDayOfWeekBreaks=k,l(h,e))}}},r.enforce=function(t){var e,r,n,o,l,c,p,h,f=t._fullLayout,d=f._axisConstraintGroups||[];for(e=0;e<d.length;e++){n=g(d[e],f);var m=Object.keys(n),v=1/0,_=0,x=1/0,b={},w={},T=!1;for(r=0;r<m.length;r++)w[o=m[r]]=l=f[a(o)],l._inputDomain?l.domain=l._inputDomain.slice():l._inputDomain=l.domain.slice(),l._inputRange||(l._inputRange=l.range.slice()),l.setScale(),b[o]=c=Math.abs(l._m)/n[o],v=Math.min(v,c),"domain"!==l.constrain&&l._constraintShrinkable||(x=Math.min(x,c)),delete l._constraintShrinkable,_=Math.max(_,c),"domain"===l.constrain&&(T=!0);if(!(v>u*_)||T)for(r=0;r<m.length;r++)if(c=b[o=m[r]],p=(l=w[o]).constrain,c!==x||"domain"===p)if(h=c/x,"range"===p)s(l,h);else{var k=l._inputDomain,A=(l.domain[1]-l.domain[0])/(k[1]-k[0]),M=(l.r2l(l.range[1])-l.r2l(l.range[0]))/(l.r2l(l._inputRange[1])-l.r2l(l._inputRange[0]));if((h/=A)*M<1){l.domain=l._input.domain=k.slice(),s(l,h);continue}if(M<1&&(l.range=l._input.range=l._inputRange.slice(),h*=M),l.autorange){var S=l.r2l(l.range[0]),C=l.r2l(l.range[1]),L=(S+C)/2,E=L,I=L,z=Math.abs(C-L),P=L-z*h*1.0001,D=L+z*h*1.0001,O=i.makePadFn(f,l,0),R=i.makePadFn(f,l,1);y(l,h);var F,B,N=Math.abs(l._m),U=i.concatExtremes(t,l),j=U.min,V=U.max;for(B=0;B<j.length;B++)(F=j[B].val-O(j[B])/N)>P&&F<E&&(E=F);for(B=0;B<V.length;B++)(F=V[B].val+R(V[B])/N)<D&&F>I&&(I=F);h/=(I-E)/(2*z),E=l.l2r(E),I=l.l2r(I),l.range=l._input.range=S<C?[E,I]:[I,E]}y(l,h)}}},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++){if(r[n][e])return"g"+n}return e},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":185,"../../constants/numerical":189,"../../lib":212,"./autorange":257,"./axis_ids":261,"./layout_attributes":272,"./scale_zoom":276,"./set_convert":278}],266:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/color"),p=t("../../components/drawing"),h=t("../../components/fx"),f=t("./axes"),d=t("../../lib/setcursor"),m=t("../../components/dragelement"),g=t("../../components/dragelement/helpers"),y=g.selectingOrDrawing,v=g.freeMode,_=t("../../constants/alignment").FROM_TL,x=t("../../lib/clear_gl_canvases"),b=t("../../plot_api/subroutines").redrawReglTraces,w=t("../plots"),T=t("./axis_ids").getFromId,k=t("./select").prepSelect,A=t("./select").clearSelect,M=t("./select").selectOnClick,S=t("./scale_zoom"),C=t("./constants"),L=C.MINDRAG,E=C.MINZOOM,I=!0;function z(t,e,r,n){var i=s.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return i.call(d,n),i.node()}function P(t,e,r,i,a,o,s){var l=z(t,"rect",e,r);return n.select(l).call(p.setRect,i,a,o,s),l}function D(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function O(t,e,r,n,i){for(var a=0;a<t.length;a++){var o=t[a];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-e:e,u=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(u*o._length))}else{var c=o._rl[0],p=o._rl[1]-c;n[o._name+".range[0]"]=o.l2r(c+p*e),n[o._name+".range[1]"]=o.l2r(c+p*r)}}if(i&&i.length){var h=(e+(1-r))/2;O(i,h,1-h,n,[])}}function R(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(!n.fixedrange)if(n.rangebreaks){var i=n._length,a=(n.p2l(0+e)-n.p2l(0)+(n.p2l(i+e)-n.p2l(i)))/2;n.range=[n.l2r(n._rl[0]-a),n.l2r(n._rl[1]-a)]}else n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)]}}function F(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function N(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),j(t,e,i,a)}function j(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){I&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),I=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,E)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Z(t,e,r,n,i){for(var a,o,l,u,c=!1,p={},h={},f=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m<e.length;m++){var g=e[m];for(a in r)if(g[a]){for(l in g)i&&(f[l]||d[l])||("x"===l.charAt(0)?r:n)[l]||(p[l]=a);for(o in n)i&&(f[o]||d[o])||!g[o]||(c=!0)}for(o in n)if(g[o])for(u in g)i&&(f[u]||d[u])||("x"===u.charAt(0)?r:n)[u]||(h[u]=o)}c&&(s.extendFlat(p,h),h={});var y={},v=[];for(l in p){var _=T(t,l);v.push(_),y[_._id]=_}var x={},b=[];for(u in h){var w=T(t,u);b.push(w),x[w._id]=w}return{xaHash:y,yaHash:x,xaxes:v,yaxes:b,xLinks:p,yLinks:h,isSubplotConstrained:c}}function G(t,e){if(a){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}))}function X(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,a,l,c,d,g){var I,z,j,W,Y,K,J,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ut,ct,pt,ht,ft,dt=t._fullLayout._zoomlayer,mt=d+g==="nsew",gt=1===(d+g).length;function yt(){if(I=e.xaxis,z=e.yaxis,$=I._length,tt=z._length,J=I._offset,Q=z._offset,(j={})[I._id]=I,(W={})[z._id]=z,d&&g)for(var r=e.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;j[i._id]=i;var a=r[n].yaxis;W[a._id]=a}Y=X(j),K=X(W),nt=D(Y,g),it=D(K,d),at=!it&&!nt,rt=Z(t,t._fullLayout._axisMatchGroups,j,W);var o=(et=Z(t,t._fullLayout._axisConstraintGroups,j,W,rt)).isSubplotConstrained||rt.isSubplotConstrained;ot=g||o,st=d||o;var s=t._fullLayout;lt=s._has("scattergl"),ut=s._has("splom"),ct=s._has("svg")}yt();var vt=function(t,e,r){if(!t)return"pointer";if("nsew"===t)return r?"":"pan"===e?"move":"crosshair";return t.toLowerCase()+"-resize"}(it+nt,t._fullLayout.dragmode,mt),_t=P(e,d+g+"drag",vt,r,a,l,c);if(at&&!mt)return _t.onmousedown=null,_t.style.pointerEvents="none",_t;var xt,bt,wt,Tt,kt,At,Mt,St,Ct,Lt,Et={element:_t,gd:t,plotinfo:e};function It(){Et.plotinfo.selection=!1,A(t)}function zt(t,r){var i=Et.gd;if(i._fullLayout._activeShapeIndex>=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(V(i),2!==t||gt||qt(),mt)a.indexOf("select")>-1&&M(r,i,Y,K,e.id,Et),a.indexOf("event")>-1&&h.click(i,r,e.id);else if(1===t&&gt){var s=d?z:I,l="s"===d||"w"===g?0:1,c=s._name+".range["+l+"]",p=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,l),f="left",m="middle";if(s.fixedrange)return;d?(m="n"===d?"top":"bottom","right"===s.side&&(f="right")):"e"===g&&(f="right"),i._context.showAxisRangeEntryBoxes&&n.select(_t).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(p),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:f,verticalAlign:m}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",i,c,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,ht*e+xt)),i=Math.max(0,Math.min(tt,ft*r+bt)),a=Math.abs(n-xt),o=Math.abs(i-bt);function s(){Mt="",wt.r=wt.l,wt.t=wt.b,Ct.attr("d","M0,0Z")}if(wt.l=Math.min(xt,n),wt.r=Math.max(xt,n),wt.t=Math.min(bt,i),wt.b=Math.max(bt,i),et.isSubplotConstrained)a>E||o>E?(Mt="xy",a/$>o/tt?(o=a*tt/$,bt>i?wt.t=bt-o:wt.b=bt+o):(a=o*$/tt,xt>n?wt.l=xt-a:wt.r=xt+a),Ct.attr("d",H(wt))):s();else if(rt.isSubplotConstrained)if(a>E||o>E){Mt="xy";var l=Math.min(wt.l/$,(tt-wt.b)/tt),u=Math.max(wt.r/$,(tt-wt.t)/tt);wt.l=l*$,wt.r=u*$,wt.b=(1-l)*tt,wt.t=(1-u)*tt,Ct.attr("d",H(wt))}else s();else!it||o<Math.min(Math.max(.6*a,L),E)?a<L||!nt?s():(wt.t=0,wt.b=tt,Mt="x",Ct.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-E-.5)+"h-3v"+(2*E+1)+"h3ZM"+(t.r+.5)+","+(e-E-.5)+"h3v"+(2*E+1)+"h-3Z"}(wt,bt))):!nt||a<Math.min(.6*o,E)?(wt.l=0,wt.r=$,Mt="y",Ct.attr("d",function(t,e){return"M"+(e-E-.5)+","+(t.t-.5)+"v-3h"+(2*E+1)+"v3ZM"+(e-E-.5)+","+(t.b+.5)+"v3h"+(2*E+1)+"v-3Z"}(wt,xt))):(Mt="xy",Ct.attr("d",H(wt)));wt.w=wt.r-wt.l,wt.h=wt.b-wt.t,Mt&&(Lt=!0),t._dragged=Lt,U(St,Ct,wt,kt,At,Tt),Dt(),t.emit("plotly_relayouting",pt),At=!0}function Dt(){pt={},"xy"!==Mt&&"x"!==Mt||(O(Y,wt.l/$,wt.r/$,pt,et.xaxes),jt("x",pt)),"xy"!==Mt&&"y"!==Mt||(O(K,(tt-wt.b)/tt,(tt-wt.t)/tt,pt,et.yaxes),jt("y",pt))}function Ot(){Dt(),V(t),Ht(),q(t)}Et.prepFn=function(e,r,n){var a=Et.dragmode,o=t._fullLayout.dragmode;o!==a&&(Et.dragmode=o),yt(),ht=t._fullLayout._invScaleX,ft=t._fullLayout._invScaleY,at||(mt?e.shiftKey?"pan"===o?o="zoom":y(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),v(o)?Et.minDrag=1:Et.minDrag=void 0,y(o)?(Et.xaxes=Y,Et.yaxes=K,k(e,r,n,Et,o)):(Et.clickFn=zt,y(a)&&It(),at||("zoom"===o?(Et.moveFn=Pt,Et.doneFn=Ot,Et.minDrag=1,function(e,r,n){var a=_t.getBoundingClientRect();xt=r-a.left,bt=n-a.top,t._fullLayout._calcInverseTransform(t);var o=s.apply3DTransform(t._fullLayout._invTransform)(xt,bt);xt=o[0],bt=o[1],wt={l:xt,r:xt,w:0,t:bt,b:bt,h:0},Tt=t._hmpixcount?t._hmlumcount/t._hmpixcount:i(t._fullLayout.plot_bgcolor).getLuminance(),At=!1,Mt="xy",Lt=!1,St=B(dt,Tt,J,Q,kt="M0,0H"+$+"V"+tt+"H0V0"),Ct=N(dt,J,Q)}(0,r,n)):"pan"===o&&(Et.moveFn=Ut,Et.doneFn=Ht))),t._fullLayout._redrag=function(){var e=t._dragdata;if(e&&e.element===_t){var r=t._fullLayout.dragmode;y(r)||(yt(),Zt([0,0,$,tt]),Et.moveFn(e.dx,e.dy))}}},m.init(Et);var Rt=[0,0,$,tt],Ft=null,Bt=C.REDRAWDELAY,Nt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ut(e,r){if(e*=ht,r*=ft,!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===nt||"ns"===it){var n=nt?-e:0,i=it?-r:0;if(rt.isSubplotConstrained){if(nt&&it){var a=(e/$-r/tt)/2;n=-(e=a*$),i=-(r=-a*tt)}it?n=-i*$/tt:i=-n*tt/$}return nt&&(R(Y,e),jt("x")),it&&(R(K,r),jt("y")),Zt([n,i,$,tt]),Vt(),void t.emit("plotly_relayouting",pt)}var o,s,l="w"===nt==("n"===it)?1:-1;if(nt&&it&&(et.isSubplotConstrained||rt.isSubplotConstrained)){var u=(e/$+l*r/tt)/2;e=u*$,r=l*u*tt}if("w"===nt?e=f(Y,0,e):"e"===nt?e=f(Y,1,-e):nt||(e=0),"n"===it?r=f(K,1,r):"s"===it?r=f(K,0,-r):it||(r=0),o="w"===nt?e:0,s="n"===it?r:0,et.isSubplotConstrained&&!rt.isSubplotConstrained||rt.isSubplotConstrained&&nt&&it&&l>0){var c;if(rt.isSubplotConstrained||!nt&&1===it.length){for(c=0;c<Y.length;c++)Y[c].range=Y[c]._r.slice(),S(Y[c],1-r/tt);o=(e=r*$/tt)/2}if(rt.isSubplotConstrained||!it&&1===nt.length){for(c=0;c<K.length;c++)K[c].range=K[c]._r.slice(),S(K[c],1-e/$);s=(r=e*tt/$)/2}}rt.isSubplotConstrained&&it||jt("x"),rt.isSubplotConstrained&&nt||jt("y");var p=$-e,h=tt-r;!rt.isSubplotConstrained||nt&&it||(nt?(s=o?0:e*tt/$,h=p*tt/$):(o=s?0:r*$/tt,p=h*$/tt)),Zt([o,s,p,h]),Vt(),t.emit("plotly_relayouting",pt)}function f(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/F(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function jt(t,e){for(var r=rt.isSubplotConstrained?{x:K,y:Y}[t]:rt[t+"axes"],n=rt.isSubplotConstrained?{x:Y,y:K}[t]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=rt.xLinks[o]||rt.yLinks[o],l=n[0]||j[s]||W[s];l&&(e?(e[a._name+".range[0]"]=e[l._name+".range[0]"],e[a._name+".range[1]"]=e[l._name+".range[1]"]):a.range=l.range.slice())}}function Vt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(ot&&(n(Y),n(et.xaxes),n(rt.xaxes)),st&&(n(K),n(et.yaxes),n(rt.yaxes)),pt={},e=0;e<r.length;e++){var i=r[e],a=T(t,i);f.drawOne(t,a,{skipTitle:!0}),pt[a._name+".range[0]"]=a.range[0],pt[a._name+".range[1]"]=a.range[1]}f.redrawComponents(t,r)}function qt(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];nt&&(r=r.concat(Y)),it&&(r=r.concat(K)),rt.xaxes&&(r=r.concat(rt.xaxes)),rt.yaxes&&(r=r.concat(rt.yaxes));var n,i,a,s={};if("reset+autosize"===e)for(e="autosize",i=0;i<r.length;i++)if((n=r[i])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){e="reset";break}if("autosize"===e)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(s[n._name+".autorange"]=!0);else if("reset"===e)for((nt||et.isSubplotConstrained)&&(r=r.concat(et.xaxes)),it&&!et.isSubplotConstrained&&(r=r.concat(et.yaxes)),et.isSubplotConstrained&&(nt?it||(r=r.concat(K)):r=r.concat(Y)),i=0;i<r.length;i++)(n=r[i]).fixedrange||(n._rangeInitial?(a=n._rangeInitial,s[n._name+".range[0]"]=a[0],s[n._name+".range[1]"]=a[1]):s[n._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,s)}}function Ht(){Zt([0,0,$,tt]),s.syncOrAsync([w.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,pt)}],t)}function Zt(e){var r,n,i,a,l=t._fullLayout,u=l._plots,c=l._subplots.cartesian;if(ut&&o.subplotsRegistry.splom.drag(t),lt)for(r=0;r<c.length;r++)if(i=(n=u[c[r]]).xaxis,a=n.yaxis,n._scene){var h=s.simpleMap(i.range,i.r2l),f=s.simpleMap(a.range,a.r2l);n._scene.update({range:[h[0],f[0],h[1],f[1]]})}if((ut||lt)&&(x(t),b(t)),ct){var m=e[2]/I._length,y=e[3]/z._length;for(r=0;r<c.length;r++){i=(n=u[c[r]]).xaxis,a=n.yaxis;var v,_,w,T,k=(ot||rt.isSubplotConstrained)&&!i.fixedrange&&j[i._id],A=(st||rt.isSubplotConstrained)&&!a.fixedrange&&W[a._id];if(k?(v=m,w=g||rt.isSubplotConstrained?e[0]:Wt(i,v)):rt.xaHash[i._id]?(v=m,w=e[0]*i._length/I._length):rt.yaHash[i._id]?(v=y,w="ns"===it?-e[1]*i._length/z._length:Wt(i,v,{n:"top",s:"bottom"}[it])):w=Xt(i,v=Gt(i,m,y)),A?(_=y,T=d||rt.isSubplotConstrained?e[1]:Wt(a,_)):rt.yaHash[a._id]?(_=y,T=e[1]*a._length/z._length):rt.xaHash[a._id]?(_=m,T="ew"===nt?-e[0]*a._length/I._length:Wt(a,_,{e:"right",w:"left"}[nt])):T=Xt(a,_=Gt(a,m,y)),v||_){v||(v=1),_||(_=1);var M=i._offset-w/v,S=a._offset-T/_;n.clipRect.call(p.setTranslate,w,T).call(p.setScale,v,_),n.plot.call(p.setTranslate,M,S).call(p.setScale,1/v,1/_),v===n.xScaleFactor&&_===n.yScaleFactor||(p.setPointGroupScale(n.zoomScalePts,v,_),p.setTextPointsScale(n.zoomScaleTxt,v,_)),p.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=v,n.yScaleFactor=_}}}}function Gt(t,e,r){return t.fixedrange?0:ot&&et.xaHash[t._id]?e:st&&(et.isSubplotConstrained?et.xaHash:et.yaHash)[t._id]?r:0}function Xt(t,e){return e?(t.range=t._r.slice(),S(t,e),Wt(t,e)):0}function Wt(t,e,r){return t._length*(1-e)*_[r||t.constraintoward||"middle"]}return d.length*g.length!=1&&G(_t,(function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(It(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();yt(),clearTimeout(Ft);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,i=Math.exp(-Math.min(Math.max(r,-20),20)/200),a=Nt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-a.left)/a.width,l=(a.bottom-e.clientY)/a.height;if(ot){for(g||(o=.5),n=0;n<Y.length;n++)u(Y[n],o,i);jt("x"),Rt[2]*=i,Rt[0]+=Rt[2]*o*(1/i-1)}if(st){for(d||(l=.5),n=0;n<K.length;n++)u(K[n],l,i);jt("y"),Rt[3]*=i,Rt[1]+=Rt[3]*(1-l)*(1/i-1)}Zt(Rt),Vt(),t.emit("plotly_relayouting",pt),Ft=setTimeout((function(){Rt=[0,0,$,tt],Ht()}),Bt),e.preventDefault()}else s.log("Did not find wheel motion attributes: ",e)}function u(t,e,r){if(!t.fixedrange){var n=s.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map((function(e){return t.l2r(i+(e-i)*r)}))}}})),_t},makeDragger:z,makeRectDragger:P,makeZoombox:B,makeCorners:N,updateZoombox:U,xyCorners:H,transitionZoombox:j,removeZoombox:V,showDoubleClickNotifier:q,attachWheelEventHandler:G}},{"../../components/color":83,"../../components/dragelement":102,"../../components/dragelement/helpers":101,"../../components/drawing":105,"../../components/fx":123,"../../constants/alignment":185,"../../lib":212,"../../lib/clear_gl_canvases":198,"../../lib/setcursor":232,"../../lib/svg_text_utils":234,"../../plot_api/subroutines":248,"../../registry":308,"../plots":299,"./axes":258,"./axis_ids":261,"./constants":264,"./scale_zoom":276,"./select":277,d3:16,"has-passive-events":50,tinycolor2:66}],267:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("../../lib/setcursor"),s=t("./dragbox").makeDragBox,l=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort((function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1})).forEach((function(r){var n=e._plots[r],o=n.xaxis,u=n.yaxis;if(!n.mainplot){var c=s(t,n,o._offset,u._offset,o._length,u._length,"ns","ew");c.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&t._fullLayout._plots[r]&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=c,t._fullLayout._hoversubplot=r},c.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,o._offset-l,u._offset-l,l,l,"n","w"),s(t,n,o._offset+o._length,u._offset-l,l,l,"n","e"),s(t,n,o._offset-l,u._offset+u._length,l,l,"s","w"),s(t,n,o._offset+o._length,u._offset+u._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var p=o._mainLinePosition;"top"===o.side&&(p-=l),s(t,n,o._offset+.1*o._length,p,.8*o._length,l,"","ew"),s(t,n,o._offset,p,.1*o._length,l,"","w"),s(t,n,o._offset+.9*o._length,p,.1*o._length,l,"","e")}if(r===u._mainSubplot){var h=u._mainLinePosition;"right"!==u.side&&(h-=l),s(t,n,h,u._offset+.1*u._length,l,.8*u._length,"ns",""),s(t,n,h,u._offset+.9*u._length,l,.1*u._length,"s",""),s(t,n,h,u._offset,l,.1*u._length,"n","")}}}));var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,i.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,i.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":102,"../../components/fx":123,"../../lib/setcursor":232,"./constants":264,"./dragbox":266,d3:16}],268:[function(t,e,r){"use strict";e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearSelect:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._drawing=!1}}},{}],269:[function(t,e,r){"use strict";var n=t("../../lib").strTranslate;function i(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:i,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return i(t,r[e])}},getTransform:function(t){return n(t.xaxis._offset,t.yaxis._offset)}}},{"../../lib":212}],270:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./axis_ids");e.exports=function(t){return function(e,r){var o=e[t];if(Array.isArray(o))for(var s=n.subplotsRegistry.cartesian,l=s.idRegex,u=r._subplots,c=u.xaxis,p=u.yaxis,h=u.cartesian,f=r._has("cartesian")||r._has("gl2d"),d=0;d<o.length;d++){var m=o[d];if(i.isPlainObject(m)){var g=a.cleanId(m.xref,"x",!1),y=a.cleanId(m.yref,"y",!1),v=l.x.test(g),_=l.y.test(y);if(v||_){f||i.pushUnique(r._basePlotModules,s);var x=!1;v&&-1===c.indexOf(g)&&(c.push(g),x=!0),_&&-1===p.indexOf(y)&&(p.push(y),x=!0),x&&v&&_&&h.push(g+y)}}}}}},{"../../lib":212,"../../registry":308,"./axis_ids":261}],271:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../plots"),s=t("../../components/drawing"),l=t("../get_data").getModuleCalcData,u=t("./axis_ids"),c=t("./constants"),p=t("../../constants/xmlns_namespaces"),h=a.ensureSingle;function f(t,e,r){return a.ensureSingle(t,e,r,(function(t){t.datum(r)}))}function d(t,e,r,a,o){for(var u,p,h,f=c.traceLayerClasses,d=t._fullLayout,m=d._modules,g=[],y=[],v=0;v<m.length;v++){var _=(u=m[v]).name,x=i.modules[_].categories;if(x.svg){var b=u.layerName||_+"layer",w=u.plot;h=(p=l(r,w))[0],r=p[1],h.length&&g.push({i:f.indexOf(b),className:b,plotMethod:w,cdModule:h}),x.zoomScale&&y.push("."+b)}}g.sort((function(t,e){return t.i-e.i}));var T=e.plot.selectAll("g.mlayer").data(g,(function(t){return t.className}));if(T.enter().append("g").attr("class",(function(t){return t.className})).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),T.exit().remove(),T.order(),T.each((function(r){var i=n.select(this),l=r.className;r.plotMethod(t,e,r.cdModule,i,a,o),-1===c.clipOnAxisFalseQuery.indexOf("."+l)&&s.setClipUrl(i,e.layerClipId,t)})),d._has("scattergl")&&(u=i.getModule("scattergl"),h=l(r,u)[0],u.plot(t,e,h)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(c.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),y.length)){var k=e.plot.selectAll(y.join(",")).selectAll(".trace");e.zoomScalePts=k.selectAll("path.point"),e.zoomScaleTxt=k.selectAll(".textpoint")}}function m(t,e){var r=e.plotgroup,n=e.id,i=c.layerValue2layerClass[e.xaxis.layer],a=c.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var s=e.mainplotinfo,l=s.plotgroup,p=n+"-x",d=n+"-y";e.gridlayer=s.gridlayer,e.zerolinelayer=s.zerolinelayer,h(s.overlinesBelow,"path",p),h(s.overlinesBelow,"path",d),h(s.overaxesBelow,"g",p),h(s.overaxesBelow,"g",d),e.plot=h(s.overplot,"g",n),h(s.overlinesAbove,"path",p),h(s.overlinesAbove,"path",d),h(s.overaxesAbove,"g",p),h(s.overaxesAbove,"g",d),e.xlines=l.select(".overlines-"+i).select("."+p),e.ylines=l.select(".overlines-"+a).select("."+d),e.xaxislayer=l.select(".overaxes-"+i).select("."+p),e.yaxislayer=l.select(".overaxes-"+a).select("."+d)}else if(o)e.xlines=h(r,"path","xlines-above"),e.ylines=h(r,"path","ylines-above"),e.xaxislayer=h(r,"g","xaxislayer-above"),e.yaxislayer=h(r,"g","yaxislayer-above");else{var m=h(r,"g","layer-subplot");e.shapelayer=h(m,"g","shapelayer"),e.imagelayer=h(m,"g","imagelayer"),e.gridlayer=h(r,"g","gridlayer"),e.zerolinelayer=h(r,"g","zerolinelayer"),h(r,"path","xlines-below"),h(r,"path","ylines-below"),e.overlinesBelow=h(r,"g","overlines-below"),h(r,"g","xaxislayer-below"),h(r,"g","yaxislayer-below"),e.overaxesBelow=h(r,"g","overaxes-below"),e.plot=h(r,"g","plot"),e.overplot=h(r,"g","overplot"),e.xlines=h(r,"path","xlines-above"),e.ylines=h(r,"path","ylines-above"),e.overlinesAbove=h(r,"g","overlines-above"),h(r,"g","xaxislayer-above"),h(r,"g","yaxislayer-above"),e.overaxesAbove=h(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+i),e.ylines=r.select(".ylines-"+a),e.xaxislayer=r.select(".xaxislayer-"+i),e.yaxislayer=r.select(".yaxislayer-"+a)}o||(f(e.gridlayer,"g",e.xaxis._id),f(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(u.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function g(t,e){if(t){var r={};for(var i in t.each((function(t){var i=t[0];n.select(this).remove(),y(i,e),r[i]=!0})),e._plots)for(var a=e._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];r[s.id]&&s.plot.selectAll(".trace").remove()}}}function y(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=c.idRegex,r.attrRegex=c.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,i,o=e._subplots,s=o.xaxis,l=o.yaxis,p=o.cartesian,h=p.concat(o.gl2d||[]),f={},d={};for(r=0;r<h.length;r++){var m=h[r].split("y");f[m[0]]=1,d["y"+m[1]]=1}for(r=0;r<s.length;r++)f[n=s[r]]||(i=(t[u.id2name(n)]||{}).anchor,c.idRegex.y.test(i)||(i="y"),p.push(n+i),h.push(n+i),d[i]||(d[i]=1,a.pushUnique(l,i)));for(r=0;r<l.length;r++)d[i=l[r]]||(n=(t[u.id2name(i)]||{}).anchor,c.idRegex.x.test(n)||(n="x"),p.push(n+i),h.push(n+i),f[n]||(f[n]=1,a.pushUnique(s,n)));if(!h.length){for(var g in n="",i="",t){if(c.attrRegex.test(g))"x"===g.charAt(0)?(!n||+g.substr(5)<+n.substr(5))&&(n=g):(!i||+g.substr(5)<+i.substr(5))&&(i=g)}n=n?u.name2id(n):"x",i=i?u.name2id(i):"y",s.push(n),l.push(i),p.push(n+i)}},r.plot=function(t,e,r,n){var i,a=t._fullLayout,o=a._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;i<s.length;i++)e.push(i);for(i=0;i<o.length;i++){for(var l,u=o[i],c=a._plots[u],p=[],h=0;h<s.length;h++){var f=s[h],m=f[0].trace;m.xaxis+m.yaxis===u&&((-1!==e.indexOf(m.index)||m.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===u&&-1!==["tonextx","tonexty","tonext"].indexOf(m.fill)&&-1===p.indexOf(l)&&p.push(l),p.push(f)),l=f)}d(t,c,p,r,n)}},r.clean=function(t,e,r,n){var i,a,o,s=n._plots||{},l=e._plots||{},c=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in s)(i=s[o]).plotgroup&&i.plotgroup.remove();var p=n._has&&n._has("gl"),h=e._has&&e._has("gl");if(p&&!h)for(o in s)(i=s[o])._scene&&i._scene.destroy();if(c.xaxis&&c.yaxis){var f=u.listIds({_fullLayout:n});for(a=0;a<f.length;a++){var d=f[a];e[u.id2name(d)]||n._infolayer.selectAll(".g-"+d+"title").remove()}}var m=n._has&&n._has("cartesian"),v=e._has&&e._has("cartesian");if(m&&!v)g(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(c.cartesian)for(a=0;a<c.cartesian.length;a++){var _=c.cartesian[a];if(!l[_]){var x="."+_+",."+_+"-x,."+_+"-y";n._cartesianlayer.selectAll(x).remove(),y(_,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,i,a,o,s=t._fullLayout,l=s._subplots.cartesian,u=l.length,c=[],p=[];for(e=0;e<u;e++){n=l[e],i=s._plots[n],a=i.xaxis,o=i.yaxis;var h=a._mainAxis,f=o._mainAxis,d=h._id+f._id,m=s._plots[d];i.overlays=[],d!==n&&m?(i.mainplot=d,i.mainplotinfo=m,p.push(n)):(i.mainplot=void 0,i.mainplotinfo=void 0,c.push(n))}for(e=0;e<p.length;e++)n=p[e],(i=s._plots[n]).mainplotinfo.overlays.push(i);var g=c.concat(p),y=new Array(u);for(e=0;e<u;e++){n=g[e],i=s._plots[n],a=i.xaxis,o=i.yaxis;var v=[n,a.layer,o.layer,a.overlaying||"",o.overlaying||""];for(r=0;r<i.overlays.length;r++)v.push(i.overlays[r].id);y[e]=v}return y}(t),i=e._cartesianlayer.selectAll(".subplot").data(r,String);i.enter().append("g").attr("class",(function(t){return"subplot "+t[0]})),i.order(),i.exit().call(g,e),i.each((function(r){var i=r[0],a=e._plots[i];a.plotgroup=n.select(this),m(t,a),a.draglayer=h(e._draggers,"g",i)}))},r.rangePlot=function(t,e,r){m(t,e),d(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:p.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}))},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":105,"../../constants/xmlns_namespaces":190,"../../lib":212,"../../registry":308,"../get_data":288,"../plots":299,"./attributes":256,"./axis_ids":261,"./constants":264,"./graph_interact":267,"./layout_attributes":272,"./layout_defaults":273,"./transition_axes":282,d3:16}],272:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),a=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray,l=(t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").DATE_FORMAT_LINK,t("../../constants/numerical").ONEDAY),u=t("./constants"),c=u.HOUR_PATTERN,p=u.WEEKDAY_PATTERN;e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:i.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"calc"},rangebreaks:s("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[p,c,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},a,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:i.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:i.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":82,"../../components/drawing/attributes":104,"../../constants/docs":187,"../../constants/numerical":189,"../../lib/extend":204,"../../plot_api/plot_template":247,"../font_attributes":286,"./constants":264}],273:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../components/fx/helpers").isUnifiedHover,o=t("../../components/fx/hovermode_defaults"),s=t("../../plot_api/plot_template"),l=t("../layout_attributes"),u=t("./layout_attributes"),c=t("./type_defaults"),p=t("./axis_defaults"),h=t("./constraints"),f=t("./position_defaults"),d=t("./axis_ids"),m=d.id2name,g=d.name2id,y=t("./constants").AX_ID_PATTERN,v=t("../../registry"),_=v.traceIs,x=v.getComponentMethod;function b(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var v,w,T=e.autotypenumbers,k={},A={},M={},S={},C={},L={},E={},I={},z={},P={};for(v=0;v<r.length;v++){var D=r[v];if(_(D,"cartesian")||_(D,"gl2d")){var O,R;if(D.xaxis)O=m(D.xaxis),b(k,O,D);else if(D.xaxes)for(w=0;w<D.xaxes.length;w++)b(k,m(D.xaxes[w]),D);if(D.yaxis)R=m(D.yaxis),b(k,R,D);else if(D.yaxes)for(w=0;w<D.yaxes.length;w++)b(k,m(D.yaxes[w]),D);if("funnel"===D.type?"h"===D.orientation?(O&&(A[O]=!0),R&&(E[R]=!0)):R&&(M[R]=!0):"image"===D.type?(R&&(I[R]=!0),O&&(I[O]=!0)):(R&&(C[R]=!0,L[R]=!0),_(D,"carpet")&&("carpet"!==D.type||D._cheater)||O&&(S[O]=!0)),"carpet"===D.type&&D._cheater&&O&&(A[O]=!0),_(D,"2dMap")&&(z[O]=!0,z[R]=!0),_(D,"oriented"))P["h"===D.orientation?R:O]=!0}}var F=e._subplots,B=F.xaxis,N=F.yaxis,U=n.simpleMap(B,m),j=n.simpleMap(N,m),V=U.concat(j),q=i.background;B.length&&N.length&&(q=n.coerce(t,e,l,"plot_bgcolor"));var H,Z,G,X,W,Y=i.combine(q,e.paper_bgcolor);function K(){var t=k[H]||[];W._traceIndices=t.map((function(t){return t._expandedIndex})),W._annIndices=[],W._shapeIndices=[],W._imgIndices=[],W._subplotsWith=[],W._counterAxes=[],W._name=W._attr=H,W._id=Z}function J(t,e){return n.coerce(X,W,u,t,e)}function Q(t,e){return n.coerce2(X,W,u,t,e)}function $(t){return"x"===t?N:B}function tt(e,r){for(var n="x"===e?U:j,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(g(o))}return i}var et={x:$("x"),y:$("y")},rt=et.x.concat(et.y),nt={},it=[];function at(){var t=X.matches;y.test(t)&&-1===rt.indexOf(t)&&(nt[t]=X.type,it=Object.keys(nt))}var ot=o(t,e,r),st=a(ot);for(v=0;v<V.length;v++){H=V[v],Z=g(H),G=H.charAt(0),n.isPlainObject(t[H])||(t[H]={}),X=t[H],W=s.newContainer(e,H,G+"axis"),K();var lt="x"===G&&!S[H]&&A[H]||"y"===G&&!C[H]&&M[H],ut="y"===G&&(!L[H]&&E[H]||I[H]),ct={letter:G,font:e.font,outerTicks:z[H],showGrid:!P[H],data:k[H]||[],bgColor:Y,calendar:e.calendar,automargin:!0,visibleDflt:lt,reverseDflt:ut,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[G]||{})[Z]};J("uirevision",e.uirevision),c(X,W,J,ct),p(X,W,J,ct,e);var pt=st&&G===ot.charAt(0),ht=Q("spikecolor",st?W.color:void 0),ft=Q("spikethickness",st?1.5:void 0),dt=Q("spikedash",st?"dot":void 0),mt=Q("spikemode",st?"across":void 0),gt=Q("spikesnap",st?"hovered data":void 0);J("showspikes",!!(pt||ht||ft||dt||mt||gt))||(delete W.spikecolor,delete W.spikethickness,delete W.spikedash,delete W.spikemode,delete W.spikesnap),f(X,W,J,{letter:G,counterAxes:et[G],overlayableAxes:tt(G,H),grid:e.grid}),J("title.standoff"),at(),W._input=X}for(v=0;v<it.length;){Z=it[v++],G=(H=m(Z)).charAt(0),n.isPlainObject(t[H])||(t[H]={}),X=t[H],W=s.newContainer(e,H,G+"axis"),K();var yt={letter:G,font:e.font,outerTicks:z[H],showGrid:!P[H],data:[],bgColor:Y,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((e._splomAxes||{})[G]||{})[Z]};J("uirevision",e.uirevision),W.type=nt[Z]||"linear",p(X,W,J,yt,e),f(X,W,J,{letter:G,counterAxes:et[G],overlayableAxes:tt(G,H),grid:e.grid}),J("fixedrange"),at(),W._input=X}var vt=x("rangeslider","handleDefaults"),_t=x("rangeselector","handleDefaults");for(v=0;v<U.length;v++)H=U[v],X=t[H],W=e[H],vt(t,e,H),"date"===W.type&&_t(X,W,e,j,W.calendar),J("fixedrange");for(v=0;v<j.length;v++){H=j[v],X=t[H],W=e[H];var xt=e[m(W.anchor)];J("fixedrange",x("rangeslider","isVisible")(xt))}h.handleDefaults(t,e,{axIds:rt.concat(it).sort(d.idSort),axHasImage:I})}},{"../../components/color":83,"../../components/fx/helpers":119,"../../components/fx/hovermode_defaults":122,"../../lib":212,"../../plot_api/plot_template":247,"../../registry":308,"../layout_attributes":290,"./axis_defaults":260,"./axis_ids":261,"./constants":264,"./constraints":265,"./layout_attributes":272,"./position_defaults":275,"./type_defaults":283}],274:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../components/color/attributes").lightFraction,a=t("../../lib");e.exports=function(t,e,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return a.coerce2(t,e,o.attributes,r,n)}var u=l("linecolor",s),c=l("linewidth");r("showline",o.showLine||!!u||!!c)||(delete e.linecolor,delete e.linewidth);var p=l("gridcolor",n(s,o.bgColor,o.blend||i).toRgbString()),h=l("gridwidth");if(r("showgrid",o.showGrid||!!p||!!h)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var f=l("zerolinecolor",s),d=l("zerolinewidth");r("zeroline",o.showGrid||!!f||!!d)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":82,"../../lib":212,tinycolor2:66}],275:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,a){var o,s,l,u,c=a.counterAxes||[],p=a.overlayableAxes||[],h=a.letter,f=a.grid;f&&(s=f._domains[h][f._axisMap[e._id]],o=f._anchors[e._id],s&&(l=f[h+"side"].split(" ")[0],u=f.domain[h]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(n(t.position)?"free":c[0]||"free"),l=l||("x"===h?"bottom":"left"),u=u||0,"free"===i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(c),dflt:o}},"anchor")&&r("position",u),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===h?["bottom","top"]:["left","right"],dflt:l}},"side");var d=!1;if(p.length&&(d=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(p),dflt:!1}},"overlaying")),!d){var m=r("domain",s);m[0]>m[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":212,"fast-isnumeric":18}],276:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":185}],277:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,p=u.rectMode,h=u.drawMode,f=u.openMode,d=u.selectMode,m=t("../../components/shapes/draw_newshape/display_outlines"),g=t("../../components/shapes/draw_newshape/helpers").handleEllipse,y=t("../../components/shapes/draw_newshape/newshapes"),v=t("../../lib"),_=t("../../lib/polygon"),x=t("../../lib/throttle"),b=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),T=t("../../plot_api/subroutines").redrawReglTraces,k=t("./constants"),A=k.MINSELECT,M=_.filter,S=_.tester,C=t("./handle_outline").clearSelect,L=t("./helpers"),E=L.p2r,I=L.axValue,z=L.getTransform;function P(t,e,r,n,i,a,o){var s,l,u,c,p,h,d,g,y,v=e._hoverdata,_=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){F(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],i.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(v,s=N(e,r,n,i));if(b.pointNumbers.length>0?function(t,e){var r,n,i,a=[];for(i=0;i<t.length;i++)(r=t[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i<e.pointNumbers.length;i++)if(n.selectedpoints.indexOf(e.pointNumbers[i])<0)return!1;return!0}return!1}(s,b):function(t){var e,r,n,i=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=U(b))){for(o&&o.remove(),y=0;y<s.length;y++)(l=s[y])._module.selectPoints(l,!1);j(e,s),B(a),_&&e.emit("plotly_deselect",null)}else{for(d=t.shiftKey&&(void 0!==h?h:U(b)),u=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(b.pointNumber,b.searchInfo,d),c=R(a.selectionDefs.concat([u])),y=0;y<s.length;y++)if(p=V(s[y]._module.selectPoints(s[y],c),s[y]),x.length)for(var w=0;w<p.length;w++)x.push(p[w]);else x=p;if(j(e,s,g={points:x}),u&&a&&a.selectionDefs.push(u),o){var T=a.mergedPolygons,k=f(a.dragmode);m(q(T,k),o,a)}_&&e.emit("plotly_selected",g)}}}function D(t){return"pointNumber"in t&&"searchInfo"in t}function O(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,i){var a=t.searchInfo.cd[0].trace._expandedIndex;return i.cd[0].trace._expandedIndex===a&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function R(t){for(var e=[],r=D(t[0])?0:t[0][0][0],n=r,i=D(t[0])?0:t[0][0][1],a=i,o=0;o<t.length;o++)if(D(t[o]))e.push(O(t[o]));else{var s=_.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(t,r,n,i){for(var a=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,i)&&(a=!1===e[o].subtract);return a},isRect:!1,degenerate:!1}}function F(t,e,r){e._fullLayout._drawing=!1;var n=e._fullLayout,i=r.plotinfo,a=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,s=(t.shiftKey||t.altKey)&&!(h(a)&&f(a));o&&s&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):s&&i.selection||B(r),o||(C(e),n._lastSelectedSubplot=i.id)}function B(t){var e=t.dragmode,r=t.plotinfo,n=t.gd;if(n._fullLayout._activeShapeIndex>=0&&n._fullLayout._deactivateShape(n),h(e)){var a=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(a&&n._fullLayout._drawing){var o=y(a,t);o&&i.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function N(t,e,r,n){var i,a,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o<t.calcdata.length;o++)if(!0===(a=(i=t.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!n||a.subplot!==n&&a.geo!==n)if("splom"===a.type&&a._xaxes[l[0]]&&a._yaxes[u[0]]){var c=h(a._module,i,e[0],r[0]);c.scene=t._fullLayout._splomScenes[a.uid],s.push(c)}else if("sankey"===a.type){var p=h(a._module,i,e[0],r[0]);s.push(p)}else{if(-1===l.indexOf(a.xaxis))continue;if(-1===u.indexOf(a.yaxis))continue;s.push(h(a._module,i,b(t,a.xaxis),b(t,a.yaxis)))}else s.push(h(a._module,i,e[0],r[0]));return s;function h(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function U(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function j(t,e,r){var n,a,o,s;for(n=0;n<e.length;n++){var l=e[n].cd[0].trace._fullInput,u=t._fullLayout._tracePreGUI[l.uid]||{};void 0===u.selectedpoints&&(u.selectedpoints=l._input.selectedpoints||null)}if(r){var c=r.points||[];for(n=0;n<e.length;n++)(s=e[n].cd[0].trace)._input.selectedpoints=s._fullInput.selectedpoints=[],s._fullInput!==s&&(s.selectedpoints=[]);for(n=0;n<c.length;n++){var p=c[n],h=p.data,f=p.fullData;p.pointIndices?([].push.apply(h.selectedpoints,p.pointIndices),s._fullInput!==s&&[].push.apply(f.selectedpoints,p.pointIndices)):(h.selectedpoints.push(p.pointIndex),s._fullInput!==s&&f.selectedpoints.push(p.pointIndex))}}else for(n=0;n<e.length;n++)delete(s=e[n].cd[0].trace).selectedpoints,delete s._input.selectedpoints,s._fullInput!==s&&delete s._fullInput.selectedpoints;var d=!1;for(n=0;n<e.length;n++){s=(o=(a=e[n]).cd)[0].trace,i.traceIs(s,"regl")&&(d=!0);var m=a._module,g=m.styleOnSelect||m.style;g&&(g(t,o,o[0].node3),o[0].nodeRangePlot3&&g(t,o,o[0].nodeRangePlot3))}d&&(w(t),T(t))}function V(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=l(t[i],n,r);return t}function q(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var i=0;i<t[n].length;i++){r[n][i]=[],r[n][i][0]=i?"L":"M";for(var a=0;a<t[n][i].length;a++)r[n][i].push(t[n][i][a])}e||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}e.exports={prepSelect:function(t,e,r,i,l){var u=c(l),y=p(l),_=f(l),b=h(l),w=d(l),T="drawcircle"===l,C="drawline"===l||T,L=i.gd,D=L._fullLayout,O=D._zoomlayer,U=i.element.getBoundingClientRect(),H=i.plotinfo,Z=z(H),G=e-U.left,X=r-U.top;D._calcInverseTransform(L);var W=v.apply3DTransform(D._invTransform)(G,X);G=W[0],X=W[1];var Y,K,J,Q,$,tt,et,rt=D._invScaleX,nt=D._invScaleY,it=G,at=X,ot="M"+G+","+X,st=i.xaxes[0]._length,lt=i.yaxes[0]._length,ut=i.xaxes.concat(i.yaxes),ct=t.altKey&&!(h(l)&&_);F(t,L,i),u&&(Y=M([[G,X]],k.BENDPX));var pt=O.selectAll("path.select-outline-"+H.id).data(b?[0]:[1,2]),ht=D.newshape;pt.enter().append("path").attr("class",(function(t){return"select-outline select-outline-"+t+" select-outline-"+H.id})).style(b?{opacity:ht.opacity/2,fill:_?void 0:ht.fillcolor,stroke:ht.line.color,"stroke-dasharray":a(ht.line.dash,ht.line.width),"stroke-width":ht.line.width+"px"}:{}).attr("fill-rule",ht.fillrule).classed("cursor-move",!!b).attr("transform",Z).attr("d",ot+"Z");var ft,dt=O.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",Z).attr("d","M0,0Z"),mt=D._uid+k.SELECTID,gt=[],yt=N(L,i.xaxes,i.yaxes,i.subplot);function vt(t,e){return t-e}ft=H.fillRangeItems?H.fillRangeItems:y?function(t,e){var r=t.range={};for($=0;$<ut.length;$++){var n=ut[$],i=n._id.charAt(0);r[n._id]=[E(n,e[i+"min"]),E(n,e[i+"max"])].sort(vt)}}:function(t,e,r){var n=t.lassoPoints={};for($=0;$<ut.length;$++){var i=ut[$];n[i._id]=r.filtered.map(I(i))}},i.moveFn=function(t,e){it=Math.max(0,Math.min(st,rt*t+G)),at=Math.max(0,Math.min(lt,nt*e+X));var r=Math.abs(it-G),a=Math.abs(at-X);if(y){var o,s,l;if(w){var c=D.selectdirection;switch(o="any"===c?a<Math.min(.6*r,A)?"h":r<Math.min(.6*a,A)?"v":"d":c){case"h":s=T?lt/2:0,l=lt;break;case"v":s=T?st/2:0,l=st}}if(b)switch(D.newshape.drawdirection){case"vertical":o="h",s=T?lt/2:0,l=lt;break;case"horizontal":o="v",s=T?st/2:0,l=st;break;case"ortho":r<a?(o="h",s=X,l=at):(o="v",s=G,l=it);break;default:o="d"}"h"===o?((Q=C?g(T,[it,s],[it,l]):[[G,s],[G,l],[it,l],[it,s]]).xmin=C?it:Math.min(G,it),Q.xmax=C?it:Math.max(G,it),Q.ymin=Math.min(s,l),Q.ymax=Math.max(s,l),dt.attr("d","M"+Q.xmin+","+(X-A)+"h-4v"+2*A+"h4ZM"+(Q.xmax-1)+","+(X-A)+"h4v"+2*A+"h-4Z")):"v"===o?((Q=C?g(T,[s,at],[l,at]):[[s,X],[s,at],[l,at],[l,X]]).xmin=Math.min(s,l),Q.xmax=Math.max(s,l),Q.ymin=C?at:Math.min(X,at),Q.ymax=C?at:Math.max(X,at),dt.attr("d","M"+(G-A)+","+Q.ymin+"v-4h"+2*A+"v4ZM"+(G-A)+","+(Q.ymax-1)+"v4h"+2*A+"v-4Z")):"d"===o&&((Q=C?g(T,[G,X],[it,at]):[[G,X],[G,at],[it,at],[it,X]]).xmin=Math.min(G,it),Q.xmax=Math.max(G,it),Q.ymin=Math.min(X,at),Q.ymax=Math.max(X,at),dt.attr("d","M0,0Z"))}else u&&(Y.addPt([it,at]),Q=Y.filtered);i.selectionDefs&&i.selectionDefs.length?(J=function(t,e,r){if(r)return n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions;return n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(i.mergedPolygons,Q,ct),Q.subtract=ct,K=R(i.selectionDefs.concat([Q]))):(J=[Q],K=S(Q)),m(q(J,_),pt,i),w&&x.throttle(mt,k.SELECTDELAY,(function(){var t;gt=[];var e,r=[];for($=0;$<yt.length;$++)if(e=(tt=yt[$])._module.selectPoints(tt,K),r.push(e),t=V(e,tt),gt.length)for(var n=0;n<t.length;n++)gt.push(t[n]);else gt=t;j(L,yt,et={points:gt}),ft(et,Q,Y),i.gd.emit("plotly_selecting",et)}))},i.clickFn=function(t,e){if(dt.remove(),L._fullLayout._activeShapeIndex>=0)L._fullLayout._deactivateShape(L);else if(!b){var r=D.clickmode;x.done(mt).then((function(){if(x.clear(mt),2===t){for(pt.remove(),$=0;$<yt.length;$++)(tt=yt[$])._module.selectPoints(tt,!1);j(L,yt),B(i),L.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&P(e,L,i.xaxes,i.yaxes,i.subplot,i,pt),"event"===r&&L.emit("plotly_selected",void 0);s.click(L,e)})).catch(v.error)}},i.doneFn=function(){dt.remove(),x.done(mt).then((function(){x.clear(mt),i.gd.emit("plotly_selected",et),Q&&i.selectionDefs&&(Q.subtract=ct,i.selectionDefs.push(Q),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,J)),i.doneFnCompleted&&i.doneFnCompleted(gt)})).catch(v.error),b&&B(i)}},clearSelect:C,clearSelectionsCache:B,selectOnClick:P}},{"../../components/color":83,"../../components/dragelement/helpers":101,"../../components/drawing":105,"../../components/fx":123,"../../components/fx/helpers":119,"../../components/shapes/draw_newshape/display_outlines":168,"../../components/shapes/draw_newshape/helpers":169,"../../components/shapes/draw_newshape/newshapes":170,"../../lib":212,"../../lib/clear_gl_canvases":198,"../../lib/polygon":224,"../../lib/throttle":235,"../../plot_api/subroutines":248,"../../registry":308,"./axis_ids":261,"./constants":264,"./handle_outline":268,"./helpers":269,polybooljs:57}],278:[function(t,e,r){"use strict";var n=t("d3"),i=t("d3-time-format").utcFormat,a=t("fast-isnumeric"),o=t("../../lib"),s=o.cleanNumber,l=o.ms2DateTime,u=o.dateTime2ms,c=o.ensureNumber,p=o.isArrayOrTypedArray,h=t("../../constants/numerical"),f=h.FP_SAFE,d=h.BADNUM,m=h.LOG_CLIP,g=h.ONEWEEK,y=h.ONEDAY,v=h.ONEHOUR,_=h.ONEMIN,x=h.ONESEC,b=t("./axis_ids"),w=t("./constants"),T=w.HOUR_PATTERN,k=w.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function M(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function S(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function C(e,r,n,i){if((i||{}).msUTC&&a(e))return+e;var s=u(e,n||t.calendar);if(s===d){if(!a(e))return d;e=+e;var l=Math.floor(10*o.mod(e+.05,1)),c=Math.round(e-l/10);s=u(new Date(c))+l/10}return s}function L(e,r,n){return l(e,r,n||t.calendar)}function E(e){return t._categories[Math.round(e)]}function I(e){if(M(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=z(t);return void 0!==e?e:a(t)?+t:void 0}function D(t){return a(t)?+t:z(t)}function O(t,e,r){return n.round(r+e*t,2)}function R(t,e,r){return(t-r)/e}var F=function(e){return a(e)?O(e,t._m,t._b):d},B=function(e){return R(e,t._m,t._b)};if(t.rangebreaks){var N="y"===h;F=function(e){if(!a(e))return d;var r=t._rangebreaks.length;if(!r)return O(e,t._m,t._b);var n=N;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,s=0,l=0;l<r;l++){var u=i*t._rangebreaks[l].min,c=i*t._rangebreaks[l].max;if(o<u)break;if(!(o>c)){s=o<(u+c)/2?l:l+1;break}s=l+1}var p=t._B[s]||0;return isFinite(p)?O(e,t._m2,p):0},B=function(e){var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);for(var n=0,i=0;i<r&&!(e<t._rangebreaks[i].pmin);i++)e>t._rangebreaks[i].pmax&&(n=i+1);return R(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:c,t.l2c="log"===t.type?A:c,t.l2p=F,t.p2l=B,t.c2p="log"===t.type?function(t,e){return F(S(t,e))}:F,t.p2c="log"===t.type?function(t){return A(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=B,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(s(t),e)},t.r2d=t.r2c=function(t){return A(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=S,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(B(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=B,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=C,t.c2d=t.c2r=t.l2d=t.l2r=L,t.d2p=t.r2p=function(e,r,n){return t.l2p(C(e,0,n))},t.p2d=t.p2r=function(t,e,r){return L(B(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=E,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=c,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return E(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var i,a,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[b.id2name(u)];s=s.concat(c._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;i<s.length;i++){var m=n[s[i]];if(h in m){var g=m[h],y=m._length||o.minRowLength(g);if(p(g[0])&&p(g[1]))for(a=0;a<y;a++){var v=g[0][a],_=g[1][a];M(v)&&M(_)&&(d.push([v,_]),v in f[0][1]||(f[0][1][v]=f[0][0]++),_ in f[1][1]||(f[1][1][_]=f[1][0]++))}}}for(d.sort((function(t,e){var r=f[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var i=f[1][1];return i[t[1]]-i[e[1]]})),i=0;i<d.length;i++)I(d[i])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i=(i="date"===t.type?o.dfltRange(t.calendar):"y"===h?w.DFLTRANGEY:r.dfltRange||w.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(i[0]=0),s&&2===s.length)for("date"!==t.type||t.autorange||(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-f?s[n]=-f:s[n]>f&&(s[n]=f),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=b.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,u=t.r2l(t[a][0],o),c=t.r2l(t[a][1],o),p="y"===h;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._lBreaks+=Math.abs(l.max-l.min);var f=p;u>c&&(f=!f),f&&t._rangebreaks.reverse();var d=f?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(p?c:u)),s=0;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._B.push(t._B[t._B.length-1]-d*t._m2*(l.max-l.min));for(s=0;s<t._rangebreaks.length;s++)(l=t._rangebreaks[s]).pmin=F(l.min),l.pmax=F(l.max)}if(!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.maskBreaks=function(e){for(var r,n,i,a,l,u=t.rangebreaks||[],c=0;c<u.length;c++){var p=u[c];if(p.enabled)if(p.bounds){var h=p.pattern;switch(n=(r=o.simpleMap(p.bounds,h?s:t.d2c))[0],i=r[1],h){case k:a=(l=new Date(e)).getUTCDay(),n>i&&(i+=7,a<n&&(a+=7));break;case T:a=(l=new Date(e)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>i&&(i+=24,a<n&&(a+=24));break;case"":a=e}if(a>=n&&a<i)return d}else for(var f=o.simpleMap(p.values,t.d2c).sort(o.sorterAsc),m=0;m<f.length;m++)if(i=(n=f[m])+p.dvalue,e>=n&&e<i)return d}return e},t.locateBreaks=function(e,r){var n,i,a,l,u=[];if(!t.rangebreaks)return u;var c=t.rangebreaks.slice().sort((function(t,e){return t.pattern===k&&e.pattern===T?-1:e.pattern===k&&t.pattern===T?1:0})),p=function(t,n){if((t=o.constrain(t,e,r))!==(n=o.constrain(n,e,r))){for(var i=!0,a=0;a<u.length;a++){var s=u[a];t<s.max&&n>=s.min&&(t<s.min&&(s.min=t),n>s.max&&(s.max=n),i=!1)}i&&u.push({min:t,max:n})}};for(n=0;n<c.length;n++){var h=c[n];if(h.enabled)if(h.bounds){var f=e,d=r;h.pattern&&(f=Math.floor(f)),a=(i=o.simpleMap(h.bounds,h.pattern?s:t.r2l))[0],l=i[1];var m,b,w=new Date(f);switch(h.pattern){case k:b=g,m=(l-a+(l<a?7:0))*y,f+=a*y-(w.getUTCDay()*y+w.getUTCHours()*v+w.getUTCMinutes()*_+w.getUTCSeconds()*x+w.getUTCMilliseconds());break;case T:b=y,m=(l-a+(l<a?24:0))*v,f+=a*v-(w.getUTCHours()*v+w.getUTCMinutes()*_+w.getUTCSeconds()*x+w.getUTCMilliseconds());break;default:f=Math.min(i[0],i[1]),m=b=(d=Math.max(i[0],i[1]))-f}for(var A=f;A<d;A+=b)p(A,A+m)}else for(var M=o.simpleMap(h.values,t.d2c),S=0;S<M.length;S++)p(a=M[S],l=a+h.dvalue)}return u.sort((function(t,e){return t.min-e.min})),u},t.makeCalcdata=function(e,r,n){var i,a,s,l,u=t.type,c="date"===u&&e[r+"calendar"];if(r in e){if(i=e[r],l=e._length||o.minRowLength(i),o.isTypedArray(i)&&("linear"===u||"log"===u)){if(l===i.length)return i;if(i.subarray)return i.subarray(0,l)}if("multicategory"===u)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var i=(t[0]||[])[n],a=(t[1]||[])[n];r[n]=z([i,a])}return r}(i,l);for(a=new Array(l),s=0;s<l;s++)a[s]=t.d2c(i[s],0,c,n)}else{var p=r+"0"in e?t.d2c(e[r+"0"],0,c):0,h=e["d"+r]?Number(e["d"+r]):1;for(i=e[{x:"y",y:"x"}[r]],l=e._length||i.length,a=new Array(l),s=0;s<l;s++)a[s]=p+s*h}if(t.rangebreaks)for(s=0;s<l;s++)a[s]=t.maskBreaks(a[s]);return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&a(t.r2l(e[0]))&&a(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[h],null,r),i=t.r2l(t.range[0]),a=t.r2l(t.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},t._emptyCategories=function(){t._categories=[],t._categoriesMap={}},t.clearCalc=function(){var r=t._matchGroup;if(r){var n=null,i=null;for(var a in r){var o=e[b.id2name(a)];if(o._categories){n=o._categories,i=o._categoriesMap;break}}n&&i?(t._categories=n,t._categoriesMap=i):t._emptyCategories()}else t._emptyCategories();if(t._initialCategories)for(var s=0;s<t._initialCategories.length;s++)I(t._initialCategories[s])},t.sortByInitialCategories=function(){var n=[];if(t._emptyCategories(),t._initialCategories)for(var i=0;i<t._initialCategories.length;i++)I(t._initialCategories[i]);n=n.concat(t._traceIndices);var a=t._matchGroup;for(var o in a)if(r!==o){var s=e[b.id2name(o)];s._categories=t._categories,s._categoriesMap=t._categoriesMap,n=n.concat(s._traceIndices)}return n};var U=e._d3locale;"date"===t.type&&(t._dateFormat=U?U.timeFormat:i,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=U?U.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":189,"../../lib":212,"./axis_ids":261,"./constants":264,d3:16,"d3-time-format":14,"fast-isnumeric":18}],279:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").contrast,a=t("./layout_attributes"),o=t("../array_container_defaults");function s(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}function l(t,e){function r(r,i){return n.coerce(t,e,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,u,c,p){p&&1!==p.pass||function(t,e,r,n,i){var a=s(t);r("tickprefix")&&r("showtickprefix",a);r("ticksuffix",i.tickSuffixDflt)&&r("showticksuffix",a)}(t,0,r,0,c),p&&2!==p.pass||function(t,e,r,u,c){var p=s(t);r("tickprefix")&&r("showtickprefix",p);r("ticksuffix",c.tickSuffixDflt)&&r("showticksuffix",p);if(r("showticklabels")){var h=c.font||{},f=e.color,d=-1!==(e.ticklabelposition||"").indexOf("inside")?i(c.bgColor):f&&f!==a.color.dflt?f:h.color;if(n.coerceFont(r,"tickfont",{family:h.family,size:h.size,color:d}),r("tickangle"),"category"!==u){var m=r("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),e.tickformatstops.length||delete e.tickformatstops,m||"date"===u||(r("showexponent",p),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}(t,e,r,u,c)}},{"../../components/color":83,"../../lib":212,"../array_container_defaults":253,"./layout_attributes":272}],280:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":212,"./layout_attributes":272}],281:[function(t,e,r){"use strict";var n=t("./clean_ticks"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a){function o(r){var n=t[r];return void 0!==n?n:(e._template||{})[r]}var s=o("tick0"),l=o("dtick"),u=o("tickvals"),c=r("tickmode",i(u)?"array":l?"linear":"auto");if("auto"===c)r("nticks");else if("linear"===c){var p=e.dtick=n.dtick(l,a);e.tick0=n.tick0(s,a,e.calendar,p)}else if("multicategory"!==a){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../lib":212,"./clean_ticks":263}],282:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../../components/drawing"),s=t("./axes");e.exports=function(t,e,r,l){var u=t._fullLayout;if(0!==e.length){var c,p,h,f;l&&(c=l());var d=n.ease(r.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(f),f=null,function(){for(var r={},n=0;n<e.length;n++){var a=e[n],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return i.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)}))}()})),p=Date.now(),f=window.requestAnimationFrame((function n(){h=Date.now();for(var a=Math.min(1,(h-p)/r.duration),o=d(a),s=0;s<e.length;s++)g(e[s],o);h-p>r.duration?(!function(){for(var r={},n=0;n<e.length;n++){var a=e[n],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}c&&c(),i.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)}))}(),f=window.cancelAnimationFrame(n)):f=window.requestAnimationFrame(n)})),Promise.resolve()}function m(t){var e=t.xaxis,r=t.yaxis;u._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],y=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*y/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=a.simpleMap(e.yr0,l.r2l),_=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=i.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,A=h?f[1]:0,M=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":105,"../../lib":212,"../../registry":308,"./axes":258,d3:16}],283:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var f=a(u),d=[];for(r=0;r<e.length;r++){var m=e[r];n(m,"box-violin")&&(m[l+"axis"]||l)===s&&(void 0!==m[f]?d.push(m[f][0]):void 0!==m.name?d.push(m.name):d.push("text"),m[c]!==p&&(p=void 0))}t.type=i(d,p,h)}else if("splom"===u.type){var g=u.dimensions[u._axesDim[s]];g.visible&&(t.type=i(g.values,p,h))}else t.type=i(u[l]||[u[l+"0"]],p,h)}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":308,"./axis_autotype":259}],284:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib");function a(t,e,r){var n,a,o,s=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=i.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==a&&(s=!0),o[e.prop]=a,{changed:s,value:a}}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!i.isPlainObject(n))return r;a=n}return l(a,(function(t,e,n){r.push({type:"layout",prop:t,value:n})}),"",0),r}function s(t,e){var r,n,a,o,s=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!i.isPlainObject(n))return s;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,(function(e,n,i){var a,o;if(Array.isArray(i)){o=i.slice();var l=Math.min(o.length,t.data.length);r&&(l=Math.min(l,r.length)),a=[];for(var u=0;u<l;u++)a[u]=r?r[u]:u}else o=i,a=r?r.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var c=o;o=[];for(var p=0;p<a.length;p++)o[p]=c}o.length=Math.min(a.length,o.length)}s.push({type:"data",prop:e,traces:a,value:o})}),"",0),s}function l(t,e,r,n){Object.keys(t).forEach((function(a){var o=t[a];if("_"!==a[0]){var s=r+(n>0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;p<c.length;p++)t._internalOn(c[p],s.check);s.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],s.check)}}else i.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},e&&(e._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var p=r.computeAPICommandBindings(t,u,c);if(1!==p.length)return!1;if(a){if((s=p[0]).type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var h=0;h<a.traces.length;h++)if(a.traces[h]!==s.traces[h])return!1}else if(s.prop!==a.prop)return!1}else a=p[0],Array.isArray(a.traces)&&a.traces.sort();var f=(s=p[0]).value;if(Array.isArray(f)){if(1!==f.length)return!1;f=f[0]}n&&(n[f]=i)}return a},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var a=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return a.apply(null,o).catch((function(t){return i.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)}))},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=s(t,r);break;case"relayout":n=o(t,r);break;case"update":n=s(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":212,"../registry":308}],285:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},i=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(i.row={valType:"integer",min:0,dflt:0,editType:t.editType},i.column={valType:"integer",min:0,dflt:0,editType:t.editType}),i},r.defaults=function(t,e,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete t.domain.row)}var u=r("domain.x",i),c=r("domain.y",a);u[0]<u[1]||(t.domain.x=i.slice()),c[0]<c[1]||(t.domain.y=a.slice())}},{"../lib/extend":204}],286:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],287:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],288:[function(t,e,r){"use strict";var n=t("../registry"),i=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var i=n.subplotsRegistry[e];if(!i)return[];for(var a=i.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[a]===r&&o.push(l)}return o},r.getModuleCalcData=function(t,e){var r,i=[],a=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[i,t];for(var o=0;o<t.length;o++){var s=t[o],l=s[0].trace;!0===l.visible&&0!==l._length&&(l._module.plot===r?i.push(s):a.push(s))}return[i,a]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var a,o,s,l=n.subplotsRegistry[e].attr,u=[];if("gl2d"===e){var c=r.match(i);o="x"+c[1],s="y"+c[2]}for(var p=0;p<t.length;p++)a=t[p],"gl2d"===e&&n.traceIs(a,"gl2d")?a[l[0]]===o&&a[l[1]]===s&&u.push(a):a[l]===r&&u.push(a);return u}},{"../registry":308,"./cartesian/constants":264}],289:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],290:[function(t,e,r){"use strict";var n=t("./font_attributes"),i=t("./animation_attributes"),a=t("../components/color/attributes"),o=t("../components/shapes/draw_newshape/attributes"),s=t("./pad_attributes"),l=t("../lib/extend").extendFlat,u=n({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=a.defaultLine,e.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},newshape:o.newshape,activeshape:o.activeshape,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},i.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":82,"../components/shapes/draw_newshape/attributes":165,"../lib/extend":204,"./animation_attributes":252,"./font_attributes":286,"./pad_attributes":298}],291:[function(t,e,r){"use strict";var n={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'<a href="http://www.openstreetmap.org/about/" target="_blank">\xa9 OpenStreetMap</a>',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">\xa9 CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">\xa9 CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},i=Object.keys(n);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],292:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":212}],293:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),u=t("d3"),c=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),h=t("./mapbox"),f=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l<e.length;l++){var u=r[e[l]],c=u.accesstoken;d(u.style)&&(c?i.pushUnique(n,c):(d(u._input.style)&&(i.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),c&&i.pushUnique(a,c)}if(s){var p=o?f.noAccessTokenErrorMsg:f.missingStyleErrorMsg;throw i.error(p),new Error(p)}return n.length?(n.length>1&&i.warn(f.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l<a.length;l++){var u=a[l],c=s(r,"mapbox",u),p=e[u],m=p._subplot;m||(m=new h(t,u),e[u]._subplot=m),m.viewInitial||(m.viewInitial={center:i.extendFlat({},p.center),zoom:p.zoom,bearing:p.bearing,pitch:p.pitch}),m.plot(c,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=n._subplots.mapbox||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=e._size,i=0;i<r.length;i++){var s=e[r[i]],h=s.domain,d=s._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:l.svg,"xlink:href":d,x:n.l+n.w*h.x[0],y:n.t+n.h*(1-h.y[1]),width:n.w*(h.x[1]-h.x[0]),height:n.h*(h.y[1]-h.y[0]),preserveAspectRatio:"none"});var m=u.select(s._subplot.div);if(!(null===m.select(".mapboxgl-ctrl-logo").node().offsetParent)){var g=e._glimages.append("g");g.attr("transform",a(n.l+n.w*h.x[0]+10,n.t+n.h*(1-h.y[0])-31)),g.append("path").attr("d",f.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),g.append("path").attr("d",f.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),g.append("path").attr("d",f.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),g.append("polygon").attr("points",f.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var y=m.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),v=e._glimages.append("g"),_=v.append("text");_.text(y).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":y});var x=c.bBox(_.node()),b=n.w*(h.x[1]-h.x[0]);if(x.width>b/2){var w=y.split("|").join("<br>");_.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),x=c.bBox(_.node())}_.attr("transform",a(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;x.width+6>b&&(T=b/(x.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];v.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n<r.length;n++){e[r[n]]._subplot.updateFx(e)}}},{"../../components/drawing":105,"../../constants/xmlns_namespaces":190,"../../lib":212,"../../lib/svg_text_utils":234,"../../plots/get_data":288,"./constants":291,"./layout_attributes":295,"./layout_defaults":296,"./mapbox":297,d3:16,"mapbox-gl":54}],294:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/svg_text_utils").sanitizeHTML,a=t("./convert_text_opts"),o=t("./constants");function s(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;function u(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var r=0;r<e.length;r++)if("string"!=typeof e[r]||0===e[r].length)return!1;return!0}return n.isPlainObject(e)||"string"==typeof e&&e.length>0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r<e.length;r++){var n=e[r].id;if("string"==typeof n&&0===n.indexOf(o.traceLayerPrefix)){t=n;break}}return t},l.updateLayer=function(t){var e=this.subplot,r=c(t),n=this.lookupBelow(),i=this.findFollowingMapboxLayerId(n);this.removeLayer(),u(t)&&e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=t.type,this.below=n},l.updateStyle=function(t){if(u(t)){var e=c(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},l.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},l.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new s(t,e);return n.update(r),n}},{"../../lib":212,"../../lib/svg_text_utils":234,"./constants":291,"./convert_text_opts":292}],295:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,u=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),p=o({});p.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:p,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color":83,"../../lib":212,"../../plot_api/edit_types":240,"../../plot_api/plot_template":247,"../../traces/scatter/attributes":339,"../domain":285,"../font_attributes":286,"./constants":291}],296:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}if(r("visible")){var i,a=r("sourcetype"),s="raster"===a||"image"===a;r("source"),r("sourceattribution"),"vector"===a&&r("sourcelayer"),"image"===a&&r("coordinates"),s&&(i="raster");var l=r("type",i);s&&"raster"!==l&&(l=e.type="raster",n.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===l&&r("circle.radius"),"line"===l&&(r("line.width"),r("line.dash")),"fill"===l&&r("fill.outlinecolor"),"symbol"===l&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":212,"../array_container_defaults":253,"../subplot_defaults":306,"./layout_attributes":295}],297:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../registry"),s=t("../cartesian/axes"),l=t("../../components/dragelement"),u=t("../../components/fx"),c=t("../../components/dragelement/helpers"),p=c.rectMode,h=c.drawMode,f=c.selectMode,d=t("../cartesian/select").prepSelect,m=t("../cartesian/select").clearSelect,g=t("../cartesian/select").clearSelectionsCache,y=t("../cartesian/select").selectOnClick,v=t("./constants"),_=t("./layers");function x(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var b=x.prototype;b.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash={},i.layerList=[]),n=i.map?new Promise((function(r,n){i.updateMap(t,e,r,n)})):new Promise((function(r,n){i.createMap(t,e,r,n)})),r.push(n)},b.createMap=function(t,e,r,i){var o=this,s=e[o.id],l=o.styleObj=T(s.style);o.accessToken=s.accesstoken;var u=o.map=new n.Map({container:o.div,style:l.style,center:A(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0}));u._canvas.style.left="0px",u._canvas.style.top="0px",o.rejectOnError(i),o.isStatic||o.initFx(t,e);var c=[];c.push(new Promise((function(t){u.once("load",t)}))),c=c.concat(a.fetchTraceGeoData(t)),Promise.all(c).then((function(){o.fillBelowLookup(t,e),o.updateData(t),o.updateLayout(e),o.resolveOnRender(r)})).catch(i)},b.updateMap=function(t,e,r,n){var i=this,o=i.map,s=e[this.id];i.rejectOnError(n);var l=[],u=T(s.style);JSON.stringify(i.styleObj)!==JSON.stringify(u)&&(i.styleObj=u,o.setStyle(u.style),i.traceHash={},l.push(new Promise((function(t){o.once("styledata",t)})))),l=l.concat(a.fetchTraceGeoData(t)),Promise.all(l).then((function(){i.fillBelowLookup(t,e),i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)})).catch(n)},b.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var u=i[r];n="string"==typeof u.below?u.below:o?"traces":"",a["layout-"+r]=n}var c,p,h={};for(c in a)h[n=a[c]]?h[n].push(c):h[n]=[c];for(n in h){var f=h[n];if(f.length>1)for(r=0;r<f.length;r++)0===(c=f[r]).indexOf("trace-")?(p=c.split("trace-")[1],this.traceHash[p]&&(this.traceHash[p].below=null)):0===c.indexOf("layout-")&&(p=c.split("layout-")[1],this.layerList[p]&&(this.layerList[p].below=null))}};var w={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function T(t){var e={};return i.isPlainObject(t)?(e.id=t.id,e.style=t):"string"==typeof t?(e.id=t,-1!==v.styleValuesMapbox.indexOf(t)?e.style=k(t):v.stylesNonMapbox[t]?e.style=v.stylesNonMapbox[t]:e.style=t):(e.id=v.styleValueDflt,e.style=k(v.styleValueDflt)),e.transition={duration:0,delay:0},e}function k(t){return v.styleUrlPrefix+t+"-"+v.styleUrlSuffix}function A(t){return[t.lon,t.lat]}b.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort((function(t,e){return w[t[0].trace.type]-w[e[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var u=Object.keys(a);t:for(n=0;n<u.length;n++){var c=u[n];for(i=0;i<t.length;i++)if(c===(r=t[i][0].trace).uid)continue t;(e=a[c]).dispose(),delete a[c]}},b.updateLayout=function(t){var e=this.map,r=t[this.id];this.dragging||this.wheeling||(e.setCenter(A(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.mapbox?e.scrollZoom.enable():e.scrollZoom.disable()},b.resolveOnRender=function(t){var e=this.map;e.on("render",(function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))}))},b.rejectOnError=function(t){var e=this.map;function r(){t(new Error(v.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},b.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},s.setConvert(e.mockAxis,t)},b.initFx=function(t,e){var r=this,n=r.gd,i=r.map;function a(){u.loneUnhover(e._hoverlayer)}function s(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}i.on("moveend",(function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];o.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var a=r.getView();i._input.center=i.center=a.center,i._input.zoom=i.zoom=a.zoom,i._input.bearing=i.bearing=a.bearing,i._input.pitch=i.pitch=a.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(a))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e._rehover&&e._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(t){var e=r.div.getBoundingClientRect(),a=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&u.hover(n,t,r.id)},u.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,a()})),i.on("zoomstart",a),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var t=n._fullLayout[r.id];o.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;i.setCenter(A(e.center)),i.setZoom(e.zoom),i.setBearing(e.bearing),i.setPitch(e.pitch);var a=r.getView();t._input.center=t.center=a.center,t._input.zoom=t.zoom=a.zoom,t._input.bearing=t.bearing=a.bearing,t._input.pitch=t.pitch=a.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(a))})),r.clearSelect=function(){g(r.dragOptions),m(r.dragOptions.gd)},r.onClickInPanFn=function(t){return function(e){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&y(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=p(o)?function(t,r){(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(u)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),f(o)||h(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){d(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(_(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},b.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},b.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},b.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},b.getMapLayers=function(){return this.map.getStyle().layers},b.addLayer=function(t,e){var r=this.map;if("string"==typeof e){if(""===e)return void r.addLayer(t,e);for(var n=this.getMapLayers(),a=0;a<n.length;a++)if(e===n[a].id)return void r.addLayer(t,e);i.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},b.project=function(t){return this.map.project(new n.LngLat(t[0],t[1]))},b.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=n.width,a=n.height;return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},b.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},b.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=x},{"../../components/dragelement":102,"../../components/dragelement/helpers":101,"../../components/fx":123,"../../lib":212,"../../lib/geo_location_utils":207,"../../registry":308,"../cartesian/axes":258,"../cartesian/select":277,"./constants":291,"./layers":294,"mapbox-gl":54}],298:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],299:[function(t,e,r){"use strict";var n=t("d3"),i=t("d3-time-format").timeFormatLocale,a=t("fast-isnumeric"),o=t("../registry"),s=t("../plot_api/plot_schema"),l=t("../plot_api/plot_template"),u=t("../lib"),c=t("../components/color"),p=t("../constants/numerical").BADNUM,h=t("./cartesian/axis_ids"),f=t("./cartesian/handle_outline").clearSelect,d=t("./animation_attributes"),m=t("./frame_attributes"),g=t("../plots/get_data").getModuleCalcData,y=u.relinkPrivateKeys,v=u._,_=e.exports={};u.extendFlat(_,o),_.attributes=t("./attributes"),_.attributes.type.values=_.allTypes,_.fontAttrs=t("./font_attributes"),_.layoutAttributes=t("./layout_attributes"),_.fontWeight="normal";var x=_.transformsRegistry,b=t("./command");_.executeAPICommand=b.executeAPICommand,_.computeAPICommandBindings=b.computeAPICommandBindings,_.manageCommandObserver=b.manageCommandObserver,_.hasSimpleAPICommandBindings=b.hasSimpleAPICommandBindings,_.redrawText=function(t){var e=(t=u.getGraphDiv(t))._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return new Promise((function(e){setTimeout((function(){o.getComponentMethod("annotations","draw")(t),o.getComponentMethod("legend","draw")(t),o.getComponentMethod("colorbar","draw")(t),e(_.previousPromises(t))}),300)}))},_.resize=function(t){var e;t=u.getGraphDiv(t);var r=new Promise((function(r,n){t&&!u.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||u.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,o.call("relayout",t,{autosize:!0}).then((function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))}))}}),100)}));return e&&e(r),r},_.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},_.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=u.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each((function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),i=r.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){_.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},_.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=_.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var s=0;s<2;s++){for(var l=t._context.locales,u=0;u<2;u++){var c=(l[r]||{}).format;if(c&&(a(c),n))break;l=o.localeRegistry}var p=r.split("-")[0];if(n||p===r)break;r=p}return n||a(o.localeRegistry.en.format),i}function A(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),i=t._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?t._id+s:s+t._id),!a||!e._plots[a]){a="";for(var l=t._counterAxes,u=0;u<l.length;u++){var c=l[u],p=n?t._id+c:c+t._id;o||(o=p);var f=h.getFromId(r,c);if(s&&f.overlaying===s){a=p;break}}}return a||o}function M(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],i=n._module||x[n.type];if(i&&i.makesData)return!0}return!1}function S(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=x[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function C(t){return"string"==typeof t&&"px"===t.substr(t.length-2)&&parseFloat(t)}function L(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}_.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var s,l=t._fullLayout={},c=t.layout||{},p=t._fullData||[],h=t._fullData=[],d=t.data||[],m=t.calcdata||[],g=t._context||{};t._transitionData||_.createTransitionData(t),l._dfltTitle={plot:v(t,"Click to enter Plot title"),x:v(t,"Click to enter X axis title"),y:v(t,"Click to enter Y axis title"),colorbar:v(t,"Click to enter Colorscale title"),annotation:v(t,"new text")},l._traceWord=v(t,"trace");var x=k(t,w);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var b=a.width,A=a.height;_.supplyLayoutGlobalDefaults(c,l,x),c.width||(l.width=b),c.height||(l.height=A),_.sanitizeMargins(l)}else{_.supplyLayoutGlobalDefaults(c,l,x);var M=!c.width||!c.height,S=l.autosize,C=g.autosizable;M&&(S||C)?_.plotAutoSize(t,c,l):M&&_.sanitizeMargins(l),!S&&M&&(c.width=l.width,c.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:n.locale(t).numberFormat,timeFormat:i(t).utcFormat}}(x,l.separators),l._extraFormat=k(t,T),l._initialAutoSizeIsDone=!0,l._dataLength=d.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var E=l._subplots=function(){var t,e,r=o.collectableSubplotTypes,n={};if(!r){r=[];var i=o.subplotsRegistry;for(var a in i){var s=i[a].attr;if(s&&(r.push(a),Array.isArray(s)))for(e=0;e<s.length;e++)u.pushUnique(r,s[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),I=l._splomAxes={x:{},y:{}},z=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(t,e){var r,n,i=e.length,a=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,l=new Array(i),c={};function p(t,e){l[e]=t,c[t]=1}function h(t,e){if(t&&"string"==typeof t&&!c[t])return p(t,e),!0}for(r=0;r<i;r++){var f=e[r].uid;"number"==typeof f&&(f=String(f)),h(f,r)||(r<s&&h(a[r].uid,r)||p(u.randstr(c),r))}return l}(p,d),l._globalTransforms=(t._context||{}).globalTransforms,_.supplyDataDefaults(d,h,c,l);var P=Object.keys(I.x),D=Object.keys(I.y);if(P.length>1&&D.length>1){for(o.getComponentMethod("grid","sizeDefaults")(c,l),s=0;s<P.length;s++)u.pushUnique(E.xaxis,P[s]);for(s=0;s<D.length;s++)u.pushUnique(E.yaxis,D[s]);for(var O in z)u.pushUnique(E.cartesian,O)}if(l._has=_._hasPlotType.bind(l),p.length===h.length)for(s=0;s<h.length;s++)y(h[s],p[s]);_.supplyLayoutModuleDefaults(c,l,h,t._transitionData);var R=l._visibleModules,F=[];for(s=0;s<R.length;s++){var B=R[s].crossTraceDefaults;B&&u.pushUnique(F,B)}for(s=0;s<F.length;s++)F[s](h,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&P.length>15&&D.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),_.linkSubplots(h,l,p,a),_.cleanPlot(h,l,p,a);var N=!(!a._has||!a._has("gl2d")),U=!(!l._has||!l._has("gl2d")),j=!(!a._has||!a._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||U;j&&!V?a._bgLayer.remove():V&&!j&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&f({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var a=t[i];a.meta?n[a.index]=a._meta={meta:a.meta}:e.meta&&(a._meta={meta:e.meta}),e.meta&&(a._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(h,l),y(l,a),o.getComponentMethod("colorscale","crossTraceDefaults")(h,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var q,H=l._tracePreGUI,Z={};for(q in H)Z[q]="old";for(s=0;s<h.length;s++)Z[q=h[s]._fullInput.uid]||(H[q]={}),Z[q]="new";for(q in Z)"old"===Z[q]&&delete H[q];L(l),o.getComponentMethod("rangeslider","makeData")(l),r||m.length!==h.length||_.supplyDefaultsUpdateCalc(m,h)}},_.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=(t[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,l,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(a,s).get().slice(),u.nestedProperty(n,s).set(l)}i.trace=n}}},_.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},_._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e].name;if(i===t)return!0;var a=o.modules[i];if(a&&a.categories[t])return!0}return!1},_.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),u=e._has&&e._has("gl");l&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var c=!!n._infolayer;t:for(i=0;i<r.length;i++){var p=r[i].uid;for(a=0;a<t.length;a++){if(p===t[a].uid)continue t}c&&n._infolayer.select(".cb"+p).remove()}},_.linkSubplots=function(t,e,r,n){var i,a,s=n._plots||{},l=e._plots={},c=e._subplots,p={_fullData:t,_fullLayout:e},f=c.cartesian.concat(c.gl2d||[]);for(i=0;i<f.length;i++){var d,m=f[i],g=s[m],y=h.getFromId(p,m,"x"),v=h.getFromId(p,m,"y");for(g?d=l[m]=g:(d=l[m]={}).id=m,y._counterAxes.push(v._id),v._counterAxes.push(y._id),y._subplotsWith.push(m),v._subplotsWith.push(m),d.xaxis=y,d.yaxis=v,d._hasClipOnAxisFalse=!1,a=0;a<t.length;a++){var _=t[a];if(_.xaxis===d.xaxis._id&&_.yaxis===d.yaxis._id&&!1===_.cliponaxis){d._hasClipOnAxisFalse=!0;break}}}var x,b=h.list(p,null,!0);for(i=0;i<b.length;i++){var w=null;(x=b[i]).overlaying&&(w=h.getFromId(p,x.overlaying))&&w.overlaying&&(x.overlaying=!1,w=null),x._mainAxis=w||x,w&&(x.domain=w.domain.slice()),x._anchorAxis="free"===x.anchor?null:h.getFromId(p,x.anchor)}for(i=0;i<b.length;i++)if((x=b[i])._counterAxes.sort(h.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=A(x,e),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||o.getComponentMethod("rangeslider","isVisible")(x))){var T=1,k=0;for(a=0;a<x._counterAxes.length;a++){var M=h.getFromId(p,x._counterAxes[a]);T=Math.min(T,M.domain[0]),k=Math.max(k,M.domain[1])}T<k&&(x._counterDomainMin=T,x._counterDomainMax=k)}},_.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],s.crawl(t._module.attributes,(function(t,n,i,a){r[a]=n,r.length=a+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))}))),n=0;n<e.length;n++){u.nestedProperty(t,"_input."+e[n]).get()||u.nestedProperty(t,e[n]).set(null)}},_.supplyDataDefaults=function(t,e,r,n){var i,a,s,c=n._modules,p=n._visibleModules,h=n._basePlotModules,f=0,d=0;function m(t){e.push(t);var r=t._module;r&&(u.pushUnique(c,r),!0===t.visible&&u.pushUnique(p,r),u.pushUnique(h,t._module.basePlotModule),f++,!1!==t._input.visible&&d++)}n._transformModules=[];var g={},v=[],x=(r.template||{}).data||{},b=l.traceTemplater(x);for(i=0;i<t.length;i++){if(s=t[i],(a=b.newTrace(s)).uid=n._traceUids[i],_.supplyTraceDefaults(s,a,d,n,i),a.index=i,a._input=s,a._expandedIndex=f,a.transforms&&a.transforms.length)for(var w=!1!==s.visible&&!1===a.visible,T=S(a,e,r,n),k=0;k<T.length;k++){var A=T[k],M={_template:a._template,type:a.type,uid:a.uid+k};w&&!1===A.visible&&delete A.visible,_.supplyTraceDefaults(A,M,f,n,i),y(M,A),M.index=i,M._input=s,M._fullInput=a,M._expandedIndex=f,M._expandedInput=A,m(M)}else a._fullInput=a,a._expandedInput=a,m(a);o.traceIs(a,"carpetAxis")&&(g[a.carpet]=a),o.traceIs(a,"carpetDependent")&&v.push(i)}for(i=0;i<v.length;i++)if((a=e[v[i]]).visible){var C=g[a.carpet];a._carpet=C,C&&C.visible?(a.xaxis=C.xaxis,a.yaxis=C.yaxis):a.visible=!1}},_.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return u.coerce(t||{},r,d,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=_.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=_.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=_.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=_.supplyAnimationTransitionDefaults(t.transition||{});return r},_.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,d.frame,r,n)}return r("duration"),r("redraw"),e},_.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,d.transition,r,n)}return r("duration"),r("easing"),e},_.supplyFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t,e,m,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},_.supplyTraceDefaults=function(t,e,r,n,i){var a,s=n.colorway||c.defaults,l=s[r%s.length];function p(r,n){return u.coerce(t,e,_.attributes,r,n)}var h=p("visible");p("type"),p("name",n._traceWord+" "+i),p("uirevision",n.uirevision);var f=_.getModule(e);if(e._module=f,f){var d=f.basePlotModule,m=d.attr,g=d.attributes;if(m&&g){var y=n._subplots,v="";if(h||"gl2d"!==d.name){if(Array.isArray(m))for(a=0;a<m.length;a++){var x=m[a],b=u.coerce(t,e,g,x);y[x]&&u.pushUnique(y[x],b),v+=b}else v=u.coerce(t,e,g,m);y[d.name]&&u.pushUnique(y[d.name],v)}}}return h&&(p("customdata"),p("ids"),p("meta"),o.traceIs(e,"showLegend")?(u.coerce(t,e,f.attributes.showlegend?f.attributes:_.attributes,"showlegend"),p("legendgroup"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,f&&f.supplyDefaults(t,e,l,n),o.traceIs(e,"noOpacity")||p("opacity"),o.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),o.traceIs(e,"noHover")||(e.hovertemplate||u.coerceHoverinfo(t,e,n),"parcats"!==e.type&&o.getComponentMethod("fx","supplyDefaults")(t,e,l,n)),f&&f.selectPoints&&p("selectedpoints"),_.supplyTransformDefaults(t,e,n)),e},_.hasMakesDataTransform=M,_.supplyTransformDefaults=function(t,e,r){if(e._length||M(t)){var n=r._globalTransforms||[],i=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var a=t.transforms||[],o=n.concat(a),s=e.transforms=[],l=0;l<o.length;l++){var c,p=o[l],h=p.type,f=x[h],d=!(p._module&&p._module===f),m=f&&"function"==typeof f.transform;f||u.warn("Unrecognized transform type "+h+"."),f&&f.supplyDefaults&&(d||m)?((c=f.supplyDefaults(p,e,r,t)).type=h,c._module=f,u.pushUnique(i,f)):c=u.extendFlat({},p),s.push(c)}}},_.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return u.coerce(t,e,_.layoutAttributes,r,n)}var i=t.template;u.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),n("autotypenumbers");var a=u.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),u.coerceFont(n,"title.font",{family:a.family,size:Math.round(1.4*a.size),color:a.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&_.sanitizeMargins(e),o.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var s=n("uirevision");n("editrevision",s),n("selectionrevision",s),n("modebar.orientation"),n("modebar.bgcolor",c.addOpacity(e.paper_bgcolor,.5));var l=c.contrast(c.rgb(e.modebar.bgcolor));n("modebar.color",c.addOpacity(l,.3)),n("modebar.activecolor",c.addOpacity(l,.7)),n("modebar.uirevision",s),o.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,n),n("meta"),u.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),o.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),o.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},_.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,l=u.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(t):{};if(n=C(c.width)||C(c.maxWidth)||r.width,i=C(c.height)||C(c.maxHeight)||r.height,a(s)&&s>0){var p=1-2*s;n=Math.round(p*n),i=Math.round(p*i)}}var h=_.layoutAttributes.width.min,f=_.layoutAttributes.height.min;n<h&&(n=h),i<f&&(i=f);var d=!e.width&&Math.abs(r.width-n)>1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,s,l=o.componentsRegistry,c=e._basePlotModules,p=o.subplotsRegistry.cartesian;for(i in l)(s=l[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(p),e._has("cartesian")&&(o.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a<c.length;a++)(s=c[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var f=e._modules;for(a=0;a<f.length;a++)(s=f[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var d=e._transformModules;for(a=0;a<d.length;a++)(s=d[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,n);for(i in l)(s=l[i]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)},_.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},_.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&u.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},_.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},_.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},_.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};_.autoMargin=function(t,e,r){var n=t._fullLayout,i=n.width,a=n.height,o=n.margin,s=u.constrain(i-o.l-o.r,2,64),l=u.constrain(a-o.t-o.b,2,64),c=Math.max(0,i-s),p=Math.max(0,a-l),h=n._pushmargin,f=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var d=r.pad;if(void 0===d&&(d=Math.min(12,o.l,o.r,o.t,o.b)),c){var m=(r.l+r.r)/c;m>1&&(r.l/=m,r.r/=m)}if(p){var g=(r.t+r.b)/p;g>1&&(r.t/=g,r.b/=g)}var y=void 0!==r.xl?r.xl:r.x,v=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,b=void 0!==r.yb?r.yb:r.y;h[e]={l:{val:y,size:r.l+d},r:{val:v,size:r.r+d},b:{val:b,size:r.b+d},t:{val:x,size:r.t+d}},f[e]=1}else delete h[e],delete f[e];if(!n._replotting)return _.doAutoMargin(t)}},_.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),L(e);var i=e._size,s=e.margin,l=u.extendFlat({},i),c=s.l,p=s.r,f=s.t,d=s.b,m=e._pushmargin,g=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var y in m)g[y]||delete m[y];for(var v in m.base={l:{val:0,size:c},r:{val:1,size:p},t:{val:1,size:f},b:{val:0,size:d}},m){var x=m[v].l||{},b=m[v].b||{},w=x.val,T=x.size,k=b.val,A=b.size;for(var M in m){if(a(T)&&m[M].r){var S=m[M].r.val,C=m[M].r.size;if(S>w){var E=(T*S+(C-r)*w)/(S-w),I=(C*(1-w)+(T-r)*(1-S))/(S-w);E+I>c+p&&(c=E,p=I)}}if(a(A)&&m[M].t){var z=m[M].t.val,P=m[M].t.size;if(z>k){var D=(A*z+(P-n)*k)/(z-k),O=(P*(1-k)+(A-n)*(1-z))/(z-k);D+O>d+f&&(d=D,f=O)}}}}}var R=u.constrain(r-s.l-s.r,2,64),F=u.constrain(n-s.t-s.b,2,64),B=Math.max(0,r-R),N=Math.max(0,n-F);if(B){var U=(c+p)/B;U>1&&(c/=U,p/=U)}if(N){var j=(d+f)/N;j>1&&(d/=j,f/=j)}if(i.l=Math.round(c),i.r=Math.round(p),i.t=Math.round(f),i.b=Math.round(d),i.p=Math.round(s.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&_.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount<V)return o.call("plot",t);e._size=l,u.warn("Too many auto-margin redraws.")}!function(t){for(var e=h.list(t,"",!0),r=0;r<e.length;r++){var n=e[r]._hideOutOfRangeInsideTickLabels;n&&n()}}(t)};var E=["l","r","t","b","p","w","h"];function I(t,e,r){var n=!1;var i=[_.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,_.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise((function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return o.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,s=0;function l(){return a++,function(){s++,n||s!==a||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return o.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}_.didMarginChange=function(t,e){for(var r=0;r<E.length;r++){var n=E[r],i=t[n],o=e[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},_.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&_.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var p={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=c(s),i)){var h=s._size;p.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return t.framework&&t.framework.isPolar&&(p=t.framework.getConfig()),l&&(p.frames=c(l)),a&&(p.config=c(t._context,!0)),"object"===n?p:JSON.stringify(p)},_.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},_.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=_.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)null!=(i=n[r])&&(-1===(a=c.traces.indexOf(i))&&(a=c.data.length,c.traces[a]=i),c.data[a]=_.extendTrace(c.data[a],s.data[r]))}return c},_.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},_.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,c,p=u.extendDeepNoArrays({},e||{}),h=u.expandObjectPaths(p),f={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=u.nestedProperty(h,r[a])).get())?u.nestedProperty(f,r[a]).set(null):(n.set(null),u.nestedProperty(f,r[a]).set(i));if(t=u.extendDeepNoArrays(t||{},h),r&&r.length)for(a=0;a<r.length;a++)if(l=u.nestedProperty(f,r[a]).get()){for(c=(s=u.nestedProperty(t,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var d=l[o];c[o]=null===d?null:_.extendObjectWithContainers(c[o],d)}s.set(c)}return t},_.dataArrayContainers=["transforms","dimensions"],_.layoutArrayContainers=o.layoutArrayContainers,_.extendTrace=function(t,e){return _.extendObjectWithContainers(t,e,_.dataArrayContainers)},_.extendLayout=function(t,e){return _.extendObjectWithContainers(t,e,_.layoutArrayContainers)},_.transition=function(t,e,r,n,i,a){var o={redraw:i.redraw},s={},l=[];return o.prepareFn=function(){for(var i=Array.isArray(e)?e.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var c=a[o],p=t._fullData[c]._module;if(p){if(p.animatable){var h=p.basePlotModule.name;s[h]||(s[h]=[]),s[h].push(c)}t.data[a[o]]=_.extendTrace(t.data[a[o]],e[o])}}var f=u.expandObjectPaths(u.extendDeepNoArrays({},r)),d=/^[xy]axis[0-9]*$/;for(var m in f)d.test(m)&&delete f[m].range;_.extendLayout(t.layout,f),delete t.calcdata,_.supplyDefaults(t),_.doCalcdata(t);var g=u.expandObjectPaths(r);if(g){var y=t._fullLayout._plots;for(var v in y){var x=y[v],b=x.xaxis,w=x.yaxis,T=b.range.slice(),k=w.range.slice(),A=null,M=null,S=null,C=null;Array.isArray(g[b._name+".range"])?A=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(A=g[b._name].range.slice()),Array.isArray(g[w._name+".range"])?M=g[w._name+".range"].slice():Array.isArray((g[w._name]||{}).range)&&(M=g[w._name].range.slice()),T&&A&&(b.r2l(T[0])!==b.r2l(A[0])||b.r2l(T[1])!==b.r2l(A[1]))&&(S={xr0:T,xr1:A}),k&&M&&(w.r2l(k[0])!==w.r2l(M[0])||w.r2l(k[1])!==w.r2l(M[1]))&&(C={yr0:k,yr1:M}),(S||C)&&l.push(u.extendFlat({plotinfo:x},S,C))}}return Promise.resolve()},o.runFn=function(e){var n,i,o=t._fullLayout._basePlotModules,c=l.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(t,l,a,e);for(var p in c?((n=u.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var h=s[p];t._fullData[h[0]]._module.basePlotModule.plot(t,h,n,e)}},I(t,a,o)},_.transitionFromReact=function(t,e,r,n){var i=t._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var t=i._plots;for(var a in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var l=t[a],c=l.xaxis,p=l.yaxis,h=n[c._name].range.slice(),f=n[p._name].range.slice(),d=c.range.slice(),m=p.range.slice();c.setScale(),p.setScale();var g=null,y=null;c.r2l(h[0])===c.r2l(d[0])&&c.r2l(h[1])===c.r2l(d[1])||(g={xr0:h,xr1:d}),p.r2l(f[0])===p.r2l(m[0])&&p.r2l(f[1])===p.r2l(m[1])||(y={yr0:f,yr1:m}),(g||y)&&s.push(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=t._fullData,c=t._fullLayout._basePlotModules,p=[],h=0;h<l.length;h++)p.push(h);function f(){for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function d(){for(var e=0;e<c.length;e++)c[e].plot(t,o,i,r)}s.length&&e.anim?"traces first"===a.ordering?(n=u.extendFlat({},a,{duration:0}),o=p,i=a,setTimeout(f,a.duration),d()):(n=a,o=null,i=u.extendFlat({},a,{duration:0}),setTimeout(d,n.duration),f()):s.length?(n=a,f()):e.anim&&(o=p,i=a,d())},I(t,a,o)},_.doCalcdata=function(t,e){var r,n,i,a,l=h.list(t),c=t._fullData,f=t._fullLayout,d=new Array(c.length),m=(t.calcdata||[]).slice();for(t.calcdata=d,f._numBoxes=0,f._numViolins=0,f._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._sunburstcolormap={},f._treemapcolormap={},f._funnelareacolormap={},i=0;i<c.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(d[i]=m[i]);for(i=0;i<c.length;i++)(r=c[i])._arrayAttrs=s.findArrayAttributes(r),r._extremes={};var g=f._subplots.polar||[];for(i=0;i<g.length;i++)l.push(f[g[i]].radialaxis,f[g[i]].angularaxis);for(var y in f._colorAxes){var v=f[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var _=!1;function b(e){if(r=c[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(t,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(a=0;a<r.transforms.length;a++){var o=r.transforms[a];(n=x[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,_=!0,n.calcTransform(t,r,o))}}}function w(e,i){if(r=c[e],!!(n=r._module).isContainer===i){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(a=s.length-1;a>=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(P(l,c,f),i=0;i<c.length;i++)w(i,!0);for(i=0;i<c.length;i++)b(i);for(_&&P(l,c,f),i=0;i<c.length;i++)w(i,!0);for(i=0;i<c.length;i++)w(i,!1);D(t);var T=function(t,e){var r,n,i,a,s,l=[];function c(t,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===t){var a=r._counterAxes[0],o=h.getFromId(e,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(t,e){return 0===t||0===e||s&&t===n[e].length-1||l&&e===n.length-1?-1:("y"===i?e:t)-1}}return function(t,e){return"y"===i?e:t}}var p={min:function(t){return u.aggNums(Math.min,null,t)},max:function(t){return u.aggNums(Math.max,null,t)},sum:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return u.mean(t)},median:function(t){return u.median(t)}};for(r=0;r<t.length;r++){var f=t[r];if("category"===f.type){var d=f.categoryorder.match(z);if(d){var m=d[1],g=d[2],y=f._id.charAt(0),v="x"===y,_=[];for(n=0;n<f._categories.length;n++)_.push([f._categories[n],[]]);for(n=0;n<f._traceIndices.length;n++){var x=f._traceIndices[n],b=e._fullData[x];if(!0===b.visible){var w=b.type;o.traceIs(b,"histogram")&&(delete b._xautoBinFinished,delete b._yautoBinFinished);var T="splom"===w,k="scattergl"===w,A=e.calcdata[x];for(i=0;i<A.length;i++){var M,S,C=A[i];if(T){var L=b._axesDim[f._id];if(!v){var E=b._diag[L][0];E&&(f=e._fullLayout[h.id2name(E)])}var I=C.trace.dimensions[L].values;for(a=0;a<I.length;a++)for(M=f._categoriesMap[I[a]],s=0;s<C.trace.dimensions.length;s++)if(s!==L){var P=C.trace.dimensions[s];_[M][1].push(P.values[a])}}else if(k){for(a=0;a<C.t.x.length;a++)v?(M=C.t.x[a],S=C.t.y[a]):(M=C.t.y[a],S=C.t.x[a]),_[M][1].push(S);C.t&&C.t._scene&&delete C.t._scene.dirty}else if(C.hasOwnProperty("z")){S=C.z;var D=c(b.type,f,S);for(a=0;a<S.length;a++)for(s=0;s<S[a].length;s++)(M=D(s,a))+1&&_[M][1].push(S[a][s])}else for(void 0===(M=C.p)&&(M=C[y]),void 0===(S=C.s)&&(S=C.v),void 0===S&&(S=v?C.y:C.x),Array.isArray(S)||(S=void 0===S?[]:[S]),a=0;a<S.length;a++)_[M][1].push(S[a])}}}f._categoriesValue=_;var O=[];for(n=0;n<_.length;n++)O.push([_[n][0],p[m](_[n][1])]);O.sort((function(t,e){return t[1]-e[1]})),f._categoriesAggregatedValue=O,f._initialCategories=O.map((function(t){return t[0]})),"descending"===g&&f._initialCategories.reverse(),l=l.concat(f.sortByInitialCategories())}}}return l}(l,t);if(T.length){for(f._numBoxes=0,f._numViolins=0,i=0;i<T.length;i++)w(T[i],!0);for(i=0;i<T.length;i++)w(T[i],!1);D(t)}o.getComponentMethod("fx","calc")(t),o.getComponentMethod("errorbars","calc")(t)};var z=/(total|sum|min|max|mean|median) (ascending|descending)/;function P(t,e,r){var n={};function i(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}u.simpleMap(t,i);for(var a=r._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])n[s]||i(r[h.id2name(s)])}function D(t){var e,r,n,i=t._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var p=o[n],h=i._subplots[n];if(Array.isArray(h))for(e=0;e<h.length;e++){var f=h[e],d="cartesian"===n?i._plots[f]:i[f];for(r=0;r<p.length;r++)p[r](t,d,f)}else for(r=0;r<p.length;r++)p[r](t)}}_.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},_.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},_.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in a)if(!o[c]){var p=a[c][0];p[0].trace.visible=!1,o[c]=[p]}for(var h in o){var f=o[h];f[0][0].trace._module.plot(t,e,u.filterVisible(f),n)}e.traceHash=o},_.plotBasePlot=function(t,e,r,n,i){var a=o.getModule(t),s=g(e.calcdata,a)[0];a.plot(e,s,n,i)},_.cleanBasePlot=function(t,e,r,n,i){var a=i._has&&i._has(t),o=r._has&&r._has(t);a&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()}},{"../components/color":83,"../constants/numerical":189,"../lib":212,"../plot_api/plot_schema":246,"../plot_api/plot_template":247,"../plots/get_data":288,"../registry":308,"./animation_attributes":252,"./attributes":254,"./cartesian/axis_ids":261,"./cartesian/handle_outline":268,"./command":284,"./font_attributes":286,"./frame_attributes":287,"./layout_attributes":290,d3:16,"d3-time-format":14,"fast-isnumeric":18}],300:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),i=n.marker,a=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");e.exports={r:a({},n.r,{}),t:a({},n.t,{}),marker:{color:a({},i.color,{}),size:a({},i.size,{}),symbol:a({},i.symbol,{}),opacity:a({},i.opacity,{}),editType:"calc"}}},{"../../../lib/extend":204,"../../../traces/scatter/attributes":339}],301:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat,a=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),s=i({},n.domain,{});function l(t,e){return i({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number",description:o},visible:{valType:"boolean"}})}e.exports=a({radialaxis:l(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:s,orientation:{valType:"number"}}),angularaxis:l(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:s}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":204,"../../../plot_api/edit_types":240,"../../cartesian/layout_attributes":272}],302:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":303,"./micropolar_manager":304}],303:[function(t,e,r){var n=t("d3"),i=t("../../../lib").extendDeepAll,a=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,s,l={data:[],layout:{}},u={},c={},p=n.dispatch("hover"),h={};return h.render=function(u){return function(u){e=u||e;var p=l.data,h=l.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(p).each((function(e,l){var u=e.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var p=0;u.forEach((function(t,e){t.color||(t.color=h.defaultColorRange[p],p=(p+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize}));var f=u.filter((function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r})),d=!1,m=f.map((function(t,e){return d=d||"undefined"!=typeof t.groupId,t}));if(d){var g=n.nest().key((function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"})).entries(m),y=[],v=g.map((function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map((function(t,e){return 0}));return t.values.forEach((function(t,e,n){t.yStack=[r],y.push(r),r=o.util.sumArrays(t.r,r)})),t.values}));f=n.merge(v)}f.forEach((function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]}));var _=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;_=Math.max(10,_);var x,b=[h.margin.left+_,h.margin.top+_];d?x=[0,n.max(o.util.sumArrays(o.util.arrayLast(f).r[0],o.util.arrayLast(y)))]:x=n.extent(o.util.flattenArray(f.map((function(t,e){return t.r}))));h.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),r=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,_]),c.layout.radialAxis.domain=r.domain();var w,T=o.util.flattenArray(f.map((function(t,e){return t.t}))),k="string"==typeof T[0];k&&(T=o.util.deduplicate(T),w=T.slice(),T=n.range(T.length),f=f.map((function(t,e){var r=t;return t.t=[T],d&&(r.yStack=t.yStack),r})));var A=f.filter((function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry})).length===f.length,M=null===h.needsEndSpacing?k||!A:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0?h.angularAxis.domain:n.extent(T),C=Math.abs(T[1]-T[0]);A&&!k&&(C=0);var L=S.slice();M&&k&&(L[1]+=C);var E=h.angularAxis.ticksCount||4;E>8&&(E=E/(E/8)+E%8),h.angularAxis.ticksStep&&(E=(L[1]-L[0])/E);var I=h.angularAxis.ticksStep||(L[1]-L[0])/(E*(h.minorTicks+1));w&&(I=Math.max(Math.round(I),1)),L[2]||(L[2]=I);var z=n.range.apply(this,L);if(z=z.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?C:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),D=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+h.font.outlineColor})).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[_,h.margin.top]+")"}).style({display:"block"});var N=f.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:f.map((function(t,e){return t.name||"Element"+e})),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:h.legend.reverseOrder})})();var U=O.node().getBBox();_=Math.min(h.width-U.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,_=Math.max(10,_),b=[h.margin.left+_,h.margin.top+_],r.range([0,_]),c.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[b[0]+_,b[1]-_]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+b+")").style({cursor:"crosshair"});var j=[(h.width-(h.margin.left+h.margin.right+2*_+(U?U.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*_))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),t.select(".outer-group").attr("transform","translate("+j+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(B).text(h.title.text),q=V.node().getBBox();V.attr({x:b[0]-q.width/2,y:b[1]-_-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var Z=H.selectAll("circle.grid-circle").data(r.ticks(5));Z.enter().append("circle").attr({class:"grid-circle"}).style(F),Z.attr("r",r),Z.exit().remove()}H.select("circle.outside-circle").attr({r:_}).style(F);var G=t.select("circle.background-circle").attr({r:_}).style({fill:h.backgroundColor,stroke:h.stroke});function X(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(F),H.selectAll("g>text").text((function(t,e){return this.textContent+h.radialAxis.ticksSuffix})).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var Y=t.select(".angular.axis-group").selectAll("g.angular-tick").data(z),K=Y.enter().append("g").classed("angular-tick",!0);Y.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Y.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(h.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(h.minorTicks+1)==0)})).style(F),K.selectAll(".minor").style({stroke:h.minorTickColor}),Y.select("line.grid-line").attr({x1:h.tickLength?_-h.tickLength:0,x2:_}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var J=Y.select("text.axis-text").attr({x:_+h.labelOffset,dy:a+"em",transform:function(t,e){var r=X(t),n=_+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix})).style(B);h.angularAxis.rewriteTicks&&J.text((function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)}));var Q=n.max(R.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));O.attr({transform:"translate("+[_+Q,h.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(f);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),f[0]||$){var et=[];f.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return i(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!k){var pt=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(G).angle;pt.attr({x2:-_,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(_+12,r+180);lt.text(o.util.round(it)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(G).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(G).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+b[0],i[1]+b[1]])})).on("mouseout.radial-guide",(function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,p=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),f=[p.left+p.width/2-j[0]-h.left,p.top+p.height/2-j[1]-h.top];ct.config({color:s}).text(c),ct.move(f)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)})),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,p,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach((function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)}));var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i<a;i++)(e=t[i])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce((function(t,e){if("undefined"!=typeof t)return t[e]}),t);"undefined"!=typeof a&&(e.reduce((function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]}),t),r.reduce((function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]}),t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function a(){var e=t[0].geometryConfig,i=e.container;"string"==typeof i&&(i=n.select(i)),i.datum(t).each((function(t,i){var a=!!t[0].data.yStack,o=t.map((function(t,e){return a?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])})),s=e.angularScale,l=e.radialScale.domain()[0],u={bar:function(r,i,a){var o=t[a].data,l=e.radialScale(r[1])-e.radialScale(0),u=e.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+u,-c/2],[l+u,c/2],[u,c/2],[u,-c/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+s(t[0]))+")"}})}};u.dot=function(r,i,a){var o=r[2]?[r[0],r[1]+r[2]]:r,s=n.svg.symbol().size(t[a].data.dotSize).type(t[a].data.dotType)(r,i);n.select(this).attr({class:"mark dot",d:s,transform:function(t,r){var n,i,a,s=(n=function(t,r){var n=e.radialScale(t[1]),i=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:i}}(o),i=n.r*Math.cos(n.t),a=n.r*Math.sin(n.t),{x:i,y:a});return"translate("+[s.x,s.y]+")"}})};var c=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius((function(t){return e.radialScale(t[1])})).angle((function(t){return e.angularScale(t[0])*Math.PI/180}));u.line=function(r,i,a){var s=r[2]?o[a].map((function(t,e){return[t[0],t[1]+t[2]]})):o[a];if(n.select(this).each(u.dot).style({opacity:function(e,r){return+t[a].data.dotVisible},fill:d.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var p=e.angularScale.range(),h=Math.abs(p[1]-p[0])/o[0].length*Math.PI/180,f=n.svg.arc().startAngle((function(t){return-h/2})).endAngle((function(t){return h/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:f,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data((function(t,e){return t}));g.enter().append("path").attr({class:"mark"}),g.style(d).each(u[e.geometryType]),g.exit().remove(),m.exit().remove()}))}return a.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)})),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a}))})),o=n.merge(a);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,p=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),f=h.enter().append("svg").attr({width:300,height:p+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});f.append("g").classed("legend-axis",!0),f.append("g").classed("legend-marks",!0);var d=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(d).range(l),g=n.scale[c?"linear":"ordinal"]().domain(d)[c?"range":"rangePoints"]([0,p]);if(c){var y=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);y.enter().append("stop"),y.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var v=h.select(".legend-marks").selectAll("path.legend-mark").data(o);v.enter().append("path").classed("legend-mark",!0),v.attr({transform:function(t,e){return"translate("+[u/2,g(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return m(e)}}),v.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(_);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",p=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(p);var h=a.padding,f=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},m=f.width+2*h+l,g=f.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n})),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":185,"../../../lib":212,d3:16}],304:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,p=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,p.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){p.undo()},h.redo=function(){p.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":83,"../../../lib":212,"./micropolar":303,"./undo_manager":305,d3:16}],305:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],306:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_template"),a=t("./domain").defaults;e.exports=function(t,e,r,o){var s,l,u=o.type,c=o.attributes,p=o.handleDefaults,h=o.partition||"x",f=e._subplots[u],d=f.length,m=d&&f[0].replace(/\d+$/,"");function g(t,e){return n.coerce(s,l,c,t,e)}for(var y=0;y<d;y++){var v=f[y];s=t[v]?t[v]:t[v]={},l=i.newContainer(e,v,m),g("uirevision",e.uirevision);var _={};_[h]=[y/d,(y+1)/d],a(l,e,g,_),o.id=v,p(s,l,g,o)}}},{"../lib":212,"../plot_api/plot_template":247,"./domain":285}],307:[function(t,e,r){"use strict";['Variables are inserted using %{variable}, for example "y: %{y}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',t("../constants/docs").FORMAT_LINK,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',t("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],i=0;i<r.length;i++)n[i]="`"+r[i]+"`";e+="Finally, the template string has access to ",e=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}r.hovertemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":187}],308:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),u=t("./plots/attributes"),c=t("./plots/layout_attributes"),p=l.extendFlat,h=l.extendDeepAll;function f(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in y(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},l=0;l<i.length;l++)o[i[l]]=!0,r.allCategories[i[l]]=!0;for(var u in r.modules[e]={_module:t,categories:o},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e),r.componentsRegistry)v(u,e);t.layoutAttributes&&p(r.traceLayoutAttributes,t.layoutAttributes);var c=t.basePlotModule,h=c.name;if("mapbox"===h){var f=c.constants.styleRules;for(var d in f)s(".js-plotly-plot .plotly .mapboxgl-"+d,f[d])}"geo"!==h&&"mapbox"!==h||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function d(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&a(r.layoutArrayContainers,e),y(t)),r.modules)v(e,n);for(var i in r.subplotsRegistry)x(e,i);for(var o in r.transformsRegistry)_(e,o);t.schema&&t.schema.layout&&h(c,t.schema.layout)}function m(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,i="function"==typeof t.transform,a="function"==typeof t.calcTransform;if(!i&&!a)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var s in i&&a&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)_(s,t.name)}function g(t){var e=t.name,n=e.split("-")[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=r.localeRegistry,u=l[e];if(u||(l[e]=u={}),n!==e){var c=l[n];c||(l[n]=c={}),o&&c.dictionary===u.dictionary&&(c.dictionary=i),s&&c.format===u.format&&(c.format=a)}o&&(u.dictionary=i),s&&(u.format=a)}function y(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)a(r.layoutArrayRegexes,e[n])}}function v(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var i=n.traces[e];i&&h(r.modules[e]._module.attributes,i)}}function _(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var i=n.transforms[e];i&&h(r.transformsRegistry[e].attributes,i)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var i=r.subplotsRegistry[e],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&h(a,s)}}function b(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":f(n);break;case"transform":m(n);break;case"component":d(n);break;case"locale":g(n);break;case"apiMethod":var i=n.name;r.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[b(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=b(t)))return!1;var i=r.modules[t];return i||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),i=r.modules[u.type.dflt]),!!i.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],i=0;i<n.length;i++)n[i].type===e&&r.push(i);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||i},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/dom":202,"./lib/extend":204,"./lib/is_plain_object":213,"./lib/loggers":216,"./lib/noop":221,"./lib/push_unique":226,"./plots/attributes":254,"./plots/layout_attributes":290}],309:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=i.extendFlat,o=i.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var i,l=t.data,u=t.layout,c=o([],l),p=o({},u,s(e.tileClass)),h=t._context||{};if(e.width&&(p.width=e.width),e.height&&(p.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){p.annotations=[];var f=Object.keys(p);for(r=0;r<f.length;r++)i=f[r],["xaxis","yaxis","zaxis"].indexOf(i.slice(0,5))>-1&&(p[f[r]].title={text:""});for(r=0;r<c.length;r++){var d=c[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),n.traceIs(d,"pie-like")&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)p.annotations.push(e.annotations[r]);var m=Object.keys(p).filter((function(t){return t.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===e.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var y=p[m[r]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),a(y.xaxis,g),a(y.yaxis,g),a(y.zaxis,g),y._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var _={gd:v,td:v,layout:p,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:h.mapboxAccessToken}};return"transparent"!==e.setBackground&&(_.config.setBackground=e.setBackground||"opaque"),_.gd.defaultLayout=s(e.tileClass),_}},{"../lib":212,"../registry":308}],310:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/to_image"),a=t("./filesaver"),o=t("./helpers");e.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise((function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var u=i(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format.replace("-","."),u.then((function(t){return r&&(r._snapshotInProgress=!1),a(t,c,e.format)})).then((function(t){s(t)})).catch((function(t){r&&(r._snapshotInProgress=!1),l(t)}))}))}},{"../lib":212,"../plot_api/to_image":250,"./filesaver":311,"./helpers":312}],311:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./helpers");e.exports=function(t,e,r){var a=document.createElement("a"),o="download"in a;return new Promise((function(s,l){var u,c;if(n.isIE9orBelow()&&l(new Error("IE < 10 unsupported")),n.isSafari()){var p="svg"===r?",":";base64,";return i.octetStream(p+encodeURIComponent(t)),s(e)}return n.isIE()?(u=i.createBlob(t,"svg"),window.navigator.msSaveBlob(u,e),u=null,s(e)):o?(u=i.createBlob(t,r),c=i.createObjectURL(u),a.href=c,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),i.revokeObjectURL(c),u=null,s(e)):void l(new Error("download error"))}))}},{"../lib":212,"./helpers":312}],312:[function(t,e,r){"use strict";var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},r.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var i=window.URL||window.webkitURL;r.createObjectURL=function(t){return i.createObjectURL(t)},r.revokeObjectURL=function(t){return i.revokeObjectURL(t)},r.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),i=0;i<e;i++)n[i]=t.charCodeAt(i);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},r.octetStream=function(t){document.location.href="data:application/octet-stream"+t},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":308}],313:[function(t,e,r){"use strict";var n=t("./helpers"),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=i},{"./cloneplot":309,"./download":310,"./helpers":312,"./svgtoimg":314,"./toimage":315,"./tosvg":316}],314:[function(t,e,r){"use strict";var n=t("../lib"),i=t("events").EventEmitter,a=t("./helpers");e.exports=function(t){var e=t.emitter||new i,r=new Promise((function(i,o){var s=window.Image,l=t.svg,u=t.format||"png";if(n.isIE()&&"svg"!==u){var c=new Error(a.MSG_IE_BAD_FORMAT);return o(c),t.promise?r:e.emit("error",c)}var p,h,f=t.canvas,d=t.scale||1,m=t.width||300,g=t.height||150,y=d*m,v=d*g,_=f.getContext("2d"),x=new s;"svg"===u||n.isIE9orBelow()||n.isSafari()?h=a.encodeSVG(l):(p=a.createBlob(l,"svg"),h=a.createObjectURL(p)),f.width=y,f.height=v,x.onload=function(){var r;switch(p=null,a.revokeObjectURL(h),"svg"!==u&&_.drawImage(x,0,0,y,v),u){case"jpeg":r=f.toDataURL("image/jpeg");break;case"png":r=f.toDataURL("image/png");break;case"webp":r=f.toDataURL("image/webp");break;case"svg":r=h;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}i(r),t.promise||e.emit("success",r)},x.onerror=function(r){if(p=null,a.revokeObjectURL(h),o(r),!t.promise)return e.emit("error",r)},x.src=h}));return t.promise?r:e}},{"../lib":212,"./helpers":312,events:12}],315:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i=t("../registry"),a=t("../lib"),o=t("./helpers"),s=t("./cloneplot"),l=t("./tosvg"),u=t("./svgtoimg");e.exports=function(t,e){var r=new n,c=s(t,{format:"png"}),p=c.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var h=o.getRedrawFunc(p);return i.call("plot",p,c.data,c.layout,c.config).then(h).then((function(){var t=o.getDelay(p._fullLayout);setTimeout((function(){var t=l(p),n=document.createElement("canvas");n.id=a.randstr(),(r=u({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){p&&document.body.removeChild(p)}}),t)})).catch((function(t){r.emit("error",t)})),r}},{"../lib":212,"../registry":308,"./cloneplot":309,"./helpers":312,"./svgtoimg":314,"./tosvg":316,events:12}],316:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces"),l=/"/g,u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var c,p=t._fullLayout,h=p._paper,f=p._toppaper,d=p.width,m=p.height;h.insert("rect",":first-child").call(a.setRect,0,0,d,m).call(o.fill,p.paper_bgcolor);var g=p._basePlotModules||[];for(c=0;c<g.length;c++){var y=g[c];y.toSVG&&y.toSVG(t)}if(f){var v=f.node().childNodes,_=Array.prototype.slice.call(v);for(c=0;c<_.length;c++){var x=_[c];x.childNodes.length&&h.node().appendChild(x)}}if(p._draggers&&p._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(l,"TOBESTRIPPED"))}else t.remove()})),p._gradientUrlQueryParts){var b=[];for(var w in p._gradientUrlQueryParts)b.push(w);b.length&&h.selectAll(b.join(",")).each((function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))}))}"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*d),h.attr("height",r*m),h.attr("viewBox","0 0 "+d+" "+m));var T=(new window.XMLSerializer).serializeToString(h.node());return T=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,(function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(u,"'"),i.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":83,"../components/drawing":105,"../constants/xmlns_namespaces":190,"../lib":212,d3:16}],317:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":82,"../../components/colorscale/attributes":90,"../../lib/extend":204,"../../plots/attributes":254,"../../plots/template_attributes":307,"../scattergeo/attributes":367}],318:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p<u;p++){var h=c[p]={},f=e.locations[p],d=e.z[p];r(f)&&n(d)?(h.loc=f,h.z=d):(h.loc=null,h.z=i),h.index=p}return o(c,e),a(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),s(c,e),c}},{"../../components/colorscale/calc":91,"../../constants/numerical":189,"../scatter/arrays_to_calcdata":338,"../scatter/calc_selection":341,"fast-isnumeric":18}],319:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}},{}],320:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../../lib").fillText;e.exports=function(t,e,r){var o,s,l,u,c=t.cd,p=c[0].trace,h=t.subplot,f=[e,r],d=[e+360,r];for(s=0;s<c.length;s++)if(u=!1,(o=c[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(f)&&(u=!u),o._polygons[l].contains(d)&&(u=!u);if(u)break}if(u&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,t.zLabel=n.tickText(h.mockAxis,h.mockAxis.c2l(o.z),"hover").text,t.hovertemplate=o.hovertemplate,function(t,e,r){if(e.hovertemplate)return;var n=r.hi||e.hoverinfo,o=String(r.loc),s="all"===n?i.hoverinfo.flags:n.split("+"),l=-1!==s.indexOf("name"),u=-1!==s.indexOf("location"),c=-1!==s.indexOf("z"),p=-1!==s.indexOf("text"),h=[];!l&&u?t.nameOverride=o:(l&&(t.nameOverride=e.name),u&&h.push(o));c&&h.push(t.zLabel);p&&a(r,e,h);t.extraText=h.join("<br>")}(t,p,o),[t]}},{"../../lib":212,"../../plots/cartesian/axes":258,"./attributes":317}],321:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=u.c2p(i),e.contains([a,o],null,r,t)?(c.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return c}},{}],322:[function(t,e,r){"use strict";var n=t("../choropleth/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:s({},n.featureidkey,{}),below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,marker:{line:{color:s({},n.marker.line.color,{editType:"plot"}),width:s({},n.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:s({},n.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:s({},n.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:s({},n.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:n.hoverinfo,hovertemplate:a({},{keys:["properties"]}),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":90,"../../lib/extend":204,"../../plots/attributes":254,"../../plots/template_attributes":307,"../choropleth/attributes":317}],323:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/colorscale"),o=t("../../components/drawing"),s=t("../../lib/geojson_utils").makeBlank,l=t("../../lib/geo_location_utils");function u(t){var e,r=t[0].trace,n=r._opts;if(r.selectedpoints){for(var a=o.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=a.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=i.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return i.extendFlat(n.fill.paint,{"fill-opacity":e}),i.extendFlat(n.line.paint,{"line-opacity":e}),n}e.exports={convert:function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,o={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},p=e._opts={fill:o,line:c,geojson:s()};if(!r)return p;var h=l.extractTraceFeature(t);if(!h)return p;var f,d,m,g=a.makeColorScaleFuncFromTrace(e),y=e.marker,v=y.line||{};i.isArrayOrTypedArray(y.opacity)&&(f=function(t){var e=t.mo;return n(e)?+i.constrain(e,0,1):0}),i.isArrayOrTypedArray(v.color)&&(d=function(t){return t.mlc}),i.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var _=0;_<t.length;_++){var x=t[_],b=x.fOut;if(b){var w=b.properties;w.fc=g(x.z),f&&(w.mo=f(x)),d&&(w.mlc=d(x)),m&&(w.mlw=m(x)),x.ct=w.ct,x._polygons=l.feature2polygons(b)}}var T=f?{type:"identity",property:"mo"}:y.opacity;return i.extendFlat(o.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":T}),i.extendFlat(c.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":T}),o.layout.visibility="visible",c.layout.visibility="visible",p.geojson={type:"FeatureCollection",features:h},u(t),p},convertOnSelect:u}},{"../../components/colorscale":95,"../../components/drawing":105,"../../lib":212,"../../lib/geo_location_utils":207,"../../lib/geojson_utils":208,"fast-isnumeric":18}],324:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("locations"),u=s("z"),c=s("geojson");n.isArrayOrTypedArray(l)&&l.length&&n.isArrayOrTypedArray(u)&&u.length&&("string"==typeof c&&""!==c||n.isPlainObject(c))?(s("featureidkey"),e._length=Math.min(l.length,u.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}},{"../../components/colorscale/defaults":93,"../../lib":212,"./attributes":322}],325:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("../choropleth/calc"),plot:t("./plot"),hoverPoints:t("../choropleth/hover"),eventData:t("../choropleth/event_data"),selectPoints:t("../choropleth/select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}},{"../../plots/mapbox":293,"../choropleth/calc":318,"../choropleth/event_data":319,"../choropleth/hover":320,"../choropleth/select":321,"../heatmap/colorbar":335,"./attributes":322,"./defaults":324,"./plot":326}],326:[function(t,e,r){"use strict";var n=t("./convert").convert,i=t("./convert").convertOnSelect,a=t("../../plots/mapbox/constants").traceLayerPrefix;function o(t,e){this.type="choroplethmapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",a+e+"-fill"],["line",a+e+"-line"]],this.below=null}var s=o.prototype;s.update=function(t){this._update(n(t))},s.updateOnSelect=function(t){this._update(i(t))},s._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},s._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},s._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":291,"./convert":323}],327:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":90,"../../lib/extend":204,"../../plots/attributes":254,"../../plots/template_attributes":307,"../scattermapbox/attributes":369}],328:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=i(u)&&u.length,p=0;p<r;p++){var h=l[p]={},f=e.lon[p],d=e.lat[p];if(h.lonlat=n(f)&&n(d)?[+f,+d]:[a,a],c){var m=u[p];h.z=n(m)?m:a}}return o(t,e,{vals:c?u:[0,1],containerStr:"",cLetter:"z"}),r&&(l[0].t={labels:{lat:s(t,"lat:")+" ",lon:s(t,"lon:")+" "}}),l}},{"../../components/colorscale/calc":91,"../../constants/numerical":189,"../../lib":212,"fast-isnumeric":18}],329:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/color"),o=t("../../components/colorscale"),s=t("../../constants/numerical").BADNUM,l=t("../../lib/geojson_utils").makeBlank;e.exports=function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:l()};if(!r)return u;var c,p=[],h=e.z,f=e.radius,d=i.isArrayOrTypedArray(h)&&h.length,m=i.isArrayOrTypedArray(f);for(c=0;c<t.length;c++){var g=t[c],y=g.lonlat;if(y[0]!==s){var v={};if(d){var _=g.z;v.z=_!==s?_:0}m&&(v.r=n(f[c])&&f[c]>0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c<b.length;c++)T.push(b[c][0],b[c][1]);var k=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":d?k:1/(x.max-x.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:p},u.heatmap.layout.visibility="visible",u}},{"../../components/color":83,"../../components/colorscale":95,"../../constants/numerical":189,"../../lib":212,"../../lib/geojson_utils":208,"fast-isnumeric":18}],330:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(e._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":93,"../../lib":212,"./attributes":327}],331:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],332:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../scattermapbox/hover");e.exports=function(t,e,r){var o=a(t,e,r);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var p=s.subplot.mockAxis;s.z=c.z,s.zLabel=i.tickText(p,p.c2l(c.z),"hover").text}return s.extraText=function(t,e,r){if(t.hovertemplate)return;var i=(e.hi||t.hoverinfo).split("+"),a=-1!==i.indexOf("all"),o=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}a||o&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(a||-1!==i.indexOf("text"))&&n.fillText(e,t,u);return u.join("<br>")}(u,c,l[0].t.labels),[s]}}},{"../../lib":212,"../../plots/cartesian/axes":258,"../scattermapbox/hover":374}],333:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}},{"../../plots/mapbox":293,"../heatmap/colorbar":335,"../scattermapbox/format_labels":373,"./attributes":327,"./calc":328,"./defaults":330,"./event_data":331,"./hover":332,"./plot":334}],334:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix;function a(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",i+e+"-heatmap"]],this.below=null}var o=a.prototype;o.update=function(t){var e=this.subplot,r=this.layerList,i=n(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<r.length;o++){var s=r[o],l=s[0],u=s[1],c=i[l];e.setOptions(u,"setLayoutProperty",c.layout),"visible"===c.layout.visibility&&e.setOptions(u,"setPaintProperty",c.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":291,"./convert":329}],335:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],336:[function(t,e,r){"use strict";var n=t("../../lib");function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n||""===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0},r.getRotationAngle=function(t){return("auto"===t?0:t)*Math.PI/180}},{"../../lib":212}],337:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":83,"./helpers":336}],338:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.texttemplate,t,"txt"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var i=e.marker;if(i){n.mergeArrayCastPositive(i.size,t,"ms"),n.mergeArrayCastPositive(i.opacity,t,"mo"),n.mergeArray(i.symbol,t,"mx"),n.mergeArray(i.color,t,"mc");var a=i.line;i.line&&(n.mergeArray(a.color,t,"mlc"),n.mergeArrayCastPositive(a.width,t,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":212}],339:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").texttemplateAttrs,i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),u=t("./constants"),c=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:c({},s,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:c({symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:c({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorscale/attributes":90,"../../components/drawing":105,"../../components/drawing/attributes":104,"../../lib/extend":204,"../../plots/font_attributes":286,"../../plots/template_attributes":307,"./constants":343}],340:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../../constants/numerical").BADNUM,l=t("./subtypes"),u=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),p=t("./calc_selection");function h(t,e,r,n,i,o,s){var u=e._length,c=t._fullLayout,p=r._id,h=n._id,f=c._firstScatter[m(e)]===e.uid,d=(g(e,c,r,n)||{}).orientation,y=e.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},_={padded:!0};s&&(v.ppad=_.ppad=s);var x=u<2||i[0]!==i[u-1]||o[0]!==o[u-1];x&&("tozerox"===y||"tonextx"===y&&(f||"h"===d))?v.tozero=!0:(e.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(l.hasMarkers(e)||l.hasText(e))||(v.padded=!1,v.ppad=0),x&&("tozeroy"===y||"tonexty"===y&&(f||"v"===d))?_.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(_.padded=!1),p&&(e._extremes[p]=a.findExtremes(r,i,v)),h&&(e._extremes[h]=a.findExtremes(n,o,_))}function f(t,e){if(l.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},i.isArrayOrTypedArray(n.size)){var s={type:"linear"};a.setConvert(s);for(var u=s.makeCalcdata(t.marker,"size"),c=new Array(e),p=0;p<e;p++)c[p]=r(u[p]);return c}return r(n.size)}}function d(t,e){var r=m(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function m(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function g(t,e,r,n){var i=t.stackgroup;if(i){var a=e._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;return"linear"===o.type||"log"===o.type?a:void 0}}e.exports={calc:function(t,e){var r,l,m,y,v,_,x=t._fullLayout,b=a.getFromId(t,e.xaxis||"x"),w=a.getFromId(t,e.yaxis||"y"),T=b.makeCalcdata(e,"x"),k=w.makeCalcdata(e,"y"),A=o(e,b,"x",T),M=o(e,w,"y",k),S=e._length,C=new Array(S),L=e.ids,E=g(e,x,b,w),I=!1;d(x,e);var z,P="x",D="y";E?(i.pushUnique(E.traceIndices,e._expandedIndex),(r="v"===E.orientation)?(D="s",z="x"):(P="s",z="y"),v="interpolate"===E.stackgaps):h(t,e,b,w,A,M,f(e,S));var O=!!e.xperiodalignment,R=!!e.yperiodalignment;for(l=0;l<S;l++){var F=C[l]={},B=n(A[l]),N=n(M[l]);B&&N?(F[P]=A[l],F[D]=M[l],O&&(F.orig_x=T[l]),R&&(F.orig_y=k[l])):E&&(r?B:N)?(F[z]=r?A[l]:M[l],F.gap=!0,v?(F.s=s,I=!0):F.s=0):F[P]=F[D]=s,L&&(F.id=String(L[l]))}if(c(C,e),u(t,e),p(C,e),E){for(l=0;l<C.length;)C[l][z]===s?C.splice(l,1):l++;if(i.sort(C,(function(t,e){return t[z]-e[z]||t.i-e.i})),I){for(l=0;l<C.length-1&&C[l].gap;)l++;for((_=C[l].s)||(_=C[l].s=0),m=0;m<l;m++)C[m].s=_;for(y=C.length-1;y>l&&C[y].gap;)y--;for(_=C[y].s,m=C.length-1;m>y;m--)C[m].s=_;for(;l<y;)if(C[++l].gap){for(m=l+1;C[m].gap;)m++;for(var U=C[l-1][z],j=C[l-1].s,V=(C[m].s-j)/(C[m][z]-U);l<m;)C[l].s=j+(C[l][z]-U)*V,l++}}}return C},calcMarkerSize:f,calcAxisExpansion:h,setFirstScatter:d,getStackOpts:g}},{"../../constants/numerical":189,"../../lib":212,"../../plots/cartesian/align_period":255,"../../plots/cartesian/axes":258,"./arrays_to_calcdata":338,"./calc_selection":341,"./colorscale_calc":342,"./subtypes":364,"fast-isnumeric":18}],341:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":212}],342:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t,e){a.hasLines(e)&&n(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),a.hasMarkers(e)&&(n(e,"marker")&&i(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&i(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":91,"../../components/colorscale/helpers":94,"./subtypes":364}],343:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],344:[function(t,e,r){"use strict";var n=t("./calc");function i(t,e,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(t,e,r,n){var i=t[e-1],a=t[e+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,a=e.yaxis,o=r._id+a._id,s=t._fullLayout._scatterStackOpts[o];if(s){var l,u,c,p,h,f,d,m,g,y,v,_,x,b,w,T=t.calcdata;for(var k in s){var A=(y=s[k]).traceIndices;if(A.length){for(v="interpolate"===y.stackgaps,_=y.groupnorm,"v"===y.orientation?(x="x",b="y"):(x="y",b="x"),w=new Array(A.length),l=0;l<w.length;l++)w[l]=!1;f=T[A[0]];var M=new Array(f.length);for(l=0;l<f.length;l++)M[l]=f[l][x];for(l=1;l<A.length;l++){for(h=T[A[l]],u=c=0;u<h.length;u++){for(d=h[u][x];d>M[c]&&c<M.length;c++)i(h,u,M[c],l,w,v,x),u++;if(d!==M[c]){for(p=0;p<l;p++)i(T[A[p]],c,d,p,w,v,x);M.splice(c,0,d)}c++}for(;c<M.length;c++)i(h,u,M[c],l,w,v,x),u++}var S=M.length;for(u=0;u<f.length;u++){for(m=f[u][b]=f[u].s,l=1;l<A.length;l++)(h=T[A[l]])[0].trace._rawLength=h[0].trace._length,h[0].trace._length=S,m+=h[u].s,h[u][b]=m;if(_)for(g=("fraction"===_?m:m/100)||1,l=0;l<A.length;l++){var C=T[A[l]][u];C[b]/=g,C.sNorm=C.s/g}}for(l=0;l<A.length;l++){var L=(h=T[A[l]])[0].trace,E=n.calcMarkerSize(L,L._rawLength),I=Array.isArray(E);if(E&&w[l]||I){var z=E;for(E=new Array(S),u=0;u<S;u++)E[u]=h[u].gap?0:I?z[h[u].i]:z}var P=new Array(S),D=new Array(S);for(u=0;u<S;u++)P[u]=h[u].x,D[u]=h[u].y;n.calcAxisExpansion(t,L,r,a,P,D,E),h[0].t.orientation=y.orientation}}}}}},{"./calc":340}],345:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var i=e-1;i>=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],346:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),p=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function y(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,g,y);if(v||(e.visible=!1),e.visible){u(t,e,g,y);var _=c(t,e,g,y),x=!_&&v<o.PTS_LINESONLY?"lines+markers":"lines";y("text"),y("hovertext"),y("mode",x),s.hasLines(e)&&(h(t,e,r,g,y),f(t,e,y),y("connectgaps"),y("line.simplify")),s.hasMarkers(e)&&p(t,e,r,g,y,{gradient:!0}),s.hasText(e)&&(y("texttemplate"),d(t,e,g,y));var b=[];(s.hasMarkers(e)||s.hasText(e))&&(y("cliponaxis"),y("marker.maxdisplayed"),b.push("points")),y("fill",_?_.fillDflt:"none"),"none"!==e.fill&&(m(t,e,r,y),s.hasLines(e)||f(t,e,y));var w=(e.line||{}).color,T=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||b.push("fills"),y("hoveron",b.join("+")||"points"),"fills"!==e.hoveron&&y("hovertemplate");var k=i.getComponentMethod("errorbars","supplyDefaults");k(t,e,w||T||r,{axis:"y"}),k(t,e,w||T||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,y)}}},{"../../lib":212,"../../registry":308,"./attributes":339,"./constants":343,"./fillcolor_defaults":347,"./line_defaults":352,"./line_shape_defaults":354,"./marker_defaults":358,"./period_defaults":359,"./stack_defaults":362,"./subtypes":364,"./text_defaults":365,"./xy_defaults":366}],347:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a){var o=!1;if(e.marker){var s=e.marker.color,l=(e.marker.line||{}).color;s&&!i(s)?o=s:l&&!i(l)&&(o=l)}a("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":83,"../../lib":212}],348:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var i={},a={_fullLayout:r},o=n.getFromTrace(a,e,"x"),s=n.getFromTrace(a,e,"y");return i.xLabel=n.tickText(o,t.x,!0).text,i.yLabel=n.tickText(s,t.y,!0).text,i}},{"../../plots/cartesian/axes":258}],349:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./subtypes");e.exports=function(t,e){var r,a;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color)&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":83,"./subtypes":364}],350:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/fx"),a=t("../../registry"),o=t("./get_trace_color"),s=t("../../components/color"),l=n.fillText;e.exports=function(t,e,r,u){var c=t.cd,p=c[0].trace,h=t.xa,f=t.ya,d=h.c2p(e),m=f.c2p(r),g=[d,m],y=p.hoveron||"",v=-1!==p.mode.indexOf("markers")?3:.5;if(-1!==y.indexOf("points")){var _=function(t){var e=Math.max(v,t.mrc||0),r=h.c2p(t.x)-d,n=f.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},x=i.getDistanceFunction(u,(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(h.c2p(t.x)-d);return n<e?r*n/e:n-e+r}),(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(f.c2p(t.y)-m);return n<e?r*n/e:n-e+r}),_);if(i.getClosest(c,x,t),!1!==t.index){var b=c[t.index],w=h.c2p(b.x,!0),T=f.c2p(b.y,!0),k=b.mrc||1;t.index=b.i;var A=c[0].t.orientation,M=A&&(b.sNorm||b.s),S="h"===A?M:void 0!==b.orig_x?b.orig_x:b.x,C="v"===A?M:void 0!==b.orig_y?b.orig_y:b.y;return n.extendFlat(t,{color:o(p,b),x0:w-k,x1:w+k,xLabelVal:S,y0:T-k,y1:T+k,yLabelVal:C,spikeDistance:_(b),hovertemplate:p.hovertemplate}),l(b,p,t),a.getComponentMethod("errorbars","hoverInfo")(b,p,t),[t]}}if(-1!==y.indexOf("fills")&&p._polygons){var L,E,I,z,P,D,O,R,F,B=p._polygons,N=[],U=!1,j=1/0,V=-1/0,q=1/0,H=-1/0;for(L=0;L<B.length;L++)(I=B[L]).contains(g)&&(U=!U,N.push(I),q=Math.min(q,I.ymin),H=Math.max(H,I.ymax));if(U){var Z=((q=Math.max(q,0))+(H=Math.min(H,f._length)))/2;for(L=0;L<N.length;L++)for(z=N[L].pts,E=1;E<z.length;E++)(R=z[E-1][1])>Z!=(F=z[E][1])>=Z&&(D=z[E-1][0],O=z[E][0],F-R&&(P=D+(O-D)*(Z-R)/(F-R),j=Math.min(j,P),V=Math.max(V,P)));j=Math.max(j,0),V=Math.min(V,h._length);var G=s.defaultLine;return s.opacity(p.fillcolor)?G=p.fillcolor:s.opacity((p.line||{}).color)&&(G=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:j,x1:V,y0:Z,y1:Z,color:G,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":83,"../../components/fx":123,"../../lib":212,"../../registry":308,"./get_trace_color":349}],351:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":271,"./arrays_to_calcdata":338,"./attributes":339,"./calc":340,"./cross_trace_calc":344,"./cross_trace_defaults":345,"./defaults":346,"./format_labels":348,"./hover":350,"./marker_colorbar":357,"./plot":360,"./select":361,"./style":363,"./subtypes":364}],352:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":93,"../../components/colorscale/helpers":94,"../../lib":212}],353:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,a,h,f,d,m,g,y,v,_,x,b,w,T,k,A,M,S=e.xaxis,C=e.yaxis,L="log"===S.type,E="log"===C.type,I=S._length,z=C._length,P=e.connectGaps,D=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,U=t.length,j=new Array(U),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?C.l2p(n.y):C.c2p(n.y);if(a===i){if(L&&(a=S.c2p(n.x,!0)),a===i)return!1;E&&l===i&&(a*=Math.abs(S._m*z*(S._m>0?o:s)/(C._m*I*(C._m>0?o:s)))),a*=1e3}if(l===i){if(E&&(l=C.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function H(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&u<l){var c=o*a-s*i;if(c*c<l)return!0}}function Z(t,e){var r=t[0]/I,n=t[1]/z,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==A&&H(r,n,A,M)&&(i=0),i&&e&&H(r,n,e[0]/I,e[1]/z)&&(i=0),(1+p.toleranceGrowth*i)*D}function G(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var X,W,Y,K,J,Q,$,tt=p.maxScreensAway,et=-I*tt,rt=I*(1+tt),nt=-z*tt,it=z*(1+tt),at=[[et,nt,rt,nt],[rt,nt,rt,it],[rt,it,et,it],[et,it,et,nt]];function ot(t){if(t[0]<et||t[0]>rt||t[1]<nt||t[1]>it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===j[V-1][0],i=r===j[V-1][1];if(!n||!i)if(V>1){var a=e===j[V-2][0],o=r===j[V-2][1];n&&(e===et||e===rt)&&a?o?V--:j[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:j[V-1]=t:j[V++]=t}else j[V++]=t}function ct(t){j[V-1][0]!==t[0]&&j[V-1][1]!==t[1]&&ut([Y,K]),ut(t),J=null,Y=K=0}function pt(t){if(A=t[0]/I,M=t[1]/z,X=t[0]<et?et:t[0]>rt?rt:0,W=t[1]<nt?nt:t[1]>it?it:0,X||W){if(V)if(J){var e=$(J,t);e.length>1&&(ct(e[0]),j[V++]=e[1])}else Q=$(j[V-1],t)[0],j[V++]=Q;else j[V++]=[X||t[0],W||t[1]];var r=j[V-1];X&&W&&(r[0]!==X||r[1]!==W)?(J&&(Y!==X&&K!==W?ut(Y&&K?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Y||X,K||W]):Y&&K&&ut([Y,K])),ut([X,W])):Y-X&&K-W&&ut([X||Y,W||K]),J=t,Y=X,K=W}else J&&ct($(J,t)[0]),j[V++]=t;var n,i,a,o}for("linear"===O||"spline"===O?$=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&G(o,t)<G(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===O||"vh"===O?$=function(t,e){var r=[],n=ot(t),i=ot(e);return n&&i&&st(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===O?$=lt(0,et,rt):"vhv"===O&&($=lt(1,nt,it)),r=0;r<U;r++)if(n=q(r)){for(V=0,J=null,pt(n),r++;r<U;r++){if(!(h=q(r))){if(P)continue;break}if(R&&e.simplify){var ht=q(r+1);if(v=G(h,n),F&&(0===V||V===U-1)||!(v<Z(h,ht)*N)){for(g=[(h[0]-n[0])/v,(h[1]-n[1])/v],f=n,_=v,x=w=T=0,m=!1,a=h,r++;r<t.length;r++){if(d=ht,ht=q(r+1),!d){if(P)continue;break}if(k=(y=[d[0]-n[0],d[1]-n[1]])[0]*g[1]-y[1]*g[0],w=Math.min(w,k),(T=Math.max(T,k))-w>Z(d,ht))break;a=d,(b=y[0]*g[0]+y[1]*g[1])>_?(_=b,h=d,m=!1):b<x&&(x=b,f=d,m=!0)}if(m?(pt(h),a!==f&&pt(f)):(f!==n&&pt(f),a!==h&&pt(h)),pt(a),r>=t.length||!d)break;pt(d),n=d}}else pt(h)}J&&ut([Y||J[0],K||J[1]]),B.push(j.slice(0,V))}return B}},{"../../constants/numerical":189,"../../lib":212,"./constants":343}],354:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],355:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(a=0;a<r.length;a++)(o=(i=r[a][0].trace).stackgroup||"")?o in u?l=u[o]:(l=u[o]=h,h++):i.fill in n&&f>=0?l=f:(l=f=h,h++),l<p&&(c=!0),i._groupIndex=p=l;var d=r.slice();c&&d.sort((function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(a=0;a<d.length;a++)o=(i=d[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in n&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d}},{}],356:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":18}],357:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],358:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":83,"../../components/colorscale/defaults":93,"../../components/colorscale/helpers":94,"./subtypes":364}],359:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":189,"../../lib":212}],360:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),p=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=i.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),g=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);i.forEach((function(t){delete t.vis})),d.forEach((function(t,e){0===Math.round((e+y)%m)&&(t.vis=!0)}))}(0,e,r,p,f);var y=!!m&&m.duration>0;function v(t){return y?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var E=b.fill.charAt(b.fill.length-1);"x"!==E&&"y"!==E&&(E=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var I,z,P="",D=[],O=b._prevtrace;O&&(P=O._prevRevpath||"",L=O._nextFill,D=O._polygons);var R,F,B,N,U,j,V,q="",H="",Z=[],G=a.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},Z=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(Z.length),g=0;g<Z.length;g++)b._polygons[g]=h(Z[g]);Z.length&&(N=Z[0][0],j=(U=Z[Z.length-1])[U.length-1]),G=function(t){return function(e){if(I=R(e),z=B(e),q?E?(q+="L"+I.substr(1),H=z+"L"+H.substr(1)):(q+="Z"+I,H=z+"Z"+H):(q=I,H=z),u.hasLines(b)&&e.length>1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",I).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",I),l.singleLineStyle(p,i)}}}}}var X=A.selectAll(".js-line").data(Z);v(X.exit()).style("opacity",0).remove(),X.each(G(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(X,r.layerClipId,t),Z.length?(C?(C.datum(p),N&&j&&(E?("y"===E?N[1]=j[1]=x.c2p(0,!0):"x"===E&&(N[0]=j[0]=_.c2p(0,!0)),v(C).attr("d","M"+j+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(C).attr("d",q+"Z").call(l.singleFillStyle))):L&&("tonext"===b.fill.substr(0,6)&&q&&P?("tonext"===b.fill?v(L).attr("d",q+"Z"+P+"Z").call(l.singleFillStyle):v(L).attr("d",q+"L"+P.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(D)):(Y(L),b._polygons=null)),b._prevRevpath=H,b._prevPolygons=V):(C?Y(C):L&&Y(L),b._polygons=b._prevRevpath=b._prevPolygons=null),M.datum(p),S.datum(p),function(e,i,a){var o,c=a[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var g=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?J:K:b&&!w&&(g=Q),p&&(d=g),h&&(m=g)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);y&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,_,x)?(l.singlePointStyle(e,a,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,_,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(M,W,t),l.setClipUrl(S,W,t)}function Y(t){v(t).attr("d","M0,0Z")}function K(t){return t.filter((function(t){return!t.gap&&t.vis}))}function J(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,m=!!a&&a.duration>0,g=p(t,e,r);((c=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){a[t]=null})).remove(),c.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,g,this,a)}))}))):c.each((function(r,n){f(t,n,e,r,g,this,a)}));d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":105,"../../lib":212,"../../lib/polygon":224,"../../registry":308,"./line_points":353,"./link_traces":355,"./subtypes":364,d3:16}],361:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)i=s[r],a=l.c2p(i.x),o=u.c2p(i.y),null!==i.i&&e.contains([a,o],!1,r,t)?(c.push({pointNumber:i.i,x:l.c2d(i.x),y:u.c2d(i.y)}),i.selected=1):i.selected=0;return c}},{"./subtypes":364}],362:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,i){var a=r._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var u=l[o],c=!1;u?u.traces.push(e):(u=l[o]={traceIndices:[],traces:[e]},c=!0);for(var p={orientation:e.x&&!e.y?"h":"v"},h=0;h<n.length;h++){var f=n[h],d=f+"Found";if(!u[d]){var m=void 0!==t[f],g="orientation"===f;if((m||c)&&(u[f]=i(f,p[f]),g&&(u.fillDflt="h"===u[f]?"tonextx":"tonexty"),m&&(u[d]=!0,!c&&(delete u.traces[0][f],g))))for(var y=0;y<u.traces.length-1;y++){var v=u.traces[y];v._input.fill!==v.fill&&(v.fill=u.fillDflt)}}}return u}}},{}],363:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../registry");function o(t,e,r){i.pointStyle(t.selectAll("path.point"),e,r)}function s(t,e,r){i.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){o(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){s(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),a.getComponentMethod("errorbars","style")(e)},stylePoints:o,styleText:s,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(i.selectedPointStyle(r.selectAll("path.point"),n),i.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),s(r,n,t))}}},{"../../components/drawing":105,"../../registry":308,d3:16}],364:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":212}],365:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i,a){a=a||{},i("textposition"),n.coerceFont(i,"textfont",r.font),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}},{"../../lib":212}],366:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");e.exports=function(t,e,r,a){var o,s=a("x"),l=a("y");if(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),s){var u=n.minRowLength(s);l?o=Math.min(u,n.minRowLength(l)):(o=u,a("y0"),a("dy"))}else{if(!l)return 0;o=n.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}},{"../../lib":212,"../../registry":308}],367:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,u=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll,p=a.marker,h=a.line,f=p.line;e.exports=c({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:u({},a.mode,{dflt:"markers"}),text:u({},a.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:u({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:a.connectgaps,marker:u({symbol:p.symbol,opacity:p.opacity,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,colorbar:p.colorbar,line:u({width:f.width},s("marker.line")),gradient:p.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:a.fillcolor,selected:a.selected,unselected:a.unselected,hoverinfo:u({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":90,"../../components/drawing/attributes":104,"../../lib/extend":204,"../../plot_api/edit_types":240,"../../plots/attributes":254,"../../plots/template_attributes":307,"../scatter/attributes":339}],368:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../../lib")._;function u(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=Array.isArray(e.locations),p=c?e.locations.length:e._length,h=new Array(p);r=e.geojson?function(t){return u(t)||n(t)}:u;for(var f=0;f<p;f++){var d=h[f]={};if(c){var m=e.locations[f];d.loc=r(m)?m:null}else{var g=e.lon[f],y=e.lat[f];n(g)&&n(y)?d.lonlat=[+g,+y]:d.lonlat=[i,i]}}return o(h,e),a(t,e),s(h,e),p&&(h[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),h}},{"../../constants/numerical":189,"../../lib":212,"../scatter/arrays_to_calcdata":338,"../scatter/calc_selection":341,"../scatter/colorscale_calc":342,"fast-isnumeric":18}],369:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scattergeo/attributes"),o=t("../scatter/attributes"),s=t("../../plots/mapbox/layout_attributes"),l=t("../../plots/attributes"),u=t("../../components/colorscale/attributes"),c=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll,h=a.line,f=a.marker;e.exports=p({lon:a.lon,lat:a.lat,mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:c({},o.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:o.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},u("marker")),fill:a.fill,fillcolor:o.fillcolor,textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":90,"../../lib/extend":204,"../../plot_api/edit_types":240,"../../plots/attributes":254,"../../plots/mapbox/layout_attributes":295,"../../plots/template_attributes":307,"../scatter/attributes":339,"../scattergeo/attributes":367}],370:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/geojson_utils"),s=t("../../components/colorscale"),l=t("../../components/drawing"),u=t("../scatter/make_bubble_size_func"),c=t("../scatter/subtypes"),p=t("../../plots/mapbox/convert_text_opts"),h=t("../../components/fx/helpers").appendArrayPointValue,f=t("../../lib/svg_text_utils").NEWLINES,d=t("../../lib/svg_text_utils").BR_TAG_ALL;function m(){return{geojson:o.makeBlank(),layout:{visibility:"none"},paint:{}}}function g(t,e){return i.isArrayOrTypedArray(t)?e?function(e){return n(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===a}e.exports=function(t,e){var r,a=e[0].trace,_=!0===a.visible&&0!==a._length,x="none"!==a.fill,b=c.hasLines(a),w=c.hasMarkers(a),T=c.hasText(a),k=w&&"circle"===a.marker.symbol,A=w&&"circle"!==a.marker.symbol,M=m(),S=m(),C=m(),L=m(),E={fill:M,line:S,circle:C,symbol:L};if(!_)return E;if((x||b)&&(r=o.calcTraceToLineCoords(e)),x&&(M.geojson=o.makePolygon(r),M.layout.visibility="visible",i.extendFlat(M.paint,{"fill-color":a.fillcolor})),b&&(S.geojson=o.makeLine(r),S.layout.visibility="visible",i.extendFlat(S.paint,{"line-width":a.line.width,"line-color":a.line.color,"line-opacity":a.opacity})),k){var I=function(t){var e,r,a,o,c=t[0].trace,p=c.marker,h=c.selectedpoints,f=i.isArrayOrTypedArray(p.color),d=i.isArrayOrTypedArray(p.size),m=i.isArrayOrTypedArray(p.opacity);function g(t){return c.opacity*t}f&&(r=s.hasColorscale(c,"marker")?s.makeColorScaleFuncFromTrace(p):i.identity);d&&(a=u(c));m&&(o=function(t){return g(n(t)?+i.constrain(t,0,1):0)});var y,_=[];for(e=0;e<t.length;e++){var x=t[e],b=x.lonlat;if(!v(b)){var w={};r&&(w.mcc=x.mcc=r(x.mc)),a&&(w.mrc=x.mrc=a(x.ms)),o&&(w.mo=o(x.mo)),h&&(w.selected=x.selected||0),_.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:w})}}if(h)for(y=l.makeSelectedPointStyleFns(c),e=0;e<_.length;e++){var T=_[e].properties;y.selectedOpacityFn&&(T.mo=g(y.selectedOpacityFn(T))),y.selectedColorFn&&(T.mcc=y.selectedColorFn(T)),y.selectedSizeFn&&(T.mrc=y.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:_},mcc:f||y&&y.selectedColorFn?{type:"identity",property:"mcc"}:p.color,mrc:d||y&&y.selectedSizeFn?{type:"identity",property:"mrc"}:(k=p.size,k/2),mo:m||y&&y.selectedOpacityFn?{type:"identity",property:"mo"}:g(p.opacity)};var k}(e);C.geojson=I.geojson,C.layout.visibility="visible",i.extendFlat(C.paint,{"circle-color":I.mcc,"circle-radius":I.mrc,"circle-opacity":I.mo})}if((A||T)&&(L.geojson=function(t,e){for(var r=e._fullLayout,n=t[0].trace,a=n.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,p=c.hasText(n)?g(n.text):y,m=[],_=0;_<t.length;_++){var x=t[_];if(!v(x.lonlat)){var b,w=n.texttemplate;if(w){var T=Array.isArray(w)?w[_]||"":w,k=n._module.formatLabels(x,n,r),A={};h(A,n,x.i);var M=n._meta||{};b=i.texttemplateString(T,k,r._d3locale,A,x,M)}else b=p(_);b&&(b=b.replace(f,"").replace(d,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:x.lonlat},properties:{symbol:l(_),angle:u(_),text:b}})}}return{type:"FeatureCollection",features:m}}(e,t),i.extendFlat(L.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),A&&(i.extendFlat(L.layout,{"icon-size":a.marker.size/10}),"angle"in a.marker&&"auto"!==a.marker.angle&&i.extendFlat(L.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),L.layout["icon-allow-overlap"]=a.marker.allowoverlap,i.extendFlat(L.paint,{"icon-opacity":a.opacity*a.marker.opacity,"icon-color":a.marker.color})),T)){var z=(a.marker||{}).size,P=p(a.textposition,z);i.extendFlat(L.layout,{"text-size":a.textfont.size,"text-anchor":P.anchor,"text-offset":P.offset}),i.extendFlat(L.paint,{"text-color":a.textfont.color,"text-opacity":a.opacity})}return E}},{"../../components/colorscale":95,"../../components/drawing":105,"../../components/fx/helpers":119,"../../constants/numerical":189,"../../lib":212,"../../lib/geojson_utils":208,"../../lib/svg_text_utils":234,"../../plots/mapbox/convert_text_opts":292,"../scatter/make_bubble_size_func":356,"../scatter/subtypes":364,"fast-isnumeric":18}],371:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function p(r,i){return n.coerce(t,e,u,r,i)}if(function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,p)){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),i.hasLines(e)&&(o(t,e,r,c,p,{noDash:!0}),p("connectgaps")),i.hasMarkers(e)){a(t,e,r,c,p,{noLine:!0}),p("marker.allowoverlap"),p("marker.angle");var h=e.marker;"circle"!==h.symbol&&(n.isArrayOrTypedArray(h.size)&&(h.size=h.size[0]),n.isArrayOrTypedArray(h.color)&&(h.color=h.color[0]))}i.hasText(e)&&s(t,e,c,p,{noSelect:!0}),p("fill"),"none"!==e.fill&&l(t,e,r,p),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}},{"../../lib":212,"../scatter/fillcolor_defaults":347,"../scatter/line_defaults":352,"../scatter/marker_defaults":358,"../scatter/subtypes":364,"../scatter/text_defaults":365,"./attributes":369}],372:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],373:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var i={},a=r[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}},{"../../plots/cartesian/axes":258}],374:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../scatter/get_trace_color"),o=i.fillText,s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var l=t.cd,u=l[0].trace,c=t.xa,p=t.ya,h=t.subplot,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(l,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-c.c2p([d,a]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)}),t),!1!==t.index){var m=l[t.index],g=m.lonlat,y=[i.modHalf(g[0],360)+f,g[1]],v=c.c2p(y),_=p.c2p(y),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(u,m),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(i||-1!==n.indexOf("text"))&&o(e,t,u);return u.join("<br>")}(u,m,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":123,"../../constants/numerical":189,"../../lib":212,"../scatter/get_trace_color":349}],375:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":293,"../scatter/marker_colorbar":357,"../scattergeo/calc":368,"./attributes":369,"./defaults":371,"./event_data":372,"./format_labels":373,"./hover":374,"./plot":376,"./select":377}],376:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e<a.length;e++)i=l[r=a[e]],this.addLayer(r,i,u);this.below=u}for(e=0;e<a.length;e++)i=l[r=a[e]],o.setOptions(this.layerIds[r],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&(this.setSourceData(r,i),o.setOptions(this.layerIds[r],"setPaintProperty",i.paint));t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=a.length-1;e>=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],u=0;u<a.length;u++){var c=a[u],p=s[c];i.addSource(c,p),i.addLayer(c,p,l)}return e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":291,"./convert":370}],377:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e){var r,o=t.cd,s=t.xaxis,l=t.yaxis,u=[],c=o[0].trace;if(!i.hasMarkers(c))return[];if(!1===e)for(r=0;r<o.length;r++)o[r].selected=0;else for(r=0;r<o.length;r++){var p=o[r],h=p.lonlat;if(h[0]!==a){var f=[n.modHalf(h[0],360),h[1]],d=[s.c2p(f),l.c2p(f)];e.contains(d,null,r,t)?(u.push({pointNumber:r,lon:h[0],lat:h[1]}),p.selected=1):p.selected=0}}return u}},{"../../constants/numerical":189,"../../lib":212,"../scatter/subtypes":364}],378:[function(t,e,r){"use strict";r.version="1.58.4"},{}]},{},[5])(5)}));