diff --git a/public/infection-map/assets/index.css b/public/infection-map/assets/index.css index efe9e397..e6e78c37 100644 --- a/public/infection-map/assets/index.css +++ b/public/infection-map/assets/index.css @@ -1 +1 @@ -:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.3;font-weight:400;color-scheme:light;color:#213547;background-color:#444;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#747bff}body{margin:0;display:flex;min-width:320px}h1{margin:0;padding:0;font-size:3.2em;line-height:1.1}button{border:1px solid #cccccc44;padding:.25em .75em;font-size:.9em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s;background-color:#f9f9f9}button:hover{border-color:#646cff}#app{max-width:1280px}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:#0006;color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.time-slider[data-v-04bdd2c0]{position:relative;background-color:#fff;display:flex;flex-direction:row;border:2px solid #4972e2;opacity:.9;height:5rem;-webkit-user-select:none;user-select:none}#dailybar[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;z-index:3;padding:4px}.labels[data-v-04bdd2c0]{font-size:.7rem;display:flex;flex-direction:row;line-height:.7rem;position:relative;width:100%;height:.6rem}.bars[data-v-04bdd2c0]{display:flex;flex-direction:row;flex:1}.week[data-v-04bdd2c0]{flex:1;background-color:#e24986;margin-right:1px;margin-top:auto;padding-bottom:1px}#dragthumb[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;left:0;background-color:#8ad2f9;z-index:5;color:#000;opacity:.6;display:flex;flex-direction:row;border-radius:5px}#dragthumb[data-v-04bdd2c0]:active,#dragthumb[data-v-04bdd2c0]:hover{background-color:#0cf;cursor:grab;transition:background-color .2s,border-color .2s;opacity:.7}#dragleftie[data-v-04bdd2c0],#dragrightie[data-v-04bdd2c0]{margin:0 auto 0 0;width:4px;background-color:#218f3a;opacity:0;z-index:10}#dragthumb:hover #dragleftie[data-v-04bdd2c0],#dragthumb:hover #dragrightie[data-v-04bdd2c0]{transition:opacity .2s;opacity:1;cursor:ew-resize}#dragleftie[data-v-04bdd2c0]{border-top-left-radius:5px;border-bottom-left-radius:5px}#dragrightie[data-v-04bdd2c0]{margin:0 0 0 auto;border-top-right-radius:5px;border-bottom-right-radius:5px}.date-label[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;height:2rem}:where([data-v-4aad93e9]:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}[data-v-4aad93e9],[data-v-4aad93e9]:before,[data-v-4aad93e9]:after{box-sizing:border-box}html[data-v-4aad93e9]{-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}a[data-v-4aad93e9],button[data-v-4aad93e9]{cursor:revert}ol[data-v-4aad93e9],ul[data-v-4aad93e9],menu[data-v-4aad93e9],summary[data-v-4aad93e9]{list-style:none}img[data-v-4aad93e9]{max-inline-size:100%;max-block-size:100%}table[data-v-4aad93e9]{border-collapse:collapse}input[data-v-4aad93e9],textarea[data-v-4aad93e9]{-webkit-user-select:auto}textarea[data-v-4aad93e9]{white-space:revert}meter[data-v-4aad93e9]{-webkit-appearance:revert;-moz-appearance:revert;appearance:revert}:where(pre[data-v-4aad93e9]){all:revert;box-sizing:border-box}[data-v-4aad93e9]::placeholder{color:unset}:where([hidden][data-v-4aad93e9]){display:none}:where([contenteditable][data-v-4aad93e9]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true][data-v-4aad93e9]){-webkit-user-drag:element}:where(dialog[data-v-4aad93e9]:modal){all:revert;box-sizing:border-box}[data-v-4aad93e9]::-webkit-details-marker{display:none}html[data-v-4aad93e9]{box-sizing:border-box}[data-v-4aad93e9],[data-v-4aad93e9]:before,[data-v-4aad93e9]:after{box-sizing:inherit}body[data-v-4aad93e9],html[data-v-4aad93e9]{height:100%;overscroll-behavior:contain}html[data-v-4aad93e9]{overflow-y:auto;color:var(--text)}b[data-v-4aad93e9]{font-weight:700}.app[data-v-4aad93e9]{position:absolute;top:0;bottom:0;left:0;right:0;margin:.5rem;padding:.5rem;background-color:#316386;display:grid;grid-template-rows:auto 1fr auto auto;grid-template-columns:1fr}.button-row[data-v-4aad93e9]{grid-row:1/2;grid-column:1/2;display:flex;flex-direction:row;margin-bottom:.5rem;color:#fff}.button-row p[data-v-4aad93e9]{font-size:1.1rem}.flex-row[data-v-4aad93e9]{display:flex;flex-direction:row}.flex-col[data-v-4aad93e9]{display:flex;flex-direction:column}.flex1[data-v-4aad93e9]{flex:1}.max-content[data-v-4aad93e9]{width:max-content}#mymap[data-v-4aad93e9]{flex:1;width:100%;grid-row:2/4;grid-column:1/2}button[data-v-4aad93e9]{width:4rem;text-align:center}button.isActive[data-v-4aad93e9]{background-color:#457ec0;color:#fff;border-radius:0}.time-slider[data-v-4aad93e9]{grid-column:1/2;grid-row:3/4;z-index:2;margin:1rem 1rem 2.75rem}/*! Oruga v0.4.2 | MIT License | github.com/oruga-ui/oruga */@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fadeOut{animation-name:fadeOut}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;transform:translate3d(0,100%,0)}}.fadeOutDown{animation-name:fadeOutDown}@keyframes fadeOutUp{0%{opacity:1}to{opacity:0;transform:translate3d(0,-100%,0)}}.fadeOutUp{animation-name:fadeOutUp}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fadeIn{animation-name:fadeIn}@keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}.fadeInDown{animation-name:fadeInDown}@keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}.fadeInUp{animation-name:fadeInUp}@keyframes append-animate{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.fade-enter-active,.fade-leave-active{transition:opacity .15s ease-out}.fade-enter,.fade-enter-from,.fade-leave-to{opacity:0}.zoom-in-enter-active,.zoom-in-leave-active{transition:opacity .15s ease-out}.zoom-in-enter-active .animation-content,.zoom-in-leave-active .animation-content{transition:transform .15s ease-out}.zoom-in-enter,.zoom-in-enter-from,.zoom-in-leave-active{opacity:0}.zoom-in-enter .animation-content,.zoom-in-enter-from .animation-content,.zoom-in-leave-active .animation-content{transform:scale(.95)}.zoom-out-enter-active,.zoom-out-leave-active{transition:opacity .15s ease-out}.zoom-out-enter-active .animation-content,.zoom-out-leave-active .animation-content{transition:transform .15s ease-out}.zoom-out-enter,.zoom-out-enter-from,.zoom-out-leave-active{opacity:0}.zoom-out-enter .animation-content,.zoom-out-enter-from .animation-content,.zoom-out-leave-active .animation-content{transform:scale(1.05)}.slide-next-enter-active,.slide-next-leave-active,.slide-prev-enter-active,.slide-prev-leave-active{transition:transform .3s cubic-bezier(.785,.135,.15,.86)}.slide-next-enter,.slide-next-enter-from,.slide-prev-leave-to{transform:translate3d(-100%,0,0);position:absolute;width:100%}.slide-next-leave-to,.slide-prev-enter,.slide-prev-enter-from{transform:translate3d(100%,0,0);position:absolute;width:100%}.slide-down-enter-active,.slide-down-leave-active,.slide-up-enter-active,.slide-up-leave-active{transition:transform .3s cubic-bezier(.785,.135,.15,.86)}.slide-down-enter,.slide-down-enter-from,.slide-up-leave-to{transform:translate3d(0,-100%,0);position:absolute;height:100%}.slide-down-leave-to,.slide-up-enter,.slide-up-enter-from{transform:translate3d(0,100%,0);position:absolute;height:100%}.slide-enter-active{transition:.15s ease-out}.slide-leave-active{transition:.15s ease-out;transition-timing-function:cubic-bezier(0,1,.5,1)}.slide-enter-to,.slide-leave,.slide-leave-from{max-height:100px;overflow:hidden}.slide-enter,.slide-enter-from,.slide-leave-to{overflow:hidden;max-height:0}:root{--oruga-primary:#445e00;--oruga-primary-invert:#ffffff;--oruga-secondary:#6c757d;--oruga-secondary-invert:#ffffff;--oruga-success:#006724;--oruga-success-invert:#ffffff;--oruga-info:#005c98;--oruga-info-invert:#ffffff;--oruga-warning:#f4c300;--oruga-warning-invert:#000000;--oruga-danger:#b60000;--oruga-danger-invert:#ffffff;--oruga-white:#ffffff;--oruga-black:#000000;--oruga-grey:#7a7a7a;--oruga-grey-light:#b5b5b5;--oruga-grey-lighter:#dbdbdb;--oruga-grey-dark:#4a4a4a;--oruga-focus:rgba(68, 94, 0, .25);--oruga-size-small:.75rem;--oruga-size-medium:1.25rem;--oruga-size-large:1.5rem;--oruga-base-font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif;--oruga-base-font-size:1rem;--oruga-base-font-weight:400;--oruga-base-border-radius:4px;--oruga-base-border-radius-rounded:9999px;--oruga-base-line-height:1.5;--oruga-base-disabled-opacity:.5;--oruga-transition-duration:.15s;--oruga-transition-timing:ease-out}*,:after,:before{box-sizing:inherit}html{box-sizing:border-box}body{margin:0;padding:0;font-family:var(--oruga-base-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-base-font-weight,400);line-height:var(--oruga-base-line-height, 1.5)}.o-noscroll{position:fixed;width:100%;bottom:0;overflow-x:hidden;overflow-y:scroll}.o-clipped{overflow:hidden}.o-acp__item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.o-acp__item--hover{background-color:var(--oruga-autocomplete-item-hover-background-color,#f5f5f5)}@keyframes spinAround{0%{transform:rotate(0)}to{transform:rotate(359deg)}}.o-btn{position:relative;display:inline-flex;cursor:pointer;text-align:center;white-space:nowrap;align-items:center;justify-content:center;vertical-align:top;text-decoration:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-color,var(--oruga-primary-invert));padding:var(--oruga-button-padding, calc(.375em - 1px) .75em);border:var(--oruga-button-border,1px solid var(--oruga-primary));border-radius:var(--oruga-button-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-button-box-shadow,none);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-button-font-weight,400);line-height:var(--oruga-button-line-height, var(--oruga-base-line-height));margin:var(--oruga-button-margin,0);height:var(--oruga-button-height,2.25em)}.o-btn__wrapper{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;margin-left:-.1875em;margin-right:-.1875em}.o-btn__wrapper>*{margin-left:.1875em;margin-right:.1875em}.o-btn__label,.o-btn--expanded{width:100%}.o-btn--rounded{border-radius:var(--oruga-button-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-btn--disabled{opacity:var(--oruga-button-disabled-opacity, var(--oruga-base-disabled-opacity));cursor:not-allowed;pointer-events:none}.o-btn--small{font-size:var(--oruga-button-font-size-small, .75rem)}.o-btn--medium{font-size:var(--oruga-button-font-size-medium, 1.25rem)}.o-btn--large{font-size:var(--oruga-button-font-size-large, 1.5rem)}.o-btn--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-btn--primary:hover{filter:brightness(97.5%)}.o-btn--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-btn--secondary:hover{filter:brightness(97.5%)}.o-btn--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-btn--success:hover{filter:brightness(97.5%)}.o-btn--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-btn--info:hover{filter:brightness(97.5%)}.o-btn--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-btn--warning:hover{filter:brightness(97.5%)}.o-btn--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-btn--danger:hover{filter:brightness(97.5%)}.o-btn--outlined{background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-background-color,var(--oruga-primary))}.o-btn--outlined:hover{border-color:transparent;background-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-color,var(--oruga-primary-invert))}.o-btn--outlined-primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-primary,#445e00)}.o-btn--outlined-primary:focus,.o-btn--outlined-primary:hover{border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-btn--outlined-secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-secondary,#6c757d)}.o-btn--outlined-secondary:focus,.o-btn--outlined-secondary:hover{border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-btn--outlined-success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-success,#006724)}.o-btn--outlined-success:focus,.o-btn--outlined-success:hover{border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-btn--outlined-info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-info,#005c98)}.o-btn--outlined-info:focus,.o-btn--outlined-info:hover{border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-btn--outlined-warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-warning,#f4c300)}.o-btn--outlined-warning:focus,.o-btn--outlined-warning:hover{border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-btn--outlined-danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-danger,#b60000)}.o-btn--outlined-danger:focus,.o-btn--outlined-danger:hover{border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-btn--loading{color:transparent!important;pointer-events:none}.o-btn--loading:after{-webkit-animation:spinAround .5s infinite linear;left:calc(50% - .5em);top:calc(50% - .5em);position:absolute!important;border:2px solid #dbdbdb;border-radius:9999px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;width:1em}.o-btn--inverted{background-color:var(--oruga-button-color,var(--oruga-primary-invert));border-color:var(--oruga-button-color,var(--oruga-primary-invert));color:var(--oruga-button-background-color,var(--oruga-primary))}.o-btn--inverted:hover{filter:brightness(95%)}.o-btn--inverted-primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-variant-invert-primary,#fff);border-color:var(--oruga-variant-invert-primary,#fff);color:var(--oruga-variant-primary,#445e00)}.o-btn--inverted-primary:focus,.o-btn--inverted-primary:hover{filter:brightness(95%)}.o-btn--inverted-secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-variant-invert-secondary,#fff);border-color:var(--oruga-variant-invert-secondary,#fff);color:var(--oruga-variant-secondary,#6c757d)}.o-btn--inverted-secondary:focus,.o-btn--inverted-secondary:hover{filter:brightness(95%)}.o-btn--inverted-success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-variant-invert-success,#fff);border-color:var(--oruga-variant-invert-success,#fff);color:var(--oruga-variant-success,#006724)}.o-btn--inverted-success:focus,.o-btn--inverted-success:hover{filter:brightness(95%)}.o-btn--inverted-info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-variant-invert-info,#fff);border-color:var(--oruga-variant-invert-info,#fff);color:var(--oruga-variant-info,#005c98)}.o-btn--inverted-info:focus,.o-btn--inverted-info:hover{filter:brightness(95%)}.o-btn--inverted-warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-variant-invert-warning,#000);border-color:var(--oruga-variant-invert-warning,#000);color:var(--oruga-variant-warning,#f4c300)}.o-btn--inverted-warning:focus,.o-btn--inverted-warning:hover{filter:brightness(95%)}.o-btn--inverted-danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-variant-invert-danger,#fff);border-color:var(--oruga-variant-invert-danger,#fff);color:var(--oruga-variant-danger,#b60000)}.o-btn--inverted-danger:focus,.o-btn--inverted-danger:hover{filter:brightness(95%)}.o-btn:focus,.o-btn:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0}.o-car{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;overflow:hidden;width:100%}.o-car__overlay{bottom:0;left:0;right:0;top:0;align-items:center;flex-direction:column;justify-content:center;display:flex;max-height:100vh;position:fixed;background-color:var(--oruga-carousel-overlay-background,hsla(0,0%,4%,.86));z-index:var(--oruga-carousel-overlay-zindex,40)}.o-car__wrapper{position:relative;width:100%}.o-car__items{display:flex;width:100%}.o-car__items:not(.o-car__items--dragging){transition:var(--oruga-carousel-items-transition, all var(--oruga-transition-duration) var(--oruga-transition-timing) 0s)}.o-car__item{border:var(--oruga-carousel-item-border,2px solid transparent);flex-shrink:0}.o-car__item--clickable{cursor:pointer}.o-car__indicators{width:100%;display:flex;align-items:center;justify-content:center;padding:var(--oruga-carousel-indicators-padding,.5rem);background:var(--oruga-carousel-indicators-background,rgba(var(--oruga-white),.5))}.o-car__indicators--inside{position:absolute}.o-car__indicators--inside--bottom{bottom:0}.o-car__indicators--inside--top{top:0}.o-car__indicator:not(:last-child){margin:var(--oruga-carousel-indicator-margin,0 .5rem 0 0)}.o-car__indicator__item{display:block;border:var(--oruga-carousel-indicator-border,1px solid var(--oruga-primary));background:var(--oruga-carousel-indicator-background,var(--oruga-white));transition:var(--oruga-carousel-indicator-transition, var(--oruga-transition-duration) var(--oruga-transition-timing))}.o-car__indicator__item :hover,.o-car__indicator__item--active{background:var(--oruga-carousel-indicator-active-background,var(--oruga-primary));border:var(--oruga-carousel-indicator-active-border,1px solid var(--oruga-primary))}.o-car__indicator__item--boxes{width:var(--oruga-carousel-indicator-size,10px);height:var(--oruga-carousel-indicator-size,10px)}.o-car__indicator__item--dots{border-radius:var(--oruga-carousel-indicator-dots-border-radius,var(--oruga-base-border-radius));width:var(--oruga-carousel-indicator-size,10px);height:var(--oruga-carousel-indicator-size,10px)}.o-car__indicator__item--lines{width:var(--oruga-carousel-indicator-lines-width,25px);height:var(--oruga-carousel-indicator-lines-height,5px)}.o-car__arrow__icon{cursor:pointer;background:var(--oruga-carousel-arrow-background,var(--oruga-white));color:var(--oruga-carousel-arrow-color,var(--oruga-primary));width:var(--oruga-carousel-arrow-size,1.5rem);height:var(--oruga-carousel-arrow-size,1.5rem);border-radius:var(--oruga-carousel-arrow-border-radius,var(--oruga-base-border-radius-rounded));border:var(--oruga-carousel-arrow-border,1px solid var(--oruga-white));transition:var(--oruga-carousel-arrow-transition, var(--oruga-transition-duration) var(--oruga-transition-timing))}.o-car__arrow__icon-next,.o-car__arrow__icon-prev{position:absolute;top:var(--oruga-carousel-arrow-top,50%);transform:translateY(var(--oruga-carousel-arrow-top,-50%));z-index:1}.o-car__arrow__icon-prev{left:var(--oruga-carousel-arrow-icon-spaced,1.5rem)}.o-car__arrow__icon-next{right:var(--oruga-carousel-arrow-icon-spaced,1.5rem)}.o-chk{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-flex;align-items:center;cursor:pointer;position:relative;line-height:var(--oruga-checkbox-line-height, 1.5);margin-right:var(--oruga-checkbox-margin-sibiling,.5em)}.o-chk__input{width:var(--oruga-checkbox-size,1rem);height:var(--oruga-checkbox-size,1rem);margin:0;outline:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;flex-shrink:0;cursor:pointer;box-shadow:var(--oruga-checkbox-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-checkbox-background-color,var(--oruga-primary));background-position:center;background-size:contain;background-repeat:no-repeat;transition:background var(--oruga-transition-duration) var(--oruga-transition-timing);border-radius:var(--oruga-checkbox-border-radius,var(--oruga-base-border-radius));border-width:var(--oruga-checkbox-border-width,2px);border-color:var(--oruga-checkbox-border-color,var(--oruga-primary));border-style:var(--oruga-checkbox-border-style,solid)}.o-chk__input--checked{background-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));border-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk__input--indeterminate{background-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));border-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk__label{padding:var(--oruga-checkbox-label-padding,0 0 0 .5em)}.o-chk--disabled{opacity:var(--oruga-checkbox-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-chk--small{font-size:var(--oruga-checkbox-font-size-small, .75rem)}.o-chk--small .o-chk__input{width:var(--oruga-checkbox-font-size-small,.75rem);height:var(--oruga-checkbox-font-size-small,.75rem)}.o-chk--medium{font-size:var(--oruga-checkbox-font-size-medium, 1.25rem)}.o-chk--medium .o-chk__input{width:var(--oruga-checkbox-font-size-medium,1.25rem);height:var(--oruga-checkbox-font-size-medium,1.25rem)}.o-chk--large{font-size:var(--oruga-checkbox-font-size-large, 1.5rem)}.o-chk--large .o-chk__input{width:var(--oruga-checkbox-font-size-large,1.5rem);height:var(--oruga-checkbox-font-size-large,1.5rem)}.o-chk--primary{--oruga-focus:rgba(68, 94, 0, .25)}.o-chk--primary .o-chk__input{border-color:var(--oruga-variant-primary,#445e00);background-color:var(--oruga-variant-primary,#445e00)}.o-chk--primary .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--primary .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--secondary{--oruga-focus:rgba(108, 117, 125, .25)}.o-chk--secondary .o-chk__input{border-color:var(--oruga-variant-secondary,#6c757d);background-color:var(--oruga-variant-secondary,#6c757d)}.o-chk--secondary .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--secondary .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--success{--oruga-focus:rgba(0, 103, 36, .25)}.o-chk--success .o-chk__input{border-color:var(--oruga-variant-success,#006724);background-color:var(--oruga-variant-success,#006724)}.o-chk--success .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--success .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--info{--oruga-focus:rgba(0, 92, 152, .25)}.o-chk--info .o-chk__input{border-color:var(--oruga-variant-info,#005c98);background-color:var(--oruga-variant-info,#005c98)}.o-chk--info .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--info .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--warning{--oruga-focus:rgba(244, 195, 0, .25)}.o-chk--warning .o-chk__input{border-color:var(--oruga-variant-warning,#f4c300);background-color:var(--oruga-variant-warning,#f4c300)}.o-chk--warning .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23000000' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--warning .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23000000' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--danger{--oruga-focus:rgba(182, 0, 0, .25)}.o-chk--danger .o-chk__input{border-color:var(--oruga-variant-danger,#b60000);background-color:var(--oruga-variant-danger,#b60000)}.o-chk--danger .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--danger .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk:focus .o-chk__input,.o-chk:focus-within .o-chk__input{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-clps{width:100%}.o-clps__trigger{cursor:pointer;display:inline-block}.o-clps__content{display:inherit}.o-dpck{font-size:var(--oruga-datepicker-font-size, var(--oruga-base-font-size))}.o-dpck--small{font-size:var(--oruga-datepicker-font-size-small, .75rem)}.o-dpck--medium{font-size:var(--oruga-datepicker-font-size-medium, 1.25rem)}.o-dpck--large{font-size:var(--oruga-datepicker-font-size-large, 1.5rem)}.o-dpck__dropdown{width:100%}.o-dpck__box{--oruga-dropdown-item-line-height:var(--oruga-base-line-height);--oruga-dropdown-item-padding:.375rem 1rem}.o-dpck__header{padding:var(--oruga-datepicker-header-padding,0 0 .875rem 0);margin:var(--oruga-datepicker-header-margin,0 0 .875rem 0);border-bottom:var(--oruga-datepicker-header-border-bottom,1px solid var(--oruga-grey-lighter))}.o-dpck__header__buttons{align-items:center;display:flex;justify-content:center;text-align:center}.o-dpck__header__buttons--small{font-size:var(--oruga-datepicker-font-size-small, .75rem)}.o-dpck__header__buttons--medium{font-size:var(--oruga-datepicker-font-size-medium, 1.25rem)}.o-dpck__header__buttons--large{font-size:var(--oruga-datepicker-font-size-large, 1.5rem)}.o-dpck__header__previous{order:1}.o-dpck__header__next{order:3}.o-dpck__header__next,.o-dpck__header__previous{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;justify-content:center;text-align:center;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;align-items:center;box-shadow:none;display:inline-flex;position:relative;vertical-align:top;line-height:var(--oruga-datepicker-btn-line-height, var(--oruga-base-line-height));border:var(--oruga-datepicker-btn-border,1px solid transparent);border-radius:var(--oruga-datepicker-btn-border-radius,var(--oruga-base-border-radius));border-color:var(--oruga-datepicker-btn-border-color,var(--oruga-grey-lighter));color:var(--oruga-datepicker-btn-color,#363636);min-width:var(--oruga-datepicker-btn-min-width,2.25em);height:var(--oruga-datepicker-btn-height,2.25em);padding:var(--oruga-datepicker-btn-padding,.5em .5em);margin:var(--oruga-datepicker-btn-margin,.25rem)}.o-dpck__header__next:hover,.o-dpck__header__previous:hover{text-decoration:none;border-color:var(--oruga-datepicker-btn-hover-border-color,var(--oruga-grey-light));color:var(--oruga-datepicker-btn-hover-color,#363636)}.o-dpck__header__list{order:2;align-items:center;display:flex;justify-content:center;text-align:center;list-style:none;flex-wrap:wrap;margin:0;padding:0;margin-left:-.125rem;margin-right:-.125rem}.o-dpck__header__list>*{margin-left:.125rem;margin-right:.125rem}.o-dpck__footer{padding:var(--oruga-datepicker-header-padding,.875rem .5rem 0 .5rem);margin:var(--oruga-datepicker-header-margin,.875rem 0 .875rem 0);border-top:var(--oruga-datepicker-header-border-top,1px solid var(--oruga-grey-lighter))}.o-dpck__month,.o-dpck__table{display:table;margin:0 auto}.o-dpck__month__head,.o-dpck__table__head{display:table-header-group;padding:var(--oruga-datepicker-table-head-padding,0 0 .875rem 0);margin:var(--oruga-datepicker-table-head-margin,0 0 .875rem 0);border-bottom:var(--oruga-datepicker-table-head-border-bottom,1px solid var(--oruga-grey-lighter))}.o-dpck__month__body,.o-dpck__table__body{display:table-row-group}.o-dpck__month__row,.o-dpck__table__row{display:table-row}.o-dpck__month__head-cell,.o-dpck__table__head-cell{padding:var(--oruga-datepicker-table-head-item-padding,var(--oruga-grey));font-weight:var(--oruga-datepicker-table-head-item-font-weight,600)}.o-dpck__month__cell,.o-dpck__table__cell{text-align:center;vertical-align:middle;display:table-cell;text-decoration:none;border-radius:var(--oruga-datepicker-item-border-radius,var(--oruga-base-border-radius));padding:var(--oruga-datepicker-item-padding,.5rem .75rem)}.o-dpck__month__cell--unselectable,.o-dpck__table__cell--unselectable{color:var(--oruga-datepicker-item-disabled-color,var(--oruga-grey-light))}.o-dpck__month__cell--today,.o-dpck__table__cell--today{border:var(--oruga-datepicker-item-today-border,solid 1px rgba(var(--oruga-primary),.5))}.o-dpck__month__cell--selectable,.o-dpck__table__cell--selectable{cursor:pointer;color:var(--oruga-datepicker-item-selectable-color,var(--oruga-grey-dark))}.o-dpck__month__cell--first-hovered,.o-dpck__table__cell--first-hovered{background-color:var(--oruga-datepicker-item-hovered-background-color,var(--oruga-grey));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-bottom-right-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-right-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--within-hovered,.o-dpck__table__cell--within-hovered{background-color:var(--oruga-datepicker-item-hovered-within-background-color,rgb(from var(--oruga-grey) r g b/50%));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--last-hovered,.o-dpck__table__cell--last-hovered{background-color:var(--oruga-datepicker-item-hovered-background-color,var(--oruga-grey));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-bottom-left-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-left-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert))}.o-dpck__month__cell--first-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--first-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert));border-bottom-right-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-right-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--within-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--within-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-within-background-color,rgb(from var(--oruga-primary) r g b/50%));border-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--last-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--last-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert));border-bottom-left-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-left-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--nearby:not(.o-dpck__table__cell--selected,.o-dpck__month__cell--selected),.o-dpck__table__cell--nearby:not(.o-dpck__table__cell--selected,.o-dpck__month__cell--selected){color:var(--oruga-datepicker-item-nearby-color,var(--oruga-grey-light))}.o-dpck__month__cell--invisible,.o-dpck__table__cell--invisible{visibility:hidden}.o-dpck__month__cell--events,.o-dpck__table__cell--events{position:relative;padding:var(--oruga-datepicker-events-item-padding,.3rem .75rem .75rem)}.o-dpck__month__events,.o-dpck__table__events{display:flex;justify-content:center;position:absolute;width:100%;left:0;bottom:15%}.o-dpck__month__event,.o-dpck__table__event{background-color:var(--oruga-datepicker-event-background-color,var(--oruga-grey-light))}.o-dpck__month__event--primary,.o-dpck__table__event--primary{background-color:#445e00;background-color:var(--oruga-variant-primary,#445e00)}.o-dpck__month__event--secondary,.o-dpck__table__event--secondary{background-color:#6c757d;background-color:var(--oruga-variant-secondary,#6c757d)}.o-dpck__month__event--success,.o-dpck__table__event--success{background-color:#006724;background-color:var(--oruga-variant-success,#006724)}.o-dpck__month__event--info,.o-dpck__table__event--info{background-color:#005c98;background-color:var(--oruga-variant-info,#005c98)}.o-dpck__month__event--warning,.o-dpck__table__event--warning{background-color:#f4c300;background-color:var(--oruga-variant-warning,#f4c300)}.o-dpck__month__event--danger,.o-dpck__table__event--danger{background-color:#b60000;background-color:var(--oruga-variant-danger,#b60000)}.o-dpck__month__event--dots,.o-dpck__table__event--dots{border-radius:50%;margin:var(--oruga-datepicker-event-dots-margin,0 .1em);height:var(--oruga-datepicker-event-dots-size,.35em);width:var(--oruga-datepicker-event-dots-size,.35em)}.o-dpck__month__event--bars,.o-dpck__table__event--bars{height:var(--oruga-datepicker-event-bars-height,.25em);width:100%}.o-dpck__month__table{display:inline-flex;flex-wrap:wrap;flex-direction:row;width:17rem}.o-dpck__month__cell{display:flex;align-items:center;justify-content:center;width:33.33%;height:2.5rem}.o-dpck--expanded{width:100%;flex-grow:1}.o-dpck--mobile .o-dpck__header__previous{order:1;flex-grow:1;flex-shrink:1}.o-dpck--mobile .o-dpck__header__next{order:3;flex-grow:1;flex-shrink:1}.o-dpck--mobile .o-dpck__header__list{order:2;flex-grow:1;flex-shrink:1}.o-dtpck__time{display:flex;justify-content:center;align-items:center;--oruga-dropdown-menu-box-shadow:0,0,0,0}.o-drop{display:inline-flex;position:relative;vertical-align:top}.o-drop__overlay{position:fixed;bottom:0;left:0;right:0;top:0;cursor:pointer;display:none;background-color:var(--oruga-dropdown-mobile-overlay-color,rgba(0,0,0,.86));z-index:var(--oruga-dropdown-mobile-overlay-zindex,55)}.o-drop__trigger{width:100%}.o-drop__menu{position:absolute;display:block;min-width:var(--oruga-dropdown-menu-width,12rem);z-index:var(--oruga-dropdown-menu-zindex,50);background-color:var(--oruga-dropdown-menu-background,#fff);border-radius:var(--oruga-dropdown-menu-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-dropdown-menu-box-shadow,0 .5em 1em -.125em rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.02));padding:var(--oruga-dropdown-menu-padding,.5rem 0 .5rem 0);margin:var(--oruga-dropdown-menu-margin,0)}.o-drop__menu--bottom{left:50%;right:auto;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto;transform:translate(-50%)}.o-drop__menu--top{left:50%;right:auto;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px));transform:translate(-50%)}.o-drop__menu--left{right:calc(100% + var(--oruga-dropdown-menu-spacer,0px));left:auto;top:50%;bottom:auto;transform:translateY(-50%)}.o-drop__menu--right{right:auto;left:calc(100% + var(--oruga-dropdown-menu-spacer,0px));top:50%;bottom:auto;transform:translateY(-50%)}.o-drop__menu--top-right{right:0;left:auto;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px))}.o-drop__menu--top-left{right:auto;left:0;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px))}.o-drop__menu--bottom-right{right:0;left:auto;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto}.o-drop__menu--bottom-left{right:auto;left:0;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto}.o-drop__item{display:block;position:relative;color:var(--oruga-dropdown-item-color,#000);font-size:var(--oruga-dropdown-item-font-size, var(--oruga-base-font-size));font-weight:var(--oruga-dropdown-item-font-weight,400);line-height:var(--oruga-dropdown-item-line-height, var(--oruga-base-line-height));padding:var(--oruga-dropdown-item-padding,.375rem 1rem)}.o-drop__item--disabled{opacity:var(--oruga-dropdown-item-disabled-opacity, var(--oruga-base-disabled-opacity));pointer-events:none}.o-drop__item--active{background-color:var(--oruga-dropdown-item-active-background-color,var(--oruga-primary));color:var(--oruga-dropdown-item-active-color,var(--oruga-primary-invert))}.o-drop__item--clickable{cursor:pointer}.o-drop__item--clickable:not(.o-drop__item--active):hover{background-color:var(--oruga-dropdown-item-hover-background-color,#f5f5f5);color:var(--oruga-dropdown-item-hover-color,#000)}.o-drop--inline{display:inline}.o-drop--inline .o-drop__menu{position:static;display:inline-block;padding:0}.o-drop--expanded,.o-drop--expanded .o-drop__menu{width:100%}.o-acp__item--empty,.o-acp__item-group-title,.o-drop--disabled{opacity:var(--oruga-dropdown-disabled-opacity, var(--oruga-base-disabled-opacity));pointer-events:none}.o-drop--mobile>.o-drop__menu{position:fixed;top:25%;left:50%;bottom:auto;right:auto;transform:translate3d(-50%,-25%,0);overflow-y:auto;width:var(--oruga-dropdown-mobile-width, calc(100vw - 40px) );max-width:var(--oruga-dropdown-mobile-max-width,460px);max-height:var(--oruga-dropdown-mobile-max-height, calc(100vh - 120px) );z-index:var(--oruga-dropdown-mobile-zindex,60)}.o-drop--mobile>.o-drop__overlay{display:block}.o-drop--teleport{width:unset}.o-field{flex-grow:1}.o-field:not(:last-child){margin-bottom:var(--oruga-field-margin-bottom,.75rem)}.o-field__label{display:block;color:var(--oruga-field-label-color,#363636);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-field-label-font-weight,600)}.o-field__label-small{font-size:var(--oruga-field-font-size-small, .75rem)}.o-field__label-medium{font-size:var(--oruga-field-font-size-medium, 1.25rem)}.o-field__label-large{font-size:var(--oruga-field-font-size-large, 1.5rem)}.o-field__message{display:block;font-size:var(--oruga-field-message-font-size, .75rem);margin-top:var(--oruga-field-message-margin-top,.25rem)}.o-field__message-primary{color:var(--oruga-variant-primary,#445e00)}.o-field__message-secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-field__message-success{color:var(--oruga-variant-success,#006724)}.o-field__message-info{color:var(--oruga-variant-info,#005c98)}.o-field__message-warning{color:var(--oruga-variant-warning,#f4c300)}.o-field__message-danger{color:var(--oruga-variant-danger,#b60000)}.o-field--addons{display:flex;justify-content:flex-start}.o-field--addons>:first-child:not(:only-child) button,.o-field--addons>:first-child:not(:only-child) input,.o-field--addons>:first-child:not(:only-child) select,.o-field--addons>button:first-child,.o-field--addons>input:first-child,.o-field--addons>select:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.o-field--addons>:last-child:not(:only-child) button,.o-field--addons>:last-child:not(:only-child) input,.o-field--addons>:last-child:not(:only-child) select,.o-field--addons>button:last-child,.o-field--addons>input:last-child,.o-field--addons>select:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.o-field--addons>:not(:first-child):not(:last-child) button,.o-field--addons>:not(:first-child):not(:last-child) input,.o-field--addons>:not(:first-child):not(:last-child) select,.o-field--addons>button:not(:first-child):not(:last-child),.o-field--addons>input:not(:first-child):not(:last-child),.o-field--addons>select:not(:first-child):not(:last-child){border-radius:0}.o-field--grouped{display:flex;margin-left:-.37rem;margin-right:-.37rem}.o-field--grouped>*{margin-left:.37rem;margin-right:.37rem}.o-field--grouped-multiline{flex-wrap:wrap}.o-field--grouped-multiline:last-child{margin-bottom:var(--oruga-field-margin-bottom,.75rem)}.o-field__horizontal-body{display:flex;flex-basis:0;flex-grow:5;flex-shrink:1;margin-left:-.37rem;margin-right:-.37rem}.o-field__horizontal-body>*{margin-left:.37rem;margin-right:.37rem}.o-field--horizontal{display:flex}.o-field__horizontal-label{flex-basis:0;flex-grow:1;flex-shrink:0;margin:0 1.5rem 0 0;text-align:right}.o-field--mobile .o-field__horizontal-body,.o-field--mobile .o-field__horizontal-label,.o-field--mobile.o-field--horizontal{display:block;text-align:inherit}@keyframes icon-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.o-icon{align-items:center;display:inline-flex;justify-content:center;transition:transform .15s ease-out,opacity .3s ease-out}.o-icon--small{font-size:var(--oruga-icon-font-size-small, .75rem)}.o-icon--medium{font-size:var(--oruga-icon-font-size-medium, 1.25rem)}.o-icon--large{font-size:var(--oruga-icon-font-size-large, 1.5rem)}.o-icon--primary{color:var(--oruga-variant-primary,#445e00)}.o-icon--secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-icon--success{color:var(--oruga-variant-success,#006724)}.o-icon--info{color:var(--oruga-variant-info,#005c98)}.o-icon--warning{color:var(--oruga-variant-warning,#f4c300)}.o-icon--danger{color:var(--oruga-variant-danger,#b60000)}.o-icon--clickable{pointer-events:auto;cursor:pointer}.o-icon--spin{animation-name:icon-spin;animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:var(--oruga-icon-spin-duration, 2s)}.o-input{-moz-appearance:none;-webkit-appearance:none;display:inline-flex;position:relative;vertical-align:top;box-shadow:var(--oruga-input-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-input-background-color,#fff);border-color:var(--oruga-input-border-color,var(--oruga-grey-lighter));border-style:var(--oruga-input-border-style,solid);border-width:var(--oruga-input-border-width,1px);border-radius:var(--oruga-input-border-radius,var(--oruga-base-border-radius));color:var(--oruga-input-color,#363636);font-size:var(--oruga-base-font-size, 1rem);height:var(--oruga-input-height,2.25em);line-height:var(--oruga-input-line-height, var(--oruga-base-line-height));padding:var(--oruga-input-padding, calc(.375em - 1px) calc(.625em - 1px) );margin:var(--oruga-input-margin,0)}.o-input__wrapper{display:inline-block;position:relative}.o-input__wrapper--expanded{width:100%;flex-grow:1;flex-shrink:1}.o-input__wrapper--expanded .o-input{width:100%}.o-input__textarea{display:block;max-width:100%;min-width:100%;height:auto;resize:vertical;padding:var(--oruga-input-textarea-padding,.625em)}.o-input__textarea:not([rows]){max-height:var(--oruga-input-textarea-max-height,600px);min-height:var(--oruga-input-textarea-min-height,120px)}.o-input__counter{display:block;float:right;font-size:var(--oruga-input-counter-font-size, .75rem);margin:var(--oruga-input-counter-margin,.25rem 0 0 .5rem)}.o-input__icon-left,.o-input__icon-right{position:absolute;top:0;height:100%;width:var(--oruga-input-height,2.25em);z-index:var(--oruga-input-icon-zindex,4)}.o-input__icon-right{right:0}.o-input__icon-left{left:0}.o-input--iconspace-left{padding-left:var(--oruga-input-height,2.25em)}.o-input--iconspace-right{padding-right:var(--oruga-input-height,2.25em)}.o-input--rounded{border-radius:var(--oruga-input-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-input--small{font-size:var(--oruga-input-font-size-small, .75rem)}.o-input--medium{font-size:var(--oruga-input-font-size-medium, 1.25rem)}.o-input--large{font-size:var(--oruga-input-font-size-large, 1.5rem)}.o-input--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:var(--oruga-variant-primary,#445e00)}.o-input--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:var(--oruga-variant-secondary,#6c757d)}.o-input--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:var(--oruga-variant-success,#006724)}.o-input--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:var(--oruga-variant-info,#005c98)}.o-input--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:var(--oruga-variant-warning,#f4c300)}.o-input--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:var(--oruga-variant-danger,#b60000)}.o-input:focus,.o-input:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-load{position:absolute;bottom:0;left:0;right:0;top:0;align-items:center;display:flex;justify-content:center;overflow:hidden;z-index:var(--oruga-loading-zindex,29)}.o-load--fullpage{position:fixed;z-index:var(--oruga-loading-fullpage-zindex,999)}.o-load__overlay{position:absolute;bottom:0;left:0;right:0;top:0;background:var(--oruga-loading-overlay-legacy,#7f7f7f);background:var(--oruga-loading-overlay,rgba(255,255,255,.5))}.o-menu--small{font-size:var(--oruga-menu-font-size-small, .75rem)}.o-menu--medium{font-size:var(--oruga-menu-font-size-medium, 1.25rem)}.o-menu--large{font-size:var(--oruga-menu-font-size-large, 1.5rem)}.o-menu__item__wrapper,.o-menu__list{list-style:none}.o-menu__list{line-height:var(--oruga-menu-list-line-height, 1.25em)}.o-menu__item__submenu{border-left:var(--oruga-menu-list-border-left,1px solid var(--oruga-primary));padding-left:var(--oruga-menu-nested-list-padding-left,.75em);margin:var(--oruga-menu-nested-list-margin,.75em)}.o-menu__label{text-transform:uppercase;color:var(--oruga-menu-label-color,#7a7a7a);font-size:var(--oruga-menu-label-font-size, .75em)}.o-menu__label:not(:first-child){margin-top:var(--oruga-menu-label-spacing,1em)}.o-menu__label:not(:last-child){margin-bottom:var(--oruga-menu-label-spacing,1em)}.o-menu__item{display:block;list-style:none;color:var(--oruga-menu-item-color,var(--oruga-grey-dark));padding:var(--oruga-menu-item-padding,.5em .75em);font-size:var(--oruga-menu-item-size, 1rem)}.o-menu__item:hover:not(.o-menu__item--active):not(.o-menu__item--disabled){color:var(--oruga-menu-item-hover-color,var(--oruga-black));background-color:var(--oruga-menu-item-hover-background-color,var(--oruga-grey-light))}.o-menu__item--icon-text .o-icon{margin-right:var(--oruga-menu-icon-spacer,.5rem)}.o-menu__item--active{color:var(--oruga-menu-item-active-color,var(--oruga-primary-invert));background-color:var(--oruga-menu-item-active-background-color,var(--oruga-primary))}.o-menu__item--disabled{color:var(--oruga-menu-item-disabled-color,var(--oruga-grey-light))}.o-modal{display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden;position:fixed;bottom:0;left:0;right:0;top:0;z-index:var(--oruga-modal-zindex,40)}.o-modal__overlay{bottom:0;left:0;position:absolute;right:0;top:0;background-color:var(--oruga-modal-overlay-background-color,hsla(0,0%,4%,.86))}.o-modal__content{overflow:auto;position:relative;margin:var(--oruga-modal-content-margin,0 auto);max-height:var(--oruga-modal-content-max-height, calc(100vh - 160px) );background-color:var(--oruga-modal-content-background-color,var(--oruga-white));border-radius:var(--oruga-modal-content-border-radius,var(--oruga-base-border-radius))}.o-modal__content--full-screen{width:100%;height:100%;max-height:100vh;margin:0;background-color:var(--oruga-modal-content-fullscreen-background-color,#f5f5f5)}.o-modal__close{background:0 0;position:fixed;border:none;display:inline-block;vertical-align:top;border-radius:var(--oruga-modal-close-border-radius,var(--oruga-base-border-radius-rounded));right:var(--oruga-modal-close-right,20px);top:var(--oruga-modal-close-top,20px);height:var(--oruga-modal-close-size,32px);width:var(--oruga-modal-close-size,32px);color:var(--oruga-modal-close-color,var(--oruga-white))}.o-modal--mobile .o-modal__content{width:100%}.o-notification{position:relative;transform-origin:50% 0;background-color:var(--oruga-notification-background-color,var(--oruga-primary));color:var(--oruga-notification-color,var(--oruga-white));border-radius:var(--oruga-notification-border-radius,4px);padding:var(--oruga-notification-padding,1.75em 1.75em);margin-bottom:var(--oruga-notification-margin-bottom,1.5rem)}.o-notification__content{flex-basis:auto;flex-grow:1;flex-shrink:1;text-align:inherit;overflow-y:hidden;overflow-x:auto}.o-notification__wrapper{align-items:flex-start;display:flex;text-align:inherit;padding-top:0;border:0}.o-notification__icon{flex-basis:auto;flex-grow:0;flex-shrink:0;margin-right:var(--oruga-notification-icon-margin-right,1rem)}.o-notification__close{position:absolute;border:none;cursor:pointer;pointer-events:auto;display:flex;justify-content:center;align-items:center;flex-grow:0;flex-shrink:0;vertical-align:top;background-color:var(--oruga-notification-close-background-color,hsla(0,0%,4%,.2));border-radius:var(--oruga-notification-close-border-radius,var(--oruga-base-border-radius-rounded));right:var(--oruga-notification-close-right,.5rem);top:var(--oruga-notification-close-top,.5rem);height:var(--oruga-notification-close-size,20px);width:var(--oruga-notification-close-size,20px);color:var(--oruga-notification-close-color,var(--oruga-white))}.o-notification--primary{border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-notification--primary:hover{filter:brightness(97.5%)}.o-notification--secondary{border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-notification--secondary:hover{filter:brightness(97.5%)}.o-notification--success{border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-notification--success:hover{filter:brightness(97.5%)}.o-notification--info{border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-notification--info:hover{filter:brightness(97.5%)}.o-notification--warning{border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-notification--warning:hover{filter:brightness(97.5%)}.o-notification--danger{border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-notification--danger:hover{filter:brightness(97.5%)}.o-notices{position:fixed;display:flex;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none;padding:var(--oruga-notification-notices-padding,2em);z-index:var(--oruga-notification-notices-zindex,1000)}.o-notices .o-notification{pointer-events:stroke;max-width:600px;animation:var(--oruga-notification-animantion,append-animate .3s linear)}.o-notices .o-notification--bottom,.o-notices .o-notification--top{align-self:center}.o-notices .o-notification--bottom-right,.o-notices .o-notification--top-right{align-self:flex-end}.o-notices .o-notification--bottom-left,.o-notices .o-notification--top-left{align-self:flex-start}.o-notices--top{flex-direction:column}.o-notices--bottom{flex-direction:column-reverse}.o-notices--bottom .o-notification{margin-bottom:0}.o-notices--bottom .o-notification:not(:first-child){margin-bottom:1.5rem}.o-notices__custom-container{position:absolute}.o-pag{align-items:center;display:flex;text-align:center;justify-content:space-between;font-size:var(--oruga-base-font-size, 1rem);margin:var(--oruga-pagination-margin,-.25rem)}.o-pag--small{font-size:var(--oruga-pagination-font-size-small, .75rem)}.o-pag--medium{font-size:var(--oruga-pagination-font-size-medium, 1.25rem)}.o-pag--large{font-size:var(--oruga-pagination-font-size-large, 1.5rem)}.o-pag__link{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;align-items:center;box-shadow:none;display:inline-flex;position:relative;vertical-align:top;justify-content:center;text-align:center;text-decoration:none;cursor:pointer;line-height:var(--oruga-pagination-link-line-height, var(--oruga-base-line-height));border:var(--oruga-pagination-link-border,1px solid transparent);border-radius:var(--oruga-pagination-link-border-radius,var(--oruga-base-border-radius));border-color:var(--oruga-pagination-link-border-color,var(--oruga-grey-lighter));color:var(--oruga-pagination-link-color,#363636);min-width:var(--oruga-pagination-link-min-width,2.25em);height:var(--oruga-pagination-link-height,2.25em);padding:var(--oruga-pagination-link-padding,.5em .5em);margin:var(--oruga-pagination-link-margin,.25rem)}.o-pag__link:hover{text-decoration:none;border-color:var(--oruga-pagination-link-hover-border-color,var(--oruga-grey-light))}.o-pag__link--rounded{border-radius:var(--oruga-pagination-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-pag__link--disabled{pointer-events:none;opacity:var(--oruga-pagination-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-pag__link--current{pointer-events:none;background-color:var(--oruga-pagination-link-current-background-color,var(--oruga-primary));border-color:var(--oruga-pagination-link-current-border-color,var(--oruga-primary));color:var(--oruga-pagination-link-current-color,#fff)}.o-pag__ellipsis{justify-content:center;text-align:center;pointer-events:none;margin:var(--oruga-pagination-link-margin,.25rem);color:var(--oruga-pagination-ellipsis-color,var(--oruga-grey-light))}.o-pag__next{order:3}.o-pag__previous{order:2}.o-pag__list{align-items:center;display:flex;text-align:center;list-style:none;flex-wrap:wrap;margin:0;padding:0;flex-grow:1;flex-shrink:1;justify-content:flex-start;order:1}.o-pag--simple{justify-content:normal}.o-pag--centered{justify-content:center}.o-pag--centered .o-pag__previous{order:1}.o-pag--centered .o-pag__next{order:3}.o-pag--centered .o-pag__list{justify-content:center;order:2}.o-pag--right{justify-content:flex-end}.o-pag--right .o-pag__previous{order:1}.o-pag--right .o-pag__next{order:2}.o-pag--right .o-pag__list{justify-content:flex-end;order:2}.o-pag--mobile{justify-content:flex-start;flex-wrap:wrap}.o-pag--mobile .o-pag__link{flex-grow:1;flex-shrink:1}.o-pag--mobile .o-pag__previous,.o-pag--mobile .o-pag__next{flex-grow:1;flex-shrink:1;order:0}.o-pag--mobile .o-pag__ellipsis{flex-grow:1;flex-shrink:1}.o-pag--mobile .o-pag__list{order:0}.o-radio{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-flex;align-items:center;cursor:pointer;line-height:var(--oruga-radio-line-height, 1.25);margin-right:var(--oruga-radio-margin-sibiling,.5em)}.o-radio__input{font-size:var(--oruga-radio-font-size, inherit);width:var(--oruga-radio-size,1rem);height:var(--oruga-radio-size,1rem);margin:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;cursor:pointer;box-shadow:var(--oruga-radio-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));border-radius:50%;background:var(--oruga-radio-active-background-color,#445e00);-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23000' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23000' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");background-image:none;background-position:center;background-size:contain;background-repeat:no-repeat;transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-radio__input--checked{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23e11919' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3Ccircle cx='256' cy='256' r='144'%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23e11919' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3Ccircle cx='256' cy='256' r='144'%3E%3C/circle%3E%3C/g%3E%3C/svg%3E")}.o-radio__label{padding:var(--oruga-radio-label-padding,0 0 0 .5em)}.o-radio--disabled{opacity:var(--oruga-radio-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-radio--small{--oruga-radio-font-size:.75rem;--oruga-radio-size:.75rem}.o-radio--medium{--oruga-radio-font-size:1.25rem;--oruga-radio-size:1.25rem}.o-radio--large{--oruga-radio-font-size:1.5rem;--oruga-radio-size:1.5rem}.o-radio--primary{--oruga-focus:rgba(68, 94, 0, .25);--oruga-radio-active-background-color:#445e00}.o-radio--secondary{--oruga-focus:rgba(108, 117, 125, .25);--oruga-radio-active-background-color:#6c757d}.o-radio--success{--oruga-focus:rgba(0, 103, 36, .25);--oruga-radio-active-background-color:#006724}.o-radio--info{--oruga-focus:rgba(0, 92, 152, .25);--oruga-radio-active-background-color:#005c98}.o-radio--warning{--oruga-focus:rgba(244, 195, 0, .25);--oruga-radio-active-background-color:#f4c300}.o-radio--danger{--oruga-focus:rgba(182, 0, 0, .25);--oruga-radio-active-background-color:#b60000}.o-radio:focus .o-radio__input,.o-radio:focus-within .o-radio__input{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-ctrl-sel{display:inline-flex;position:relative}.o-ctrl-sel--expanded{width:100%;flex-grow:1}.o-ctrl-sel--expanded .o-sel{width:100%}.o-sel{-moz-appearance:none;-webkit-appearance:none;display:inline-block;position:relative;vertical-align:top;cursor:pointer;justify-content:flex-start;align-items:center;box-shadow:var(--oruga-select-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-select-background-color,#fff);border-color:var(--oruga-select-border-color,var(--oruga-grey-lighter));border-width:var(--oruga-select-border-width,1px);border-style:var(--oruga-select-border-style,solid);border-radius:var(--oruga-select-border-radius,var(--oruga-base-border-radius));color:var(--oruga-select-color,#363636);font-size:var(--oruga-base-font-size, 1rem);height:var(--oruga-select-height,2.25em);line-height:var(--oruga-select-line-height, var(--oruga-base-line-height));padding:var(--oruga-select-padding, calc(.375em - 1px) calc(.625em - 1px) );margin:var(--oruga-select-margin,0)}.o-sel-arrow{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:serif='http://www.serif.com/' width='100%25' height='100%25' viewBox='0 0 100 100' version='1.1' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(5.70052,0,0,5.70052,-1329.79,-547.054)'%3E%3Cpath d='M233.451,101.749L235.617,99.422L242.013,105.565L248.463,99.422L250.642,101.749L242.013,110.052L233.451,101.749Z' style='fill:%23363636;stroke:white;stroke-width:0.18px;'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-size:var(--oruga-select-arrow-size,1rem);background-position:calc(100% - var(--oruga-select-arrow-size,1rem) * .5) center;padding-right:calc(var(--oruga-select-arrow-size,1rem) * 2)}.o-sel-iconspace-left{padding-left:var(--oruga-select-height,2.25em)}.o-sel-iconspace-right{padding-right:var(--oruga-select-height,2.25em)}.o-sel--small{font-size:var(--oruga-select-font-size-small, .75rem)}.o-sel--medium{font-size:var(--oruga-select-font-size-medium, 1.25rem)}.o-sel--large{font-size:var(--oruga-select-font-size-large, 1.5rem)}.o-sel--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:var(--oruga-variant-primary,#445e00)}.o-sel--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:var(--oruga-variant-secondary,#6c757d)}.o-sel--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:var(--oruga-variant-success,#006724)}.o-sel--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:var(--oruga-variant-info,#005c98)}.o-sel--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:var(--oruga-variant-warning,#f4c300)}.o-sel--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:var(--oruga-variant-danger,#b60000)}.o-sel--rounded{border-radius:var(--oruga-select-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-sel--multiple{height:auto;padding:0}.o-sel--placeholder{opacity:var(--oruga-select-placeholder-opacity, var(--oruga-base-disabled-opacity))}.o-sel__icon-left,.o-sel__icon-right{position:absolute;top:0;height:100%;width:var(--oruga-select-height,2.25em);z-index:var(--oruga-select-icon-zindex,4)}.o-sel__icon-right{right:0}.o-sel__icon-left{left:0}.o-sel[disabled]{cursor:inherit}.o-sel:focus,.o-sel:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus)}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.o-sklt{display:inline-flex;flex-direction:column;vertical-align:middle;width:100%}.o-sklt__item{width:100%;background:var(--oruga-skeleton-background,linear-gradient(90deg,#dbdbdb 25%,rgba(219,219,219,.5) 50%,#dbdbdb 75%));margin:var(--oruga-skeleton-margin,.5rem 0 0 0);line-height:var(--oruga-skeleton-font-size, 1rem)}.o-sklt__item--small{line-height:var(--oruga-skeleton-font-size-small, .75rem)}.o-sklt__item--medium{line-height:var(--oruga-skeleton-font-size-medium, 1.25rem)}.o-sklt__item--large{line-height:var(--oruga-skeleton-font-size-large, 1.5rem)}.o-sklt__item--rounded{border-radius:var(--oruga-skeleton-border-radius,var(--oruga-base-border-radius))}.o-sklt__item--animated{background-size:400% 100%;animation-name:skeleton-loading;animation-iteration-count:infinite;animation-duration:var(--oruga-skeleton-duration, 1.5s)}.o-sklt__item:after{content:" "}.o-sklt--centered{align-items:center}.o-sklt--right{align-items:flex-end;margin:var(--oruga-skeleton-margin,.5rem 0 0 0)}.o-side{position:fixed;top:0;left:0;height:100%;width:100%;display:none}.o-side__content{position:absolute;background-color:var(--oruga-sidebar-content-background-color,var(--oruga-grey-lighter));border-radius:var(--oruga-sidebar-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-sidebar-box-shadow,5px 0 13px 3px rgba(var(--oruga-black),.1))}.o-side__content--primary{background-color:var(--oruga-variant-primary),#445e00}.o-side__content--secondary{background-color:var(--oruga-variant-secondary),#6c757d}.o-side__content--success{background-color:var(--oruga-variant-success),#006724}.o-side__content--info{background-color:var(--oruga-variant-info),#005c98}.o-side__content--warning{background-color:var(--oruga-variant-warning),#f4c300}.o-side__content--danger{background-color:var(--oruga-variant-danger),#b60000}.o-side__content--left,.o-side__content--right{transition:width var(--oruga-transition-duration) var(--oruga-transition-timing);width:var(--oruga-sidebar-width,260px)}.o-side__content--bottom,.o-side__content--top{transition:height var(--oruga-transition-duration) var(--oruga-transition-timing);height:var(--oruga-sidebar-width,260px)}.o-side__content--right{left:auto;right:0;border-left:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--left{left:0;right:auto;border-right:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--top{top:0;bottom:auto;border-bottom:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--bottom{top:auto;bottom:0;border-top:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--reduced{width:var(--oruga-sidebar-reduced-width,80px)}.o-side__content--reduced-expand:hover{transition:width var(--oruga-transition-duration) var(--oruga-transition-timing);width:var(--oruga-sidebar-width,260px)}.o-side__content--fullwidth{width:100%;max-width:100%}.o-side__content--fullheight{height:100%;max-height:100%}.o-side__overlay{position:absolute;bottom:0;left:0;right:0;top:0;background:var(--oruga-sidebar-overlay,hsla(0,0%,4%,.86))}.o-side--active{display:block}.o-side--inline{position:relative}.o-side--inline .o-side__overlay{position:absolute}.o-side--inline .o-side__content{position:relative}.o-side:not(.o-side--inline){z-index:var(--oruga-sidebar-zindex,100)}.o-slide{width:100%;margin:var(--oruga-slider-margin,1em 0);background:var(--oruga-slider-background,transparent)}.o-slide__thumb{box-shadow:var(--oruga-slider-thumb-shadow,none);border:var(--oruga-slider-thumb-border,1px solid var(--oruga-grey-light));border-radius:var(--oruga-slider-thumb-radius,var(--oruga-base-border-radius));background:var(--oruga-slider-thumb-background,var(--oruga-white))}.o-slide__thumb:focus{transform:var(--oruga-slider-thumb-transform,scale(1.25))}.o-slide__thumb--rounded{border-radius:var(--oruga-slider-rounded-borded-radius,var(--oruga-base-border-radius-rounded))}.o-slide__thumb--dragging{cursor:grabbing;filter:brightness(.8)}.o-slide__track{display:flex;align-items:center;position:relative;cursor:pointer;background:var(--oruga-slider-track-background,var(--oruga-grey-lighter));border-radius:var(--oruga-slider-track-border-radius,var(--oruga-base-border-radius))}.o-slide__fill{position:absolute;height:100%;box-shadow:var(--oruga-slider-track-shadow,0 0 0 var(--oruga-grey));background:var(--oruga-slider-fill-background,var(--oruga-primary));border-radius:var(--oruga-slider-track-radius,var(--oruga-base-border-radius));border:var(--oruga-slider-track-border,0 solid var(--oruga-grey));top:50%;transform:translateY(-50%)}.o-slide__fill--primary{background:var(--oruga-variant-primary,#445e00)}.o-slide__fill--primary+.o-slide__thumb-wrapper{--oruga-focus:rgba(68, 94, 0, .25)}.o-slide__fill--secondary{background:var(--oruga-variant-secondary,#6c757d)}.o-slide__fill--secondary+.o-slide__thumb-wrapper{--oruga-focus:rgba(108, 117, 125, .25)}.o-slide__fill--success{background:var(--oruga-variant-success,#006724)}.o-slide__fill--success+.o-slide__thumb-wrapper{--oruga-focus:rgba(0, 103, 36, .25)}.o-slide__fill--info{background:var(--oruga-variant-info,#005c98)}.o-slide__fill--info+.o-slide__thumb-wrapper{--oruga-focus:rgba(0, 92, 152, .25)}.o-slide__fill--warning{background:var(--oruga-variant-warning,#f4c300)}.o-slide__fill--warning+.o-slide__thumb-wrapper{--oruga-focus:rgba(244, 195, 0, .25)}.o-slide__fill--danger{background:var(--oruga-variant-danger,#b60000)}.o-slide__fill--danger+.o-slide__thumb-wrapper{--oruga-focus:rgba(182, 0, 0, .25)}.o-slide .o-slide__track{height:var(--oruga-slider-track-height,calc(var(--oruga-base-font-size)/ 2))}.o-slide .o-slide__thumb{height:var(--oruga-slider-thumb-size,var(--oruga-base-font-size));width:var(--oruga-slider-thumb-size,var(--oruga-base-font-size))}.o-slide .o-slide__tick{height:var(--oruga-slider-tick-height,calc(var(--oruga-base-font-size)/ 2 * .5))}.o-slide .o-slide__tick-label{font-size:var(--oruga-slider-mark-size .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-,calc(var(--oruga-base-font-size)/ 2)) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--small .o-slide__track{height:var(--oruga-slider-track-height-small,.375rem)}.o-slide--small .o-slide__thumb{height:var(--oruga-slider-thumb-size-small,.75rem);width:var(--oruga-slider-thumb-size-small,.75rem)}.o-slide--small .o-slide__tick{height:var(--oruga-slider-tick-height-small,.1875rem)}.o-slide--small .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-small, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-small,.375rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--medium .o-slide__track{height:var(--oruga-slider-track-height-medium,.625rem)}.o-slide--medium .o-slide__thumb{height:var(--oruga-slider-thumb-size-medium,1.25rem);width:var(--oruga-slider-thumb-size-medium,1.25rem)}.o-slide--medium .o-slide__tick{height:var(--oruga-slider-tick-height-medium,.3125rem)}.o-slide--medium .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-medium, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-medium,.625rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--large .o-slide__track{height:var(--oruga-slider-track-height-large,.75rem)}.o-slide--large .o-slide__thumb{height:var(--oruga-slider-thumb-size-large,1.5rem);width:var(--oruga-slider-thumb-size-large,1.5rem)}.o-slide--large .o-slide__tick{height:var(--oruga-slider-tick-height-large,.375rem)}.o-slide--large .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-large, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-large,.75rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide__tick{position:absolute;transform:translate(-50%,-50%);top:50%;width:var(--oruga-slider-tick-width,3px);background:var(--oruga-slider-tick-background,var(--oruga-primary));border-radius:var(--oruga-slider-tick-radius,var(--oruga-base-border-radius))}.o-slide__tick--hidden{background:0 0}.o-slide__thumb-wrapper{display:inline-flex;align-items:center;position:absolute;cursor:grab;transform:translate(-50%,-50%);top:50%;flex-direction:column}.o-slide--disabled{cursor:not-allowed;pointer-events:none;opacity:var(--oruga-slider-track-disabled, .5)}.o-slide:active .o-slide__thumb,.o-slide:focus .o-slide__thumb,.o-slide:focus-within .o-slide__thumb{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-steps{display:flex;flex-wrap:wrap;margin:0;padding:0;font-size:var(--oruga-steps-size, var(--oruga-base-font-size));min-height:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2)}.o-steps .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-steps-size,var(--oruga-base-font-size))}.o-steps .o-steps__marker{height:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2);width:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2)}.o-steps .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-steps-size, var(--oruga-base-font-size)) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-steps-size, var(--oruga-base-font-size))}.o-steps .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small{font-size:var(--oruga-size-small, .75rem);min-height:calc(var(--oruga-size-small,.75rem) * 2)}.o-steps--small .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-small,.75rem)}.o-steps--small .o-steps__marker{height:calc(var(--oruga-size-small,.75rem) * 2);width:calc(var(--oruga-size-small,.75rem) * 2)}.o-steps--small .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-small, .75rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-small, .75rem)}.o-steps--small .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium{font-size:var(--oruga-size-medium, 1.25rem);min-height:calc(var(--oruga-size-medium,1.25rem) * 2)}.o-steps--medium .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-medium,1.25rem)}.o-steps--medium .o-steps__marker{height:calc(var(--oruga-size-medium,1.25rem) * 2);width:calc(var(--oruga-size-medium,1.25rem) * 2)}.o-steps--medium .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-medium, 1.25rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-medium, 1.25rem)}.o-steps--medium .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large{font-size:var(--oruga-size-large, 1.5rem);min-height:calc(var(--oruga-size-large,1.5rem) * 2)}.o-steps--large .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-large,1.5rem)}.o-steps--large .o-steps__marker{height:calc(var(--oruga-size-large,1.5rem) * 2);width:calc(var(--oruga-size-large,1.5rem) * 2)}.o-steps--large .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-large, 1.5rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-large, 1.5rem)}.o-steps--large .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps__nav-item{position:relative;display:flex;flex-grow:1;flex-basis:1em;justify-content:center;list-style:none;margin:0;padding:0;line-height:var(--oruga-steps-item-line-height, var(--oruga-base-line-height))}.o-steps__nav-item--primary.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-primary,#fff);border-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-primary,#445e00)}.o-steps__nav-item--primary.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:200% 100%}.o-steps__nav-item--primary.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-primary,#fff);background-color:var(--oruga-variant-primary,#445e00)}.o-steps__nav-item--primary.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:200% 100%}.o-steps__nav-item--secondary.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-secondary,#fff);border-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-secondary,#6c757d)}.o-steps__nav-item--secondary.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:200% 100%}.o-steps__nav-item--secondary.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-secondary,#fff);background-color:var(--oruga-variant-secondary,#6c757d)}.o-steps__nav-item--secondary.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:200% 100%}.o-steps__nav-item--success.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-success,#fff);border-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-success,#006724)}.o-steps__nav-item--success.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:200% 100%}.o-steps__nav-item--success.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-success,#fff);background-color:var(--oruga-variant-success,#006724)}.o-steps__nav-item--success.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:200% 100%}.o-steps__nav-item--info.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-info,#fff);border-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-info,#005c98)}.o-steps__nav-item--info.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:200% 100%}.o-steps__nav-item--info.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-info,#fff);background-color:var(--oruga-variant-info,#005c98)}.o-steps__nav-item--info.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:200% 100%}.o-steps__nav-item--warning.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-warning,#000);border-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-warning,#f4c300)}.o-steps__nav-item--warning.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:200% 100%}.o-steps__nav-item--warning.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-warning,#000);background-color:var(--oruga-variant-warning,#f4c300)}.o-steps__nav-item--warning.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:200% 100%}.o-steps__nav-item--danger.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-danger,#fff);border-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-danger,#b60000)}.o-steps__nav-item--danger.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:200% 100%}.o-steps__nav-item--danger.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-danger,#fff);background-color:var(--oruga-variant-danger,#b60000)}.o-steps__nav-item--danger.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:200% 100%}.o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color,var(--oruga-primary)) 50%);background-size:200% 100%;background-position:right bottom;content:" ";display:block;position:absolute;bottom:0;left:-50%;width:100%}.o-steps__content{position:relative;overflow:visible;display:flex;flex-direction:column;padding:var(--oruga-steps-content-padding,1rem)}.o-steps__content-transitioning{overflow:hidden}.o-steps--animated .o-steps__divider{transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-steps__link{display:flex;align-items:center;justify-content:center;flex-direction:column;background:0 0;border:transparent;cursor:pointer;text-decoration:none;color:var(--oruga-steps-link-color,#494949)}.o-steps__link-label-right{flex-direction:row}.o-steps__link-label-left{flex-direction:row-reverse}.o-steps__link:hover{text-decoration:none}.o-steps__link:not(.o-steps__link-clickable){cursor:not-allowed}.o-steps__marker{align-items:center;display:flex;justify-content:center;overflow:hidden;z-index:1;font-weight:var(--oruga-steps-marker-font-weight,700);background:var(--oruga-steps-marker-background,var(--oruga-grey-light));color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));border:var(--oruga-steps-marker-border,.2em solid #fff)}.o-steps__marker--rounded{border-radius:var(--oruga-steps-marker-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-steps__details{text-align:center;z-index:1;padding:var(--oruga-steps-details-padding,.2em);background-color:var(--oruga-steps-details-background-color,#fff)}.o-steps__nav-item-active .o-steps__link{cursor:default}.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));border-color:var(--oruga-steps-active-color,var(--oruga-primary));color:var(--oruga-steps-active-color,var(--oruga-primary))}.o-steps__nav-item-active .o-steps__divider{background-position:left bottom}.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));background-color:var(--oruga-steps-previous-color,var(--oruga-primary))}.o-steps__nav-item-previous .o-steps__divider{background-position:left bottom}.o-steps__item{flex-shrink:0;flex-basis:auto}.o-steps__wrapper-vertical{display:flex;flex-direction:row;flex-wrap:wrap}.o-steps__wrapper-vertical .o-steps{height:100%;flex-direction:column}.o-steps__wrapper-vertical .o-steps__divider{height:100%;width:var(--oruga-steps-divider-height,.2em);top:-50%;left:calc(50% - .1em)}.o-steps__wrapper-vertical .o-steps__item-active .o-steps__divider,.o-steps__wrapper-vertical .o-steps__item-previous .o-steps__divider{background-position:right top}.o-steps__wrapper-vertical .o-steps__nav-item{width:100%;display:flex;align-items:center;justify-content:center;padding:var(--oruga-steps-vertical-padding,1em 0)}.o-steps__wrapper-vertical .o-steps__nav-item--primary .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--secondary .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--success .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--info .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--warning .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--danger .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__content{flex-grow:1;flex-basis:70%}.o-steps__wrapper-vertical .o-steps__navigation{flex-basis:100%}.o-steps__wrapper-vertical.o-steps__wrapper-position-right{flex-direction:row-reverse}.o-steps--mobile .o-steps__title{display:none;padding:0}.o-steps--mobile .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-steps-divider-top,var(--oruga-base-font-size))}.o-steps--mobile .o-steps__divider .o-steps--small{top:var(--oruga-size-small,.75rem)}.o-steps--mobile .o-steps__divider .o-steps--medium{top:var(--oruga-size-medium,1.25rem)}.o-steps--mobile .o-steps__divider .o-steps--large{top:var(--oruga-size-large,1.5rem)}.o-switch{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;position:relative;border-radius:50rem}.o-switch--small{font-size:var(--oruga-font-size-name, .75rem)}.o-switch--medium{font-size:var(--oruga-font-size-name, 1.25rem)}.o-switch--large{font-size:var(--oruga-font-size-name, 1.5rem)}.o-switch--primary{--oruga-focus:rgba(68, 94, 0, .25)}.o-switch--primary .o-switch__check--checked{background:var(--oruga-variant-primary,#445e00)}.o-switch--primary-passive{--oruga-focus:rgba(68, 94, 0, .25)}.o-switch--primary-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-primary,#445e00)}.o-switch--secondary{--oruga-focus:rgba(108, 117, 125, .25)}.o-switch--secondary .o-switch__check--checked{background:var(--oruga-variant-secondary,#6c757d)}.o-switch--secondary-passive{--oruga-focus:rgba(108, 117, 125, .25)}.o-switch--secondary-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-secondary,#6c757d)}.o-switch--success{--oruga-focus:rgba(0, 103, 36, .25)}.o-switch--success .o-switch__check--checked{background:var(--oruga-variant-success,#006724)}.o-switch--success-passive{--oruga-focus:rgba(0, 103, 36, .25)}.o-switch--success-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-success,#006724)}.o-switch--info{--oruga-focus:rgba(0, 92, 152, .25)}.o-switch--info .o-switch__check--checked{background:var(--oruga-variant-info,#005c98)}.o-switch--info-passive{--oruga-focus:rgba(0, 92, 152, .25)}.o-switch--info-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-info,#005c98)}.o-switch--warning{--oruga-focus:rgba(244, 195, 0, .25)}.o-switch--warning .o-switch__check--checked{background:var(--oruga-variant-warning,#f4c300)}.o-switch--warning-passive{--oruga-focus:rgba(244, 195, 0, .25)}.o-switch--warning-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-warning,#f4c300)}.o-switch--danger{--oruga-focus:rgba(182, 0, 0, .25)}.o-switch--danger .o-switch__check--checked{background:var(--oruga-variant-danger,#b60000)}.o-switch--danger-passive{--oruga-focus:rgba(182, 0, 0, .25)}.o-switch--danger-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-danger,#b60000)}.o-switch__label{margin-left:var(--oruga-switch-margin-label,.5em)}.o-switch--left{flex-direction:row-reverse}.o-switch--left .o-switch__label{margin-left:0;margin-right:var(--oruga-switch-margin-label,.5em)}.o-switch__check-switch{content:"";display:block;height:calc((var(--oruga-switch-width,2.75em) - var(--oruga-switch-padding,.2em) * 2) * .5);width:calc((var(--oruga-switch-width,2.75em) - var(--oruga-switch-padding,.2em) * 2) * .5);background:var(--oruga-switch-action-background,#f5f5f5);box-shadow:var(--oruga-switch-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));transition:transform var(--oruga-transition-duration) var(--oruga-transition-timing);will-change:transform;transform-origin:left}.o-switch__check{display:flex;align-items:center;flex-shrink:0;width:var(--oruga-switch-width,2.75em);height:calc(var(--oruga-switch-width,2.75em) * .5 + var(--oruga-switch-padding,.2em));padding:var(--oruga-switch-padding,.2em);background:var(--oruga-switch-background,var(--oruga-grey-light));border-radius:var(--oruga-switch-border-radius,var(--oruga-base-border-radius));transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-switch__check--checked{background:var(--oruga-switch-active-background-color,var(--oruga-primary))}.o-switch__check--checked .o-switch__check-switch{transform:translate3d(100%,0,0)}.o-switch__input{position:absolute;left:0;opacity:0;z-index:-1}.o-switch--rounded{border-radius:var(--oruga-switch-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-switch--disabled{opacity:var(--oruga-switch-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-switch:focus .o-switch__check,.o-switch:focus-within .o-switch__check{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-table{display:table;width:100%;border-collapse:separate;border-spacing:0;border:var(--oruga-table-boder,1px solid transparent);border-radius:var(--oruga-table-border-radius,var(--oruga-base-border-radius));background-color:var(--oruga-table-background-color,#fff);color:var(--oruga-table-color,#000)}.o-table__root{position:relative}.o-table__wrapper{transition:opacity .3s ease-out;position:relative}.o-table__wrapper--sticky-header{height:var(--oruga-table-sticky-header-height,300px);overflow-y:auto}.o-table__wrapper--sticky-header th{position:-webkit-sticky;position:sticky;left:0;top:0;background:var(--oruga-table-background-color,#fff);z-index:calc(var(--oruga-table-sticky-zindex,1) + 1)}.o-table__wrapper--scrollable{-webkit-overflow-scrolling:touch;overflow-x:auto;max-width:100%}.o-table__wrapper--mobile{overflow-x:auto}.o-table__wrapper--mobile .o-table__mobile-sort{display:block}.o-table__wrapper--mobile .o-table{background-color:transparent}.o-table__wrapper--mobile thead tr{box-shadow:none;border-width:0}.o-table__wrapper--mobile thead tr th{display:none}.o-table__wrapper--mobile thead tr .o-table-th-checkbox{display:block;width:100%;text-align:right;border:0}.o-table__wrapper--mobile tfoot th{border:0;display:inherit}.o-table__wrapper--mobile tr{box-shadow:var(--oruga-table-card-box-shadow,0 2px 3px rgba(var(--oruga-black),.1),0 0 0 1px rgba(var(--oruga-black),.1));max-width:100%;position:relative;display:block}.o-table__wrapper--mobile tr td{border:0;display:inherit}.o-table__wrapper--mobile tr td:last-child{border-bottom:0}.o-table__wrapper--mobile tr:not(:last-child){margin:var(--oruga-table-card-margin,0 0 1rem 0)}.o-table__wrapper--mobile tr:not(.o-table__tr--selected){background:inherit;background:#fff}.o-table__wrapper--mobile tr:not(.o-table__tr--selected):hover{background-color:inherit;background-color:#fff}.o-table__wrapper--mobile tr.o-table--detailed{margin:var(--oruga-table-card-detail-margin,-1rem 0 0 0)}.o-table__wrapper--mobile tr:not(.o-table--detailed):not(.o-table--empty):not(.o-table__footer) td{display:flex;width:auto;justify-content:space-between;text-align:right;border-bottom:var(--oruga-table-background,#f5f5f5 1px solid)}.o-table__wrapper--mobile tr:not(.o-table--detailed):not(.o-table--empty):not(.o-table__footer) td:before{content:attr(data-label);font-weight:var(--oruga-table-card-cell-font-weight,600);padding-right:var(--oruga-table-card-cell-padding,0 .5em 0 0);text-align:var(--oruga-table-card-cell-text-align,left)}.o-table__mobile-sort{display:none}.o-table__th{vertical-align:top;text-align:left;position:relative;font-weight:var(--oruga-table-th-font-weight,600);color:var(--oruga-table-th-color,#363636);border-bottom:var(--oruga-table-th-border,2px solid var(--oruga-grey-lighter));padding:var(--oruga-table-th-padding,.5em .75em)}.o-table__th--centered{text-align:center}.o-table__th--right{text-align:right}.o-table__th__sort-icon{position:absolute;right:0}.o-table__th-checkbox{width:var(--oruga-table-th-checkbox-width,40px)}.o-table__th-current-sort{border-color:var(--oruga-table-current-sort-border-color,var(--oruga-grey));font-weight:var(--oruga-table-current-sort-font-weight,700)}.o-table__th--sortable{cursor:pointer}.o-table__th--sortable:hover{border-color:var(--oruga-table-current-sort-hover-border-color,var(--oruga-grey))}.o-table__th--sticky{position:-webkit-sticky;position:sticky;left:0;top:0;z-index:var(--oruga-table-sticky-zindex,1);background:var(--oruga-table-background-color,#fff)}.o-table__th--unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.o-table__th--detailed{width:var(--oruga-table-th-detail-width,14px)}.o-table__td{vertical-align:top;text-align:left;border-bottom:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter));padding:var(--oruga-table-td-padding,.5em .75em)}.o-table__td--sticky{position:-webkit-sticky;position:sticky;left:0;z-index:var(--oruga-table-sticky-zindex,1);background:var(--oruga-table-background-color,#fff)}.o-table__td--right{text-align:right}.o-table__td--centered{text-align:center}.o-table__td-chevron{vertical-align:middle;width:var(--oruga-table-detail-chevron-width,40px);color:var(--oruga-table-detail-chevron-color,var(--oruga-primary))}.o-table:focus{border-color:var(--oruga-table-focus-border-color,var(--oruga-primary));box-shadow:var(--oruga-table-focus-box-shadow,0 0 0 .125em rgba(var(--oruga-primary),.25))}.o-table--bordered tr:last-child td,.o-table--bordered tr:last-child th{border:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter))}.o-table--bordered td,.o-table--bordered th{border:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter))}.o-table--striped tbody tr:not(.o-table__tr--selected):nth-child(2n){background-color:var(--oruga-table-striped-background-color,#fafafa)}.o-table--narrowed td,.o-table--narrowed th{padding:var(--oruga-table-narrow-padding,.25em .5em)}.o-table--hoverable tbody tr:not(.o-table__tr--selected):hover{background-color:var(--oruga-table-hoverable-background-color,#fafafa)}.o-table__detail{box-shadow:var(--oruga-table-detail-box-shadow,inset 0 1px 3px var(--oruga-grey));background:var(--oruga-table-detail-background,#fafafa)}.o-table__detail td{padding:var(--oruga-table-detail-padding,1rem)}.o-table__tr--selected{background-color:var(--oruga-primary);color:var(--oruga-primary-invert)}.o-table__tr--selected-primary{background-color:#445e00;color:#fff}.o-table__tr--selected-secondary{background-color:#6c757d;color:#fff}.o-table__tr--selected-success{background-color:#006724;color:#fff}.o-table__tr--selected-info{background-color:#005c98;color:#fff}.o-table__tr--selected-warning{background-color:#f4c300;color:#000}.o-table__tr--selected-danger{background-color:#b60000;color:#fff}.o-table__pagination{align-items:center;justify-content:space-between;display:flex}.o-table__pagination>div{flex-basis:auto;flex-grow:0;flex-shrink:0}.o-table__pagination>div:first-child{align-items:center;justify-content:flex-start}.o-table__pagination>div:last-child{align-items:center;justify-content:flex-end}.o-table__pagination>div:last-child>div{align-items:center;display:flex;flex-basis:auto;flex-grow:0;flex-shrink:0;justify-content:center}.o-tabs--fullwidth{width:100%}.o-tabs--fullwidth .o-tabs__nav-item-wrapper{flex-grow:1;flex-shrink:0}.o-tabs--fullwidth .o-tabs__nav-item-boxed,.o-tabs--fullwidth .o-tabs__nav-item-default,.o-tabs--fullwidth .o-tabs__nav-item-toggle{height:100%}.o-tabs--vertical{display:flex;flex-direction:row}.o-tabs--vertical .o-tabs__nav{flex-direction:column;align-items:stretch;flex-grow:0;border-bottom:none}.o-tabs--vertical .o-tabs__nav-item-default{border-radius:0}.o-tabs--vertical .o-tabs__nav-item-boxed{border-bottom-color:transparent;border-right-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-radius:var(--oruga-tabs-border-bottom-color,var(--oruga-base-border-radius) 0 0 var(--oruga-base-border-radius))}.o-tabs--vertical .o-tabs__nav-item-boxed--active{border-right-color:transparent;border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter))}.o-tabs--right{flex-direction:row-reverse}.o-tabs--right .o-tabs__nav-item-boxed{border-bottom-color:transparent;border-right-color:transparent;border-left-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-radius:var(--oruga-tabs-border-bottom-color,0 var(--oruga-base-border-radius) var(--oruga-base-border-radius) 0)}.o-tabs--right .o-tabs__nav-item-boxed--active{border-left-color:transparent;border-right-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter))}.o-tabs__nav{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0;padding:0;align-items:center;display:flex;flex-grow:1;flex-shrink:0;justify-content:flex-start;padding-bottom:var(--oruga-tabs-border-bottom-width,1px);font-size:var(--oruga-tabs-font-size, var(--oruga-base-font-size))}.o-tabs__nav--small{font-size:var(--oruga-tabs-font-size-small, .75rem)}.o-tabs__nav--medium{font-size:var(--oruga-tabs-font-size-medium, 1.25rem)}.o-tabs__nav--large{font-size:var(--oruga-tabs-font-size-large, 1.5rem)}.o-tabs__nav--centered{justify-content:center}.o-tabs__nav--right{justify-content:flex-end}.o-tabs__nav-item{-moz-appearance:none;-webkit-appearance:none;width:100%;margin:0 0 -1px;border:1px solid transparent;background-color:transparent;align-items:center;line-height:var(--oruga-base-line-height);display:flex;justify-content:center;vertical-align:top;cursor:pointer;text-decoration:none;font-size:var(--oruga-tabs-font-size, var(--oruga-base-font-size));border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-bottom-style:var(--oruga-tabs-border-bottom-style,solid);border-bottom-width:var(--oruga-tabs-border-bottom-width,1px);color:var(--oruga-tabs-link-color,#494949);padding:var(--oruga-tabs-link-padding,.5em 1em)}.o-tabs__nav-item-icon{margin-right:var(--oruga-tabs-icon-margin,.5em)}.o-tabs__nav-item:focus,.o-tabs__nav-item:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0;border-radius:var(--oruga-base-border-radius)}.o-tabs__nav-item-default--active{border-bottom-color:var(--oruga-tabs-link-active-border-bottom-color,var(--oruga-primary));color:var(--oruga-tabs-link-active-color,var(--oruga-primary))}.o-tabs__nav-item-default--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-default:hover:not(.o-tabs__nav-item-default--active){background-color:var(--oruga-tabs-link-hover-background-color,#f4f4f4);border-bottom-color:var(--oruga-tabs-link-hover-border-bottom-color,#dbdbdb)}.o-tabs__nav-item-boxed{border-radius:var(--oruga-tabs-border-bottom-color,var(--oruga-base-border-radius) var(--oruga-base-border-radius) 0 0)}.o-tabs__nav-item-boxed--active{color:var(--oruga-tabs-link-active-color,var(--oruga-primary));background-color:var(--oruga-tabs-boxed-link-active-background-color,#fff);border-color:var(--oruga-tabs-boxed-link-active-border-color,#dbdbdb);border-bottom-color:var(--oruga-tabs-boxed-link-active-border-bottom-color,transparent)}.o-tabs__nav-item-boxed--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-boxed:hover:not(.o-tabs__nav-item-boxed--active){background-color:var(--oruga-tabs-boxed-link-hover-background-color,#f4f4f4)}.o-tabs__nav-item-toggle{border-color:var(--oruga-tabs-toggle-link-border-color,#dbdbdb);border-style:var(--oruga-tabs-toggle-link-border-style,solid);border-width:var(--oruga-tabs-toggle-link-border-width,1px)}.o-tabs__nav-item-toggle--active{background-color:var(--oruga-tabs-toggle-link-active-background-color,var(--oruga-primary));border-color:var(--oruga-tabs-toggle-link-active-border-color,var(--oruga-primary));color:var(--oruga-tabs-toggle-link-active-color,var(--oruga-primary-invert))}.o-tabs__nav-item-toggle--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-toggle:hover:not(.o-tabs__nav-item-toggle--active){background-color:var(--oruga-tabs-toggle-link-hover-background-color,#f4f4f4);border-color:var(--oruga-tabs-toggle-link-hover-border-color,#b5b5b5)}.o-tabs__nav-item-pills{border-radius:var(--oruga-tabs-boxed-link-radius,var(--oruga-base-border-radius));border-color:transparent}.o-tabs__nav-item-pills--active{background-color:var(--oruga-tabs-toggle-link-active-background-color,var(--oruga-primary));color:var(--oruga-tabs-toggle-link-active-color,var(--oruga-primary-invert))}.o-tabs__content{position:relative;overflow:visible;display:flex;flex-direction:column;flex-grow:1;padding:var(--oruga-tabs-content-padding,1rem)}.o-tabs__content--transitioning{overflow:hidden}.o-tabs:not(:last-child){margin-bottom:var(--oruga-tabs-margin-bottom,1.5rem)}.o-taginput{display:flex}.o-taginput__container{display:flex;flex-wrap:wrap;box-shadow:var(--oruga-input-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-input-background-color,#fff);border-color:var(--oruga-input-border-color,var(--oruga-grey-lighter));border-style:var(--oruga-input-border-style,solid);border-width:var(--oruga-input-border-width,1px);border-radius:var(--oruga-input-border-radius,var(--oruga-base-border-radius));color:var(--oruga-input-color,#363636);font-size:var(--oruga-base-font-size, 1rem);line-height:var(--oruga-input-line-height, var(--oruga-base-line-height));margin:var(--oruga-input-margin,0);width:var(--oruga-taginput-width,inherit)}.o-taginput__container--small{font-size:var(--oruga-taginput-font-size-small, .75rem)}.o-taginput__container--medium{font-size:var(--oruga-taginput-font-size-medium, 1.25rem)}.o-taginput__container--large{font-size:var(--oruga-taginput-font-size-large, 1.5rem)}.o-taginput__autocomplete{flex-grow:1;flex-shrink:1;width:auto}.o-taginput__input{border:none;box-shadow:none;width:100%}.o-taginput__item{display:inline-flex;margin:var(--oruga-taginput-item-margin,.275em);padding:var(--oruga-taginput-item-padding,0 .75em 0 .75em);color:var(--oruga-taginput-item-color,var(--oruga-primary-invert));background-color:var(--oruga-taginput-item-background-color,var(--oruga-primary));border-radius:var(--oruga-taginput-item-border-radius,var(--oruga-base-border-radius))}.o-taginput__item--primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-taginput__item--secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-taginput__item--success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-taginput__item--info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-taginput__item--warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-taginput__item--danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-taginput__item:focus,.o-taginput__item:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0}.o-taginput__counter{display:block;float:right;font-size:var(--oruga-taginput-counter-font-size, .75rem);margin:var(--oruga-taginput-counter-margin,.25rem 0 0 .5rem)}.o-taginput--expanded{width:100%;flex-grow:1;flex-shrink:1}.o-tpck{font-size:var(--oruga-timepicker-font-size, var(--oruga-base-font-size))}.o-tpck--small{font-size:var(--oruga-timepicker-font-size-small, .75rem)}.o-tpck--medium{font-size:var(--oruga-timepicker-font-size-medium, 1.25rem)}.o-tpck--large{font-size:var(--oruga-timepicker-font-size-large, 1.5rem)}.o-tpck__dropdown{width:100%}.o-tpck__box{display:flex;justify-content:center;align-items:center;line-height:var(--oruga-timepicker-box-line-height, var(--oruga-base-line-height));padding:var(--oruga-timepicker-box-padding,.375rem 1rem)}.o-tpck__select{-moz-appearance:none;-webkit-appearance:none;display:inline-block;position:relative;vertical-align:top;cursor:pointer;justify-content:flex-start;align-items:center;border:0;font-size:inherit;font-weight:var(--oruga-timepicker-select-font-weight,600);line-height:var(--oruga-timepicker-select-line-height, var(--oruga-base-line-height));color:var(--oruga-timepicker-select-color,#363636);padding:var(--oruga-timepicker-select-padding, calc(.375em - 1px) calc(.625em - 1px) )}.o-tpck__select-placeholder{opacity:var(--oruga-timepicker-select-placeholder-opacity, var(--oruga-base-disabled-opacity))}.o-tpck__separator{font-weight:var(--oruga-timepicker-separator-font-weight,600)}.o-tpck__footer{padding:var(--oruga-timepicker-header-padding,0 .5rem);margin:var(--oruga-timepicker-header-margin,.875rem 0 0 0)}.o-tip{position:relative;display:inline-flex}.o-tip__arrow{position:absolute;content:"";pointer-events:none;z-index:var(--oruga-tooltip-content-zindex,38);color:var(--oruga-tooltip-background-color,var(--oruga-primary))}.o-tip__arrow--primary{color:var(--oruga-variant-primary,#445e00)}.o-tip__arrow--secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-tip__arrow--success{color:var(--oruga-variant-success,#006724)}.o-tip__arrow--info{color:var(--oruga-variant-info,#005c98)}.o-tip__arrow--warning{color:var(--oruga-variant-warning,#f4c300)}.o-tip__arrow--danger{color:var(--oruga-variant-danger,#b60000)}.o-tip__arrow--bottom{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--top{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--left{top:50%;right:auto;bottom:auto;left:100%;transform:translateY(-50%);border-left-style:solid;border-top-style:solid;border-top-color:transparent;border-bottom-style:solid;border-bottom-color:transparent;border-left-width:var(--oruga-tooltip-arrow-size,5px);border-top-width:var(--oruga-tooltip-arrow-size,5px);border-bottom-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--right{top:50%;right:100%;bottom:auto;left:auto;transform:translateY(-50%);border-right-style:solid;border-top-style:solid;border-top-color:transparent;border-bottom-style:solid;border-bottom-color:transparent;border-right-width:var(--oruga-tooltip-arrow-size,5px);border-top-width:var(--oruga-tooltip-arrow-size,5px);border-bottom-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--top-right{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-left-width:0}.o-tip__arrow--top-left{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-right-width:0}.o-tip__arrow--bottom-left{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-right-width:0}.o-tip__arrow--bottom-right{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-left-width:0}.o-tip__content{position:absolute;white-space:nowrap;max-width:var(--oruga-tooltip-content-max-width,300px);padding:var(--oruga-tooltip-content-padding,.35rem .75rem);border-radius:var(--oruga-tooltip-content-radius-large,6px);font-size:var(--oruga-tooltip-content-font-size, .85rem);font-weight:var(--oruga-tooltip-content-weight-normal,400);box-shadow:var(--oruga-tooltip-content-box-shadow,0 1px 2px 1px rgba(0,1,0,.2));z-index:var(--oruga-tooltip-content-zindex,38);background-color:var(--oruga-tooltip-background-color,var(--oruga-primary));color:var(--oruga-tooltip-color,var(--oruga-primary-invert))}.o-tip__content--primary{background:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-tip__content--secondary{background:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-tip__content--success{background:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-tip__content--info{background:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-tip__content--warning{background:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-tip__content--danger{background:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-tip__content--top{top:auto;right:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);left:50%;transform:translate(-50%)}.o-tip__content--bottom{top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);right:auto;bottom:auto;left:50%;transform:translate(-50%)}.o-tip__content--right{top:50%;right:auto;bottom:auto;left:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translateY(-50%)}.o-tip__content--left{top:50%;right:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);bottom:auto;left:auto;transform:translateY(-50%)}.o-tip__content--top-right{left:auto;top:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(50%)}.o-tip__content--top-left{right:auto;top:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(-50%)}.o-tip__content--bottom-right{left:auto;bottom:auto;top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(50%)}.o-tip__content--bottom-left{left:auto;bottom:auto;top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(-50%)}.o-tip__content--always{opacity:1;visibility:visible}.o-tip__content--multiline{text-align:center;white-space:normal;width:var(--oruga-tooltip-content-multiline-width,300px)}.o-tip--teleport .o-tip__content--top,.o-tip--teleport .o-tip__content--top-left,.o-tip--teleport .o-tip__content--top-right{margin-top:calc(-1 * (var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px)))}.o-tip--teleport .o-tip__content--bottom,.o-tip--teleport .o-tip__content--bottom-left,.o-tip--teleport .o-tip__content--bottom-right{margin-top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px))}.o-tip--teleport .o-tip__content--right{margin-left:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px))}.o-tip--teleport .o-tip__content--left{margin-left:calc(-1 * (var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px)))}.o-tip__trigger{width:100%}.o-upl{position:relative;display:inline-flex}.o-upl--disabled{opacity:var(--oruga-upload-draggable-disabled-opacity, var(--oruga-base-disabled-opacity));cursor:not-allowed}.o-upl--expanded{width:100%}.o-upl__draggable{cursor:pointer;width:100%;padding:var(--oruga-upload-draggable-padding,.25em);border:var(--oruga-upload-draggable-border,1px dashed var(--oruga-grey-light));border-radius:var(--oruga-upload-draggable-border-radius,var(--oruga-base-border-radius))}.o-upl__draggable--hovered{border-color:var(--oruga-upload-draggable-hover-border-color,var(--oruga-grey))}.o-upl__draggable--hovered-primary{border-color:var(--oruga-variant-primary,#445e00)}.o-upl__draggable--hovered-secondary{border-color:var(--oruga-variant-secondary,#6c757d)}.o-upl__draggable--hovered-success{border-color:var(--oruga-variant-success,#006724)}.o-upl__draggable--hovered-info{border-color:var(--oruga-variant-info,#005c98)}.o-upl__draggable--hovered-warning{border-color:var(--oruga-variant-warning,#f4c300)}.o-upl__draggable--hovered-danger{border-color:var(--oruga-variant-danger,#b60000)}.o-upl input[type=file]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:-1} +:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.3;font-weight:400;color-scheme:light;color:#213547;background-color:#444;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#747bff}body{margin:0;display:flex;min-width:320px}h1{margin:0;padding:0;font-size:3.2em;line-height:1.1}button{border:1px solid #cccccc44;padding:.25em .75em;font-size:.9em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s;background-color:#f9f9f9}button:hover{border-color:#646cff}#app{max-width:1280px}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:#0006;color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}.time-slider[data-v-04bdd2c0]{position:relative;background-color:#fff;display:flex;flex-direction:row;border:2px solid #4972e2;opacity:.9;height:5rem;-webkit-user-select:none;user-select:none}#dailybar[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;z-index:3;padding:4px}.labels[data-v-04bdd2c0]{font-size:.7rem;display:flex;flex-direction:row;line-height:.7rem;position:relative;width:100%;height:.6rem}.bars[data-v-04bdd2c0]{display:flex;flex-direction:row;flex:1}.week[data-v-04bdd2c0]{flex:1;background-color:#e24986;margin-right:1px;margin-top:auto;padding-bottom:1px}#dragthumb[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;left:0;background-color:#8ad2f9;z-index:5;color:#000;opacity:.6;display:flex;flex-direction:row;border-radius:5px}#dragthumb[data-v-04bdd2c0]:active,#dragthumb[data-v-04bdd2c0]:hover{background-color:#0cf;cursor:grab;transition:background-color .2s,border-color .2s;opacity:.7}#dragleftie[data-v-04bdd2c0],#dragrightie[data-v-04bdd2c0]{margin:0 auto 0 0;width:4px;background-color:#218f3a;opacity:0;z-index:10}#dragthumb:hover #dragleftie[data-v-04bdd2c0],#dragthumb:hover #dragrightie[data-v-04bdd2c0]{transition:opacity .2s;opacity:1;cursor:ew-resize}#dragleftie[data-v-04bdd2c0]{border-top-left-radius:5px;border-bottom-left-radius:5px}#dragrightie[data-v-04bdd2c0]{margin:0 0 0 auto;border-top-right-radius:5px;border-bottom-right-radius:5px}.date-label[data-v-04bdd2c0]{position:absolute;top:0;bottom:0;height:2rem}:where([data-v-b57c8331]:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}[data-v-b57c8331],[data-v-b57c8331]:before,[data-v-b57c8331]:after{box-sizing:border-box}html[data-v-b57c8331]{-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none}a[data-v-b57c8331],button[data-v-b57c8331]{cursor:revert}ol[data-v-b57c8331],ul[data-v-b57c8331],menu[data-v-b57c8331],summary[data-v-b57c8331]{list-style:none}ol[data-v-b57c8331]{counter-reset:revert}img[data-v-b57c8331]{max-inline-size:100%;max-block-size:100%}table[data-v-b57c8331]{border-collapse:collapse}input[data-v-b57c8331],textarea[data-v-b57c8331]{-webkit-user-select:auto}textarea[data-v-b57c8331]{white-space:revert}meter[data-v-b57c8331]{-webkit-appearance:revert;-moz-appearance:revert;appearance:revert}:where(pre[data-v-b57c8331]){all:revert;box-sizing:border-box}[data-v-b57c8331]::placeholder{color:unset}:where([hidden][data-v-b57c8331]){display:none}:where([contenteditable][data-v-b57c8331]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true][data-v-b57c8331]){-webkit-user-drag:element}:where(dialog[data-v-b57c8331]:modal){all:revert;box-sizing:border-box}[data-v-b57c8331]::-webkit-details-marker{display:none}html[data-v-b57c8331]{box-sizing:border-box}[data-v-b57c8331],[data-v-b57c8331]:before,[data-v-b57c8331]:after{box-sizing:inherit}body[data-v-b57c8331],html[data-v-b57c8331]{height:100%;overscroll-behavior:contain}html[data-v-b57c8331]{overflow-y:auto;color:var(--text)}b[data-v-b57c8331]{font-weight:700}.app[data-v-b57c8331]{position:absolute;top:0;bottom:0;left:0;right:0;margin:.5rem;padding:.5rem;background-color:#316386;display:grid;grid-template-rows:auto 1fr auto auto;grid-template-columns:1fr}.button-row[data-v-b57c8331]{grid-row:1/2;grid-column:1/2;display:flex;flex-direction:row;margin-bottom:.5rem;color:#fff}.button-row p[data-v-b57c8331]{font-size:1.1rem}.flex-row[data-v-b57c8331]{display:flex;flex-direction:row}.flex-col[data-v-b57c8331]{display:flex;flex-direction:column}.flex1[data-v-b57c8331]{flex:1}.max-content[data-v-b57c8331]{width:max-content}#mymap[data-v-b57c8331]{flex:1;width:100%;grid-row:2/4;grid-column:1/2}button[data-v-b57c8331]{width:4rem;text-align:center}button.isActive[data-v-b57c8331]{background-color:#457ec0;color:#fff;border-radius:0}.time-slider[data-v-b57c8331]{grid-column:1/2;grid-row:3/4;z-index:2;margin:1rem 1rem 2.75rem}/*! Oruga v0.4.2 | MIT License | github.com/oruga-ui/oruga */@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fadeOut{animation-name:fadeOut}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;transform:translate3d(0,100%,0)}}.fadeOutDown{animation-name:fadeOutDown}@keyframes fadeOutUp{0%{opacity:1}to{opacity:0;transform:translate3d(0,-100%,0)}}.fadeOutUp{animation-name:fadeOutUp}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fadeIn{animation-name:fadeIn}@keyframes fadeInDown{0%{opacity:0;transform:translate3d(0,-100%,0)}to{opacity:1;transform:none}}.fadeInDown{animation-name:fadeInDown}@keyframes fadeInUp{0%{opacity:0;transform:translate3d(0,100%,0)}to{opacity:1;transform:none}}.fadeInUp{animation-name:fadeInUp}@keyframes append-animate{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.fade-enter-active,.fade-leave-active{transition:opacity .15s ease-out}.fade-enter,.fade-enter-from,.fade-leave-to{opacity:0}.zoom-in-enter-active,.zoom-in-leave-active{transition:opacity .15s ease-out}.zoom-in-enter-active .animation-content,.zoom-in-leave-active .animation-content{transition:transform .15s ease-out}.zoom-in-enter,.zoom-in-enter-from,.zoom-in-leave-active{opacity:0}.zoom-in-enter .animation-content,.zoom-in-enter-from .animation-content,.zoom-in-leave-active .animation-content{transform:scale(.95)}.zoom-out-enter-active,.zoom-out-leave-active{transition:opacity .15s ease-out}.zoom-out-enter-active .animation-content,.zoom-out-leave-active .animation-content{transition:transform .15s ease-out}.zoom-out-enter,.zoom-out-enter-from,.zoom-out-leave-active{opacity:0}.zoom-out-enter .animation-content,.zoom-out-enter-from .animation-content,.zoom-out-leave-active .animation-content{transform:scale(1.05)}.slide-next-enter-active,.slide-next-leave-active,.slide-prev-enter-active,.slide-prev-leave-active{transition:transform .3s cubic-bezier(.785,.135,.15,.86)}.slide-next-enter,.slide-next-enter-from,.slide-prev-leave-to{transform:translate3d(-100%,0,0);position:absolute;width:100%}.slide-next-leave-to,.slide-prev-enter,.slide-prev-enter-from{transform:translate3d(100%,0,0);position:absolute;width:100%}.slide-down-enter-active,.slide-down-leave-active,.slide-up-enter-active,.slide-up-leave-active{transition:transform .3s cubic-bezier(.785,.135,.15,.86)}.slide-down-enter,.slide-down-enter-from,.slide-up-leave-to{transform:translate3d(0,-100%,0);position:absolute;height:100%}.slide-down-leave-to,.slide-up-enter,.slide-up-enter-from{transform:translate3d(0,100%,0);position:absolute;height:100%}.slide-enter-active{transition:.15s ease-out}.slide-leave-active{transition:.15s ease-out;transition-timing-function:cubic-bezier(0,1,.5,1)}.slide-enter-to,.slide-leave,.slide-leave-from{max-height:100px;overflow:hidden}.slide-enter,.slide-enter-from,.slide-leave-to{overflow:hidden;max-height:0}:root{--oruga-primary:#445e00;--oruga-primary-invert:#ffffff;--oruga-secondary:#6c757d;--oruga-secondary-invert:#ffffff;--oruga-success:#006724;--oruga-success-invert:#ffffff;--oruga-info:#005c98;--oruga-info-invert:#ffffff;--oruga-warning:#f4c300;--oruga-warning-invert:#000000;--oruga-danger:#b60000;--oruga-danger-invert:#ffffff;--oruga-white:#ffffff;--oruga-black:#000000;--oruga-grey:#7a7a7a;--oruga-grey-light:#b5b5b5;--oruga-grey-lighter:#dbdbdb;--oruga-grey-dark:#4a4a4a;--oruga-focus:rgba(68, 94, 0, .25);--oruga-size-small:.75rem;--oruga-size-medium:1.25rem;--oruga-size-large:1.5rem;--oruga-base-font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif;--oruga-base-font-size:1rem;--oruga-base-font-weight:400;--oruga-base-border-radius:4px;--oruga-base-border-radius-rounded:9999px;--oruga-base-line-height:1.5;--oruga-base-disabled-opacity:.5;--oruga-transition-duration:.15s;--oruga-transition-timing:ease-out}*,:after,:before{box-sizing:inherit}html{box-sizing:border-box}body{margin:0;padding:0;font-family:var(--oruga-base-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-base-font-weight,400);line-height:var(--oruga-base-line-height, 1.5)}.o-noscroll{position:fixed;width:100%;bottom:0;overflow-x:hidden;overflow-y:scroll}.o-clipped{overflow:hidden}.o-acp__item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.o-acp__item--hover{background-color:var(--oruga-autocomplete-item-hover-background-color,#f5f5f5)}@keyframes spinAround{0%{transform:rotate(0)}to{transform:rotate(359deg)}}.o-btn{position:relative;display:inline-flex;cursor:pointer;text-align:center;white-space:nowrap;align-items:center;justify-content:center;vertical-align:top;text-decoration:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-color,var(--oruga-primary-invert));padding:var(--oruga-button-padding, calc(.375em - 1px) .75em);border:var(--oruga-button-border,1px solid var(--oruga-primary));border-radius:var(--oruga-button-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-button-box-shadow,none);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-button-font-weight,400);line-height:var(--oruga-button-line-height, var(--oruga-base-line-height));margin:var(--oruga-button-margin,0);height:var(--oruga-button-height,2.25em)}.o-btn__wrapper{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;margin-left:-.1875em;margin-right:-.1875em}.o-btn__wrapper>*{margin-left:.1875em;margin-right:.1875em}.o-btn__label,.o-btn--expanded{width:100%}.o-btn--rounded{border-radius:var(--oruga-button-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-btn--disabled{opacity:var(--oruga-button-disabled-opacity, var(--oruga-base-disabled-opacity));cursor:not-allowed;pointer-events:none}.o-btn--small{font-size:var(--oruga-button-font-size-small, .75rem)}.o-btn--medium{font-size:var(--oruga-button-font-size-medium, 1.25rem)}.o-btn--large{font-size:var(--oruga-button-font-size-large, 1.5rem)}.o-btn--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-btn--primary:hover{filter:brightness(97.5%)}.o-btn--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-btn--secondary:hover{filter:brightness(97.5%)}.o-btn--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-btn--success:hover{filter:brightness(97.5%)}.o-btn--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-btn--info:hover{filter:brightness(97.5%)}.o-btn--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-btn--warning:hover{filter:brightness(97.5%)}.o-btn--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-btn--danger:hover{filter:brightness(97.5%)}.o-btn--outlined{background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-background-color,var(--oruga-primary))}.o-btn--outlined:hover{border-color:transparent;background-color:var(--oruga-button-background-color,var(--oruga-primary));color:var(--oruga-button-color,var(--oruga-primary-invert))}.o-btn--outlined-primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-primary,#445e00)}.o-btn--outlined-primary:focus,.o-btn--outlined-primary:hover{border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-btn--outlined-secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-secondary,#6c757d)}.o-btn--outlined-secondary:focus,.o-btn--outlined-secondary:hover{border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-btn--outlined-success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-success,#006724)}.o-btn--outlined-success:focus,.o-btn--outlined-success:hover{border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-btn--outlined-info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-info,#005c98)}.o-btn--outlined-info:focus,.o-btn--outlined-info:hover{border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-btn--outlined-warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-warning,#f4c300)}.o-btn--outlined-warning:focus,.o-btn--outlined-warning:hover{border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-btn--outlined-danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-button-outlined-background-color,transparent);border-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-danger,#b60000)}.o-btn--outlined-danger:focus,.o-btn--outlined-danger:hover{border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-btn--loading{color:transparent!important;pointer-events:none}.o-btn--loading:after{-webkit-animation:spinAround .5s infinite linear;left:calc(50% - .5em);top:calc(50% - .5em);position:absolute!important;border:2px solid #dbdbdb;border-radius:9999px;border-right-color:transparent;border-top-color:transparent;content:"";display:block;height:1em;width:1em}.o-btn--inverted{background-color:var(--oruga-button-color,var(--oruga-primary-invert));border-color:var(--oruga-button-color,var(--oruga-primary-invert));color:var(--oruga-button-background-color,var(--oruga-primary))}.o-btn--inverted:hover{filter:brightness(95%)}.o-btn--inverted-primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-variant-invert-primary,#fff);border-color:var(--oruga-variant-invert-primary,#fff);color:var(--oruga-variant-primary,#445e00)}.o-btn--inverted-primary:focus,.o-btn--inverted-primary:hover{filter:brightness(95%)}.o-btn--inverted-secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-variant-invert-secondary,#fff);border-color:var(--oruga-variant-invert-secondary,#fff);color:var(--oruga-variant-secondary,#6c757d)}.o-btn--inverted-secondary:focus,.o-btn--inverted-secondary:hover{filter:brightness(95%)}.o-btn--inverted-success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-variant-invert-success,#fff);border-color:var(--oruga-variant-invert-success,#fff);color:var(--oruga-variant-success,#006724)}.o-btn--inverted-success:focus,.o-btn--inverted-success:hover{filter:brightness(95%)}.o-btn--inverted-info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-variant-invert-info,#fff);border-color:var(--oruga-variant-invert-info,#fff);color:var(--oruga-variant-info,#005c98)}.o-btn--inverted-info:focus,.o-btn--inverted-info:hover{filter:brightness(95%)}.o-btn--inverted-warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-variant-invert-warning,#000);border-color:var(--oruga-variant-invert-warning,#000);color:var(--oruga-variant-warning,#f4c300)}.o-btn--inverted-warning:focus,.o-btn--inverted-warning:hover{filter:brightness(95%)}.o-btn--inverted-danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-variant-invert-danger,#fff);border-color:var(--oruga-variant-invert-danger,#fff);color:var(--oruga-variant-danger,#b60000)}.o-btn--inverted-danger:focus,.o-btn--inverted-danger:hover{filter:brightness(95%)}.o-btn:focus,.o-btn:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0}.o-car{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;overflow:hidden;width:100%}.o-car__overlay{bottom:0;left:0;right:0;top:0;align-items:center;flex-direction:column;justify-content:center;display:flex;max-height:100vh;position:fixed;background-color:var(--oruga-carousel-overlay-background,hsla(0,0%,4%,.86));z-index:var(--oruga-carousel-overlay-zindex,40)}.o-car__wrapper{position:relative;width:100%}.o-car__items{display:flex;width:100%}.o-car__items:not(.o-car__items--dragging){transition:var(--oruga-carousel-items-transition, all var(--oruga-transition-duration) var(--oruga-transition-timing) 0s)}.o-car__item{border:var(--oruga-carousel-item-border,2px solid transparent);flex-shrink:0}.o-car__item--clickable{cursor:pointer}.o-car__indicators{width:100%;display:flex;align-items:center;justify-content:center;padding:var(--oruga-carousel-indicators-padding,.5rem);background:var(--oruga-carousel-indicators-background,rgba(var(--oruga-white),.5))}.o-car__indicators--inside{position:absolute}.o-car__indicators--inside--bottom{bottom:0}.o-car__indicators--inside--top{top:0}.o-car__indicator:not(:last-child){margin:var(--oruga-carousel-indicator-margin,0 .5rem 0 0)}.o-car__indicator__item{display:block;border:var(--oruga-carousel-indicator-border,1px solid var(--oruga-primary));background:var(--oruga-carousel-indicator-background,var(--oruga-white));transition:var(--oruga-carousel-indicator-transition, var(--oruga-transition-duration) var(--oruga-transition-timing))}.o-car__indicator__item :hover,.o-car__indicator__item--active{background:var(--oruga-carousel-indicator-active-background,var(--oruga-primary));border:var(--oruga-carousel-indicator-active-border,1px solid var(--oruga-primary))}.o-car__indicator__item--boxes{width:var(--oruga-carousel-indicator-size,10px);height:var(--oruga-carousel-indicator-size,10px)}.o-car__indicator__item--dots{border-radius:var(--oruga-carousel-indicator-dots-border-radius,var(--oruga-base-border-radius));width:var(--oruga-carousel-indicator-size,10px);height:var(--oruga-carousel-indicator-size,10px)}.o-car__indicator__item--lines{width:var(--oruga-carousel-indicator-lines-width,25px);height:var(--oruga-carousel-indicator-lines-height,5px)}.o-car__arrow__icon{cursor:pointer;background:var(--oruga-carousel-arrow-background,var(--oruga-white));color:var(--oruga-carousel-arrow-color,var(--oruga-primary));width:var(--oruga-carousel-arrow-size,1.5rem);height:var(--oruga-carousel-arrow-size,1.5rem);border-radius:var(--oruga-carousel-arrow-border-radius,var(--oruga-base-border-radius-rounded));border:var(--oruga-carousel-arrow-border,1px solid var(--oruga-white));transition:var(--oruga-carousel-arrow-transition, var(--oruga-transition-duration) var(--oruga-transition-timing))}.o-car__arrow__icon-next,.o-car__arrow__icon-prev{position:absolute;top:var(--oruga-carousel-arrow-top,50%);transform:translateY(var(--oruga-carousel-arrow-top,-50%));z-index:1}.o-car__arrow__icon-prev{left:var(--oruga-carousel-arrow-icon-spaced,1.5rem)}.o-car__arrow__icon-next{right:var(--oruga-carousel-arrow-icon-spaced,1.5rem)}.o-chk{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-flex;align-items:center;cursor:pointer;position:relative;line-height:var(--oruga-checkbox-line-height, 1.5);margin-right:var(--oruga-checkbox-margin-sibiling,.5em)}.o-chk__input{width:var(--oruga-checkbox-size,1rem);height:var(--oruga-checkbox-size,1rem);margin:0;outline:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;flex-shrink:0;cursor:pointer;box-shadow:var(--oruga-checkbox-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-checkbox-background-color,var(--oruga-primary));background-position:center;background-size:contain;background-repeat:no-repeat;transition:background var(--oruga-transition-duration) var(--oruga-transition-timing);border-radius:var(--oruga-checkbox-border-radius,var(--oruga-base-border-radius));border-width:var(--oruga-checkbox-border-width,2px);border-color:var(--oruga-checkbox-border-color,var(--oruga-primary));border-style:var(--oruga-checkbox-border-style,solid)}.o-chk__input--checked{background-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));border-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk__input--indeterminate{background-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));border-color:var(--oruga-checkbox-active-background-color,var(--oruga-primary));background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk__label{padding:var(--oruga-checkbox-label-padding,0 0 0 .5em)}.o-chk--disabled{opacity:var(--oruga-checkbox-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-chk--small{font-size:var(--oruga-checkbox-font-size-small, .75rem)}.o-chk--small .o-chk__input{width:var(--oruga-checkbox-font-size-small,.75rem);height:var(--oruga-checkbox-font-size-small,.75rem)}.o-chk--medium{font-size:var(--oruga-checkbox-font-size-medium, 1.25rem)}.o-chk--medium .o-chk__input{width:var(--oruga-checkbox-font-size-medium,1.25rem);height:var(--oruga-checkbox-font-size-medium,1.25rem)}.o-chk--large{font-size:var(--oruga-checkbox-font-size-large, 1.5rem)}.o-chk--large .o-chk__input{width:var(--oruga-checkbox-font-size-large,1.5rem);height:var(--oruga-checkbox-font-size-large,1.5rem)}.o-chk--primary{--oruga-focus:rgba(68, 94, 0, .25)}.o-chk--primary .o-chk__input{border-color:var(--oruga-variant-primary,#445e00);background-color:var(--oruga-variant-primary,#445e00)}.o-chk--primary .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--primary .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--secondary{--oruga-focus:rgba(108, 117, 125, .25)}.o-chk--secondary .o-chk__input{border-color:var(--oruga-variant-secondary,#6c757d);background-color:var(--oruga-variant-secondary,#6c757d)}.o-chk--secondary .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--secondary .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--success{--oruga-focus:rgba(0, 103, 36, .25)}.o-chk--success .o-chk__input{border-color:var(--oruga-variant-success,#006724);background-color:var(--oruga-variant-success,#006724)}.o-chk--success .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--success .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--info{--oruga-focus:rgba(0, 92, 152, .25)}.o-chk--info .o-chk__input{border-color:var(--oruga-variant-info,#005c98);background-color:var(--oruga-variant-info,#005c98)}.o-chk--info .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--info .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--warning{--oruga-focus:rgba(244, 195, 0, .25)}.o-chk--warning .o-chk__input{border-color:var(--oruga-variant-warning,#f4c300);background-color:var(--oruga-variant-warning,#f4c300)}.o-chk--warning .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23000000' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--warning .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23000000' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--danger{--oruga-focus:rgba(182, 0, 0, .25)}.o-chk--danger .o-chk__input{border-color:var(--oruga-variant-danger,#b60000);background-color:var(--oruga-variant-danger,#b60000)}.o-chk--danger .o-chk__input--checked{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 234 225' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(3.13817,0,0,3.13817,-69.2796,-49.5156)'%3E%3Cpath style='fill:%23ffffff' d='M22.504,26.219L28.637,32.386L39.494,18.284L37.348,16.379L28,27.725L24.46,24.196L22.504,26.219Z'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk--danger .o-chk__input--indeterminate{background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 417 417' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg transform='matrix(4.16667,0,0,4.16667,0,0)'%3E%3Cg transform='matrix(6.96176,0,0,20.5682,-118.661,-806.753)'%3E%3Cpath style='fill:%23ffffff' d='M31.265,41.654C31.265,41.324 30.474,41.057 29.5,41.057L18.953,41.057C17.979,41.057 17.188,41.324 17.188,41.654C17.188,41.984 17.979,42.252 18.953,42.252L29.5,42.252C30.474,42.252 31.265,41.984 31.265,41.654Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}.o-chk:focus .o-chk__input,.o-chk:focus-within .o-chk__input{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-clps{width:100%}.o-clps__trigger{cursor:pointer;display:inline-block}.o-clps__content{display:inherit}.o-dpck{font-size:var(--oruga-datepicker-font-size, var(--oruga-base-font-size))}.o-dpck--small{font-size:var(--oruga-datepicker-font-size-small, .75rem)}.o-dpck--medium{font-size:var(--oruga-datepicker-font-size-medium, 1.25rem)}.o-dpck--large{font-size:var(--oruga-datepicker-font-size-large, 1.5rem)}.o-dpck__dropdown{width:100%}.o-dpck__box{--oruga-dropdown-item-line-height:var(--oruga-base-line-height);--oruga-dropdown-item-padding:.375rem 1rem}.o-dpck__header{padding:var(--oruga-datepicker-header-padding,0 0 .875rem 0);margin:var(--oruga-datepicker-header-margin,0 0 .875rem 0);border-bottom:var(--oruga-datepicker-header-border-bottom,1px solid var(--oruga-grey-lighter))}.o-dpck__header__buttons{align-items:center;display:flex;justify-content:center;text-align:center}.o-dpck__header__buttons--small{font-size:var(--oruga-datepicker-font-size-small, .75rem)}.o-dpck__header__buttons--medium{font-size:var(--oruga-datepicker-font-size-medium, 1.25rem)}.o-dpck__header__buttons--large{font-size:var(--oruga-datepicker-font-size-large, 1.5rem)}.o-dpck__header__previous{order:1}.o-dpck__header__next{order:3}.o-dpck__header__next,.o-dpck__header__previous{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;justify-content:center;text-align:center;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;align-items:center;box-shadow:none;display:inline-flex;position:relative;vertical-align:top;line-height:var(--oruga-datepicker-btn-line-height, var(--oruga-base-line-height));border:var(--oruga-datepicker-btn-border,1px solid transparent);border-radius:var(--oruga-datepicker-btn-border-radius,var(--oruga-base-border-radius));border-color:var(--oruga-datepicker-btn-border-color,var(--oruga-grey-lighter));color:var(--oruga-datepicker-btn-color,#363636);min-width:var(--oruga-datepicker-btn-min-width,2.25em);height:var(--oruga-datepicker-btn-height,2.25em);padding:var(--oruga-datepicker-btn-padding,.5em .5em);margin:var(--oruga-datepicker-btn-margin,.25rem)}.o-dpck__header__next:hover,.o-dpck__header__previous:hover{text-decoration:none;border-color:var(--oruga-datepicker-btn-hover-border-color,var(--oruga-grey-light));color:var(--oruga-datepicker-btn-hover-color,#363636)}.o-dpck__header__list{order:2;align-items:center;display:flex;justify-content:center;text-align:center;list-style:none;flex-wrap:wrap;margin:0;padding:0;margin-left:-.125rem;margin-right:-.125rem}.o-dpck__header__list>*{margin-left:.125rem;margin-right:.125rem}.o-dpck__footer{padding:var(--oruga-datepicker-header-padding,.875rem .5rem 0 .5rem);margin:var(--oruga-datepicker-header-margin,.875rem 0 .875rem 0);border-top:var(--oruga-datepicker-header-border-top,1px solid var(--oruga-grey-lighter))}.o-dpck__month,.o-dpck__table{display:table;margin:0 auto}.o-dpck__month__head,.o-dpck__table__head{display:table-header-group;padding:var(--oruga-datepicker-table-head-padding,0 0 .875rem 0);margin:var(--oruga-datepicker-table-head-margin,0 0 .875rem 0);border-bottom:var(--oruga-datepicker-table-head-border-bottom,1px solid var(--oruga-grey-lighter))}.o-dpck__month__body,.o-dpck__table__body{display:table-row-group}.o-dpck__month__row,.o-dpck__table__row{display:table-row}.o-dpck__month__head-cell,.o-dpck__table__head-cell{padding:var(--oruga-datepicker-table-head-item-padding,var(--oruga-grey));font-weight:var(--oruga-datepicker-table-head-item-font-weight,600)}.o-dpck__month__cell,.o-dpck__table__cell{text-align:center;vertical-align:middle;display:table-cell;text-decoration:none;border-radius:var(--oruga-datepicker-item-border-radius,var(--oruga-base-border-radius));padding:var(--oruga-datepicker-item-padding,.5rem .75rem)}.o-dpck__month__cell--unselectable,.o-dpck__table__cell--unselectable{color:var(--oruga-datepicker-item-disabled-color,var(--oruga-grey-light))}.o-dpck__month__cell--today,.o-dpck__table__cell--today{border:var(--oruga-datepicker-item-today-border,solid 1px rgba(var(--oruga-primary),.5))}.o-dpck__month__cell--selectable,.o-dpck__table__cell--selectable{cursor:pointer;color:var(--oruga-datepicker-item-selectable-color,var(--oruga-grey-dark))}.o-dpck__month__cell--first-hovered,.o-dpck__table__cell--first-hovered{background-color:var(--oruga-datepicker-item-hovered-background-color,var(--oruga-grey));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-bottom-right-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-right-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--within-hovered,.o-dpck__table__cell--within-hovered{background-color:var(--oruga-datepicker-item-hovered-within-background-color,rgb(from var(--oruga-grey) r g b/50%));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--last-hovered,.o-dpck__table__cell--last-hovered{background-color:var(--oruga-datepicker-item-hovered-background-color,var(--oruga-grey));color:var(--oruga-datepicker-item-hovered-color,var(--oruga-grey-lighter));border-bottom-left-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-left-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert))}.o-dpck__month__cell--first-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--first-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert));border-bottom-right-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-right-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--within-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--within-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-within-background-color,rgb(from var(--oruga-primary) r g b/50%));border-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--last-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered),.o-dpck__table__cell--last-selected:not(.o-dpck__table__cell--first-hovered,.o-dpck__month__cell--first-hovered):not(.o-dpck__table__cell--within-hovered,.o-dpck__month__cell--within-hovered):not(.o-dpck__table__cell--last-hovered,.o-dpck__month__cell--last-hovered){background-color:var(--oruga-datepicker-item-selected-background-color,var(--oruga-primary));color:var(--oruga-datepicker-item-selected-color,var(--oruga-primary-invert));border-bottom-left-radius:var(--oruga-datepicker-item-selected-border-radius,0);border-top-left-radius:var(--oruga-datepicker-item-selected-border-radius,0)}.o-dpck__month__cell--nearby:not(.o-dpck__table__cell--selected,.o-dpck__month__cell--selected),.o-dpck__table__cell--nearby:not(.o-dpck__table__cell--selected,.o-dpck__month__cell--selected){color:var(--oruga-datepicker-item-nearby-color,var(--oruga-grey-light))}.o-dpck__month__cell--invisible,.o-dpck__table__cell--invisible{visibility:hidden}.o-dpck__month__cell--events,.o-dpck__table__cell--events{position:relative;padding:var(--oruga-datepicker-events-item-padding,.3rem .75rem .75rem)}.o-dpck__month__events,.o-dpck__table__events{display:flex;justify-content:center;position:absolute;width:100%;left:0;bottom:15%}.o-dpck__month__event,.o-dpck__table__event{background-color:var(--oruga-datepicker-event-background-color,var(--oruga-grey-light))}.o-dpck__month__event--primary,.o-dpck__table__event--primary{background-color:#445e00;background-color:var(--oruga-variant-primary,#445e00)}.o-dpck__month__event--secondary,.o-dpck__table__event--secondary{background-color:#6c757d;background-color:var(--oruga-variant-secondary,#6c757d)}.o-dpck__month__event--success,.o-dpck__table__event--success{background-color:#006724;background-color:var(--oruga-variant-success,#006724)}.o-dpck__month__event--info,.o-dpck__table__event--info{background-color:#005c98;background-color:var(--oruga-variant-info,#005c98)}.o-dpck__month__event--warning,.o-dpck__table__event--warning{background-color:#f4c300;background-color:var(--oruga-variant-warning,#f4c300)}.o-dpck__month__event--danger,.o-dpck__table__event--danger{background-color:#b60000;background-color:var(--oruga-variant-danger,#b60000)}.o-dpck__month__event--dots,.o-dpck__table__event--dots{border-radius:50%;margin:var(--oruga-datepicker-event-dots-margin,0 .1em);height:var(--oruga-datepicker-event-dots-size,.35em);width:var(--oruga-datepicker-event-dots-size,.35em)}.o-dpck__month__event--bars,.o-dpck__table__event--bars{height:var(--oruga-datepicker-event-bars-height,.25em);width:100%}.o-dpck__month__table{display:inline-flex;flex-wrap:wrap;flex-direction:row;width:17rem}.o-dpck__month__cell{display:flex;align-items:center;justify-content:center;width:33.33%;height:2.5rem}.o-dpck--expanded{width:100%;flex-grow:1}.o-dpck--mobile .o-dpck__header__previous{order:1;flex-grow:1;flex-shrink:1}.o-dpck--mobile .o-dpck__header__next{order:3;flex-grow:1;flex-shrink:1}.o-dpck--mobile .o-dpck__header__list{order:2;flex-grow:1;flex-shrink:1}.o-dtpck__time{display:flex;justify-content:center;align-items:center;--oruga-dropdown-menu-box-shadow:0,0,0,0}.o-drop{display:inline-flex;position:relative;vertical-align:top}.o-drop__overlay{position:fixed;bottom:0;left:0;right:0;top:0;cursor:pointer;display:none;background-color:var(--oruga-dropdown-mobile-overlay-color,rgba(0,0,0,.86));z-index:var(--oruga-dropdown-mobile-overlay-zindex,55)}.o-drop__trigger{width:100%}.o-drop__menu{position:absolute;display:block;min-width:var(--oruga-dropdown-menu-width,12rem);z-index:var(--oruga-dropdown-menu-zindex,50);background-color:var(--oruga-dropdown-menu-background,#fff);border-radius:var(--oruga-dropdown-menu-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-dropdown-menu-box-shadow,0 .5em 1em -.125em rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.02));padding:var(--oruga-dropdown-menu-padding,.5rem 0 .5rem 0);margin:var(--oruga-dropdown-menu-margin,0)}.o-drop__menu--bottom{left:50%;right:auto;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto;transform:translate(-50%)}.o-drop__menu--top{left:50%;right:auto;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px));transform:translate(-50%)}.o-drop__menu--left{right:calc(100% + var(--oruga-dropdown-menu-spacer,0px));left:auto;top:50%;bottom:auto;transform:translateY(-50%)}.o-drop__menu--right{right:auto;left:calc(100% + var(--oruga-dropdown-menu-spacer,0px));top:50%;bottom:auto;transform:translateY(-50%)}.o-drop__menu--top-right{right:0;left:auto;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px))}.o-drop__menu--top-left{right:auto;left:0;top:auto;bottom:calc(100% + var(--oruga-dropdown-menu-spacer,0px))}.o-drop__menu--bottom-right{right:0;left:auto;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto}.o-drop__menu--bottom-left{right:auto;left:0;top:calc(100% + var(--oruga-dropdown-menu-spacer,0px));bottom:auto}.o-drop__item{display:block;position:relative;color:var(--oruga-dropdown-item-color,#000);font-size:var(--oruga-dropdown-item-font-size, var(--oruga-base-font-size));font-weight:var(--oruga-dropdown-item-font-weight,400);line-height:var(--oruga-dropdown-item-line-height, var(--oruga-base-line-height));padding:var(--oruga-dropdown-item-padding,.375rem 1rem)}.o-drop__item--disabled{opacity:var(--oruga-dropdown-item-disabled-opacity, var(--oruga-base-disabled-opacity));pointer-events:none}.o-drop__item--active{background-color:var(--oruga-dropdown-item-active-background-color,var(--oruga-primary));color:var(--oruga-dropdown-item-active-color,var(--oruga-primary-invert))}.o-drop__item--clickable{cursor:pointer}.o-drop__item--clickable:not(.o-drop__item--active):hover{background-color:var(--oruga-dropdown-item-hover-background-color,#f5f5f5);color:var(--oruga-dropdown-item-hover-color,#000)}.o-drop--inline{display:inline}.o-drop--inline .o-drop__menu{position:static;display:inline-block;padding:0}.o-drop--expanded,.o-drop--expanded .o-drop__menu{width:100%}.o-acp__item--empty,.o-acp__item-group-title,.o-drop--disabled{opacity:var(--oruga-dropdown-disabled-opacity, var(--oruga-base-disabled-opacity));pointer-events:none}.o-drop--mobile>.o-drop__menu{position:fixed;top:25%;left:50%;bottom:auto;right:auto;transform:translate3d(-50%,-25%,0);overflow-y:auto;width:var(--oruga-dropdown-mobile-width, calc(100vw - 40px) );max-width:var(--oruga-dropdown-mobile-max-width,460px);max-height:var(--oruga-dropdown-mobile-max-height, calc(100vh - 120px) );z-index:var(--oruga-dropdown-mobile-zindex,60)}.o-drop--mobile>.o-drop__overlay{display:block}.o-drop--teleport{width:unset}.o-field{flex-grow:1}.o-field:not(:last-child){margin-bottom:var(--oruga-field-margin-bottom,.75rem)}.o-field__label{display:block;color:var(--oruga-field-label-color,#363636);font-size:var(--oruga-base-font-size, 1rem);font-weight:var(--oruga-field-label-font-weight,600)}.o-field__label-small{font-size:var(--oruga-field-font-size-small, .75rem)}.o-field__label-medium{font-size:var(--oruga-field-font-size-medium, 1.25rem)}.o-field__label-large{font-size:var(--oruga-field-font-size-large, 1.5rem)}.o-field__message{display:block;font-size:var(--oruga-field-message-font-size, .75rem);margin-top:var(--oruga-field-message-margin-top,.25rem)}.o-field__message-primary{color:var(--oruga-variant-primary,#445e00)}.o-field__message-secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-field__message-success{color:var(--oruga-variant-success,#006724)}.o-field__message-info{color:var(--oruga-variant-info,#005c98)}.o-field__message-warning{color:var(--oruga-variant-warning,#f4c300)}.o-field__message-danger{color:var(--oruga-variant-danger,#b60000)}.o-field--addons{display:flex;justify-content:flex-start}.o-field--addons>:first-child:not(:only-child) button,.o-field--addons>:first-child:not(:only-child) input,.o-field--addons>:first-child:not(:only-child) select,.o-field--addons>button:first-child,.o-field--addons>input:first-child,.o-field--addons>select:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.o-field--addons>:last-child:not(:only-child) button,.o-field--addons>:last-child:not(:only-child) input,.o-field--addons>:last-child:not(:only-child) select,.o-field--addons>button:last-child,.o-field--addons>input:last-child,.o-field--addons>select:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.o-field--addons>:not(:first-child):not(:last-child) button,.o-field--addons>:not(:first-child):not(:last-child) input,.o-field--addons>:not(:first-child):not(:last-child) select,.o-field--addons>button:not(:first-child):not(:last-child),.o-field--addons>input:not(:first-child):not(:last-child),.o-field--addons>select:not(:first-child):not(:last-child){border-radius:0}.o-field--grouped{display:flex;margin-left:-.37rem;margin-right:-.37rem}.o-field--grouped>*{margin-left:.37rem;margin-right:.37rem}.o-field--grouped-multiline{flex-wrap:wrap}.o-field--grouped-multiline:last-child{margin-bottom:var(--oruga-field-margin-bottom,.75rem)}.o-field__horizontal-body{display:flex;flex-basis:0;flex-grow:5;flex-shrink:1;margin-left:-.37rem;margin-right:-.37rem}.o-field__horizontal-body>*{margin-left:.37rem;margin-right:.37rem}.o-field--horizontal{display:flex}.o-field__horizontal-label{flex-basis:0;flex-grow:1;flex-shrink:0;margin:0 1.5rem 0 0;text-align:right}.o-field--mobile .o-field__horizontal-body,.o-field--mobile .o-field__horizontal-label,.o-field--mobile.o-field--horizontal{display:block;text-align:inherit}@keyframes icon-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.o-icon{align-items:center;display:inline-flex;justify-content:center;transition:transform .15s ease-out,opacity .3s ease-out}.o-icon--small{font-size:var(--oruga-icon-font-size-small, .75rem)}.o-icon--medium{font-size:var(--oruga-icon-font-size-medium, 1.25rem)}.o-icon--large{font-size:var(--oruga-icon-font-size-large, 1.5rem)}.o-icon--primary{color:var(--oruga-variant-primary,#445e00)}.o-icon--secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-icon--success{color:var(--oruga-variant-success,#006724)}.o-icon--info{color:var(--oruga-variant-info,#005c98)}.o-icon--warning{color:var(--oruga-variant-warning,#f4c300)}.o-icon--danger{color:var(--oruga-variant-danger,#b60000)}.o-icon--clickable{pointer-events:auto;cursor:pointer}.o-icon--spin{animation-name:icon-spin;animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:var(--oruga-icon-spin-duration, 2s)}.o-input{-moz-appearance:none;-webkit-appearance:none;display:inline-flex;position:relative;vertical-align:top;box-shadow:var(--oruga-input-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-input-background-color,#fff);border-color:var(--oruga-input-border-color,var(--oruga-grey-lighter));border-style:var(--oruga-input-border-style,solid);border-width:var(--oruga-input-border-width,1px);border-radius:var(--oruga-input-border-radius,var(--oruga-base-border-radius));color:var(--oruga-input-color,#363636);font-size:var(--oruga-base-font-size, 1rem);height:var(--oruga-input-height,2.25em);line-height:var(--oruga-input-line-height, var(--oruga-base-line-height));padding:var(--oruga-input-padding, calc(.375em - 1px) calc(.625em - 1px) );margin:var(--oruga-input-margin,0)}.o-input__wrapper{display:inline-block;position:relative}.o-input__wrapper--expanded{width:100%;flex-grow:1;flex-shrink:1}.o-input__wrapper--expanded .o-input{width:100%}.o-input__textarea{display:block;max-width:100%;min-width:100%;height:auto;resize:vertical;padding:var(--oruga-input-textarea-padding,.625em)}.o-input__textarea:not([rows]){max-height:var(--oruga-input-textarea-max-height,600px);min-height:var(--oruga-input-textarea-min-height,120px)}.o-input__counter{display:block;float:right;font-size:var(--oruga-input-counter-font-size, .75rem);margin:var(--oruga-input-counter-margin,.25rem 0 0 .5rem)}.o-input__icon-left,.o-input__icon-right{position:absolute;top:0;height:100%;width:var(--oruga-input-height,2.25em);z-index:var(--oruga-input-icon-zindex,4)}.o-input__icon-right{right:0}.o-input__icon-left{left:0}.o-input--iconspace-left{padding-left:var(--oruga-input-height,2.25em)}.o-input--iconspace-right{padding-right:var(--oruga-input-height,2.25em)}.o-input--rounded{border-radius:var(--oruga-input-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-input--small{font-size:var(--oruga-input-font-size-small, .75rem)}.o-input--medium{font-size:var(--oruga-input-font-size-medium, 1.25rem)}.o-input--large{font-size:var(--oruga-input-font-size-large, 1.5rem)}.o-input--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:var(--oruga-variant-primary,#445e00)}.o-input--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:var(--oruga-variant-secondary,#6c757d)}.o-input--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:var(--oruga-variant-success,#006724)}.o-input--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:var(--oruga-variant-info,#005c98)}.o-input--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:var(--oruga-variant-warning,#f4c300)}.o-input--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:var(--oruga-variant-danger,#b60000)}.o-input:focus,.o-input:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-load{position:absolute;bottom:0;left:0;right:0;top:0;align-items:center;display:flex;justify-content:center;overflow:hidden;z-index:var(--oruga-loading-zindex,29)}.o-load--fullpage{position:fixed;z-index:var(--oruga-loading-fullpage-zindex,999)}.o-load__overlay{position:absolute;bottom:0;left:0;right:0;top:0;background:var(--oruga-loading-overlay-legacy,#7f7f7f);background:var(--oruga-loading-overlay,rgba(255,255,255,.5))}.o-menu--small{font-size:var(--oruga-menu-font-size-small, .75rem)}.o-menu--medium{font-size:var(--oruga-menu-font-size-medium, 1.25rem)}.o-menu--large{font-size:var(--oruga-menu-font-size-large, 1.5rem)}.o-menu__item__wrapper,.o-menu__list{list-style:none}.o-menu__list{line-height:var(--oruga-menu-list-line-height, 1.25em)}.o-menu__item__submenu{border-left:var(--oruga-menu-list-border-left,1px solid var(--oruga-primary));padding-left:var(--oruga-menu-nested-list-padding-left,.75em);margin:var(--oruga-menu-nested-list-margin,.75em)}.o-menu__label{text-transform:uppercase;color:var(--oruga-menu-label-color,#7a7a7a);font-size:var(--oruga-menu-label-font-size, .75em)}.o-menu__label:not(:first-child){margin-top:var(--oruga-menu-label-spacing,1em)}.o-menu__label:not(:last-child){margin-bottom:var(--oruga-menu-label-spacing,1em)}.o-menu__item{display:block;list-style:none;color:var(--oruga-menu-item-color,var(--oruga-grey-dark));padding:var(--oruga-menu-item-padding,.5em .75em);font-size:var(--oruga-menu-item-size, 1rem)}.o-menu__item:hover:not(.o-menu__item--active):not(.o-menu__item--disabled){color:var(--oruga-menu-item-hover-color,var(--oruga-black));background-color:var(--oruga-menu-item-hover-background-color,var(--oruga-grey-light))}.o-menu__item--icon-text .o-icon{margin-right:var(--oruga-menu-icon-spacer,.5rem)}.o-menu__item--active{color:var(--oruga-menu-item-active-color,var(--oruga-primary-invert));background-color:var(--oruga-menu-item-active-background-color,var(--oruga-primary))}.o-menu__item--disabled{color:var(--oruga-menu-item-disabled-color,var(--oruga-grey-light))}.o-modal{display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden;position:fixed;bottom:0;left:0;right:0;top:0;z-index:var(--oruga-modal-zindex,40)}.o-modal__overlay{bottom:0;left:0;position:absolute;right:0;top:0;background-color:var(--oruga-modal-overlay-background-color,hsla(0,0%,4%,.86))}.o-modal__content{overflow:auto;position:relative;margin:var(--oruga-modal-content-margin,0 auto);max-height:var(--oruga-modal-content-max-height, calc(100vh - 160px) );background-color:var(--oruga-modal-content-background-color,var(--oruga-white));border-radius:var(--oruga-modal-content-border-radius,var(--oruga-base-border-radius))}.o-modal__content--full-screen{width:100%;height:100%;max-height:100vh;margin:0;background-color:var(--oruga-modal-content-fullscreen-background-color,#f5f5f5)}.o-modal__close{background:0 0;position:fixed;border:none;display:inline-block;vertical-align:top;border-radius:var(--oruga-modal-close-border-radius,var(--oruga-base-border-radius-rounded));right:var(--oruga-modal-close-right,20px);top:var(--oruga-modal-close-top,20px);height:var(--oruga-modal-close-size,32px);width:var(--oruga-modal-close-size,32px);color:var(--oruga-modal-close-color,var(--oruga-white))}.o-modal--mobile .o-modal__content{width:100%}.o-notification{position:relative;transform-origin:50% 0;background-color:var(--oruga-notification-background-color,var(--oruga-primary));color:var(--oruga-notification-color,var(--oruga-white));border-radius:var(--oruga-notification-border-radius,4px);padding:var(--oruga-notification-padding,1.75em 1.75em);margin-bottom:var(--oruga-notification-margin-bottom,1.5rem)}.o-notification__content{flex-basis:auto;flex-grow:1;flex-shrink:1;text-align:inherit;overflow-y:hidden;overflow-x:auto}.o-notification__wrapper{align-items:flex-start;display:flex;text-align:inherit;padding-top:0;border:0}.o-notification__icon{flex-basis:auto;flex-grow:0;flex-shrink:0;margin-right:var(--oruga-notification-icon-margin-right,1rem)}.o-notification__close{position:absolute;border:none;cursor:pointer;pointer-events:auto;display:flex;justify-content:center;align-items:center;flex-grow:0;flex-shrink:0;vertical-align:top;background-color:var(--oruga-notification-close-background-color,hsla(0,0%,4%,.2));border-radius:var(--oruga-notification-close-border-radius,var(--oruga-base-border-radius-rounded));right:var(--oruga-notification-close-right,.5rem);top:var(--oruga-notification-close-top,.5rem);height:var(--oruga-notification-close-size,20px);width:var(--oruga-notification-close-size,20px);color:var(--oruga-notification-close-color,var(--oruga-white))}.o-notification--primary{border-color:transparent;background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-notification--primary:hover{filter:brightness(97.5%)}.o-notification--secondary{border-color:transparent;background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-notification--secondary:hover{filter:brightness(97.5%)}.o-notification--success{border-color:transparent;background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-notification--success:hover{filter:brightness(97.5%)}.o-notification--info{border-color:transparent;background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-notification--info:hover{filter:brightness(97.5%)}.o-notification--warning{border-color:transparent;background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-notification--warning:hover{filter:brightness(97.5%)}.o-notification--danger{border-color:transparent;background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-notification--danger:hover{filter:brightness(97.5%)}.o-notices{position:fixed;display:flex;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none;padding:var(--oruga-notification-notices-padding,2em);z-index:var(--oruga-notification-notices-zindex,1000)}.o-notices .o-notification{pointer-events:stroke;max-width:600px;animation:var(--oruga-notification-animantion,append-animate .3s linear)}.o-notices .o-notification--bottom,.o-notices .o-notification--top{align-self:center}.o-notices .o-notification--bottom-right,.o-notices .o-notification--top-right{align-self:flex-end}.o-notices .o-notification--bottom-left,.o-notices .o-notification--top-left{align-self:flex-start}.o-notices--top{flex-direction:column}.o-notices--bottom{flex-direction:column-reverse}.o-notices--bottom .o-notification{margin-bottom:0}.o-notices--bottom .o-notification:not(:first-child){margin-bottom:1.5rem}.o-notices__custom-container{position:absolute}.o-pag{align-items:center;display:flex;text-align:center;justify-content:space-between;font-size:var(--oruga-base-font-size, 1rem);margin:var(--oruga-pagination-margin,-.25rem)}.o-pag--small{font-size:var(--oruga-pagination-font-size-small, .75rem)}.o-pag--medium{font-size:var(--oruga-pagination-font-size-medium, 1.25rem)}.o-pag--large{font-size:var(--oruga-pagination-font-size-large, 1.5rem)}.o-pag__link{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;align-items:center;box-shadow:none;display:inline-flex;position:relative;vertical-align:top;justify-content:center;text-align:center;text-decoration:none;cursor:pointer;line-height:var(--oruga-pagination-link-line-height, var(--oruga-base-line-height));border:var(--oruga-pagination-link-border,1px solid transparent);border-radius:var(--oruga-pagination-link-border-radius,var(--oruga-base-border-radius));border-color:var(--oruga-pagination-link-border-color,var(--oruga-grey-lighter));color:var(--oruga-pagination-link-color,#363636);min-width:var(--oruga-pagination-link-min-width,2.25em);height:var(--oruga-pagination-link-height,2.25em);padding:var(--oruga-pagination-link-padding,.5em .5em);margin:var(--oruga-pagination-link-margin,.25rem)}.o-pag__link:hover{text-decoration:none;border-color:var(--oruga-pagination-link-hover-border-color,var(--oruga-grey-light))}.o-pag__link--rounded{border-radius:var(--oruga-pagination-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-pag__link--disabled{pointer-events:none;opacity:var(--oruga-pagination-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-pag__link--current{pointer-events:none;background-color:var(--oruga-pagination-link-current-background-color,var(--oruga-primary));border-color:var(--oruga-pagination-link-current-border-color,var(--oruga-primary));color:var(--oruga-pagination-link-current-color,#fff)}.o-pag__ellipsis{justify-content:center;text-align:center;pointer-events:none;margin:var(--oruga-pagination-link-margin,.25rem);color:var(--oruga-pagination-ellipsis-color,var(--oruga-grey-light))}.o-pag__next{order:3}.o-pag__previous{order:2}.o-pag__list{align-items:center;display:flex;text-align:center;list-style:none;flex-wrap:wrap;margin:0;padding:0;flex-grow:1;flex-shrink:1;justify-content:flex-start;order:1}.o-pag--simple{justify-content:normal}.o-pag--centered{justify-content:center}.o-pag--centered .o-pag__previous{order:1}.o-pag--centered .o-pag__next{order:3}.o-pag--centered .o-pag__list{justify-content:center;order:2}.o-pag--right{justify-content:flex-end}.o-pag--right .o-pag__previous{order:1}.o-pag--right .o-pag__next{order:2}.o-pag--right .o-pag__list{justify-content:flex-end;order:2}.o-pag--mobile{justify-content:flex-start;flex-wrap:wrap}.o-pag--mobile .o-pag__link{flex-grow:1;flex-shrink:1}.o-pag--mobile .o-pag__previous,.o-pag--mobile .o-pag__next{flex-grow:1;flex-shrink:1;order:0}.o-pag--mobile .o-pag__ellipsis{flex-grow:1;flex-shrink:1}.o-pag--mobile .o-pag__list{order:0}.o-radio{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-flex;align-items:center;cursor:pointer;line-height:var(--oruga-radio-line-height, 1.25);margin-right:var(--oruga-radio-margin-sibiling,.5em)}.o-radio__input{font-size:var(--oruga-radio-font-size, inherit);width:var(--oruga-radio-size,1rem);height:var(--oruga-radio-size,1rem);margin:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;cursor:pointer;box-shadow:var(--oruga-radio-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));border-radius:50%;background:var(--oruga-radio-active-background-color,#445e00);-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23000' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23000' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");background-image:none;background-position:center;background-size:contain;background-repeat:no-repeat;transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-radio__input--checked{-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23e11919' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3Ccircle cx='256' cy='256' r='144'%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg' fill='%23e11919' stroke='%23000' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M483 260c0-123-100-223-223-223S37 137 37 260s100 223 223 223S483 383 483 260Z' style='fill:none;stroke:%23000;stroke-miterlimit:10;stroke-width:64px'%3E%3C/path%3E%3Ccircle cx='256' cy='256' r='144'%3E%3C/circle%3E%3C/g%3E%3C/svg%3E")}.o-radio__label{padding:var(--oruga-radio-label-padding,0 0 0 .5em)}.o-radio--disabled{opacity:var(--oruga-radio-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-radio--small{--oruga-radio-font-size:.75rem;--oruga-radio-size:.75rem}.o-radio--medium{--oruga-radio-font-size:1.25rem;--oruga-radio-size:1.25rem}.o-radio--large{--oruga-radio-font-size:1.5rem;--oruga-radio-size:1.5rem}.o-radio--primary{--oruga-focus:rgba(68, 94, 0, .25);--oruga-radio-active-background-color:#445e00}.o-radio--secondary{--oruga-focus:rgba(108, 117, 125, .25);--oruga-radio-active-background-color:#6c757d}.o-radio--success{--oruga-focus:rgba(0, 103, 36, .25);--oruga-radio-active-background-color:#006724}.o-radio--info{--oruga-focus:rgba(0, 92, 152, .25);--oruga-radio-active-background-color:#005c98}.o-radio--warning{--oruga-focus:rgba(244, 195, 0, .25);--oruga-radio-active-background-color:#f4c300}.o-radio--danger{--oruga-focus:rgba(182, 0, 0, .25);--oruga-radio-active-background-color:#b60000}.o-radio:focus .o-radio__input,.o-radio:focus-within .o-radio__input{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-ctrl-sel{display:inline-flex;position:relative}.o-ctrl-sel--expanded{width:100%;flex-grow:1}.o-ctrl-sel--expanded .o-sel{width:100%}.o-sel{-moz-appearance:none;-webkit-appearance:none;display:inline-block;position:relative;vertical-align:top;cursor:pointer;justify-content:flex-start;align-items:center;box-shadow:var(--oruga-select-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-select-background-color,#fff);border-color:var(--oruga-select-border-color,var(--oruga-grey-lighter));border-width:var(--oruga-select-border-width,1px);border-style:var(--oruga-select-border-style,solid);border-radius:var(--oruga-select-border-radius,var(--oruga-base-border-radius));color:var(--oruga-select-color,#363636);font-size:var(--oruga-base-font-size, 1rem);height:var(--oruga-select-height,2.25em);line-height:var(--oruga-select-line-height, var(--oruga-base-line-height));padding:var(--oruga-select-padding, calc(.375em - 1px) calc(.625em - 1px) );margin:var(--oruga-select-margin,0)}.o-sel-arrow{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:serif='http://www.serif.com/' width='100%25' height='100%25' viewBox='0 0 100 100' version='1.1' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;'%3E%3Cg transform='matrix(5.70052,0,0,5.70052,-1329.79,-547.054)'%3E%3Cpath d='M233.451,101.749L235.617,99.422L242.013,105.565L248.463,99.422L250.642,101.749L242.013,110.052L233.451,101.749Z' style='fill:%23363636;stroke:white;stroke-width:0.18px;'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-size:var(--oruga-select-arrow-size,1rem);background-position:calc(100% - var(--oruga-select-arrow-size,1rem) * .5) center;padding-right:calc(var(--oruga-select-arrow-size,1rem) * 2)}.o-sel-iconspace-left{padding-left:var(--oruga-select-height,2.25em)}.o-sel-iconspace-right{padding-right:var(--oruga-select-height,2.25em)}.o-sel--small{font-size:var(--oruga-select-font-size-small, .75rem)}.o-sel--medium{font-size:var(--oruga-select-font-size-medium, 1.25rem)}.o-sel--large{font-size:var(--oruga-select-font-size-large, 1.5rem)}.o-sel--primary{--oruga-focus:rgba(68, 94, 0, .25);border-color:var(--oruga-variant-primary,#445e00)}.o-sel--secondary{--oruga-focus:rgba(108, 117, 125, .25);border-color:var(--oruga-variant-secondary,#6c757d)}.o-sel--success{--oruga-focus:rgba(0, 103, 36, .25);border-color:var(--oruga-variant-success,#006724)}.o-sel--info{--oruga-focus:rgba(0, 92, 152, .25);border-color:var(--oruga-variant-info,#005c98)}.o-sel--warning{--oruga-focus:rgba(244, 195, 0, .25);border-color:var(--oruga-variant-warning,#f4c300)}.o-sel--danger{--oruga-focus:rgba(182, 0, 0, .25);border-color:var(--oruga-variant-danger,#b60000)}.o-sel--rounded{border-radius:var(--oruga-select-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-sel--multiple{height:auto;padding:0}.o-sel--placeholder{opacity:var(--oruga-select-placeholder-opacity, var(--oruga-base-disabled-opacity))}.o-sel__icon-left,.o-sel__icon-right{position:absolute;top:0;height:100%;width:var(--oruga-select-height,2.25em);z-index:var(--oruga-select-icon-zindex,4)}.o-sel__icon-right{right:0}.o-sel__icon-left{left:0}.o-sel[disabled]{cursor:inherit}.o-sel:focus,.o-sel:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus)}@keyframes skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.o-sklt{display:inline-flex;flex-direction:column;vertical-align:middle;width:100%}.o-sklt__item{width:100%;background:var(--oruga-skeleton-background,linear-gradient(90deg,#dbdbdb 25%,rgba(219,219,219,.5) 50%,#dbdbdb 75%));margin:var(--oruga-skeleton-margin,.5rem 0 0 0);line-height:var(--oruga-skeleton-font-size, 1rem)}.o-sklt__item--small{line-height:var(--oruga-skeleton-font-size-small, .75rem)}.o-sklt__item--medium{line-height:var(--oruga-skeleton-font-size-medium, 1.25rem)}.o-sklt__item--large{line-height:var(--oruga-skeleton-font-size-large, 1.5rem)}.o-sklt__item--rounded{border-radius:var(--oruga-skeleton-border-radius,var(--oruga-base-border-radius))}.o-sklt__item--animated{background-size:400% 100%;animation-name:skeleton-loading;animation-iteration-count:infinite;animation-duration:var(--oruga-skeleton-duration, 1.5s)}.o-sklt__item:after{content:" "}.o-sklt--centered{align-items:center}.o-sklt--right{align-items:flex-end;margin:var(--oruga-skeleton-margin,.5rem 0 0 0)}.o-side{position:fixed;top:0;left:0;height:100%;width:100%;display:none}.o-side__content{position:absolute;background-color:var(--oruga-sidebar-content-background-color,var(--oruga-grey-lighter));border-radius:var(--oruga-sidebar-border-radius,var(--oruga-base-border-radius));box-shadow:var(--oruga-sidebar-box-shadow,5px 0 13px 3px rgba(var(--oruga-black),.1))}.o-side__content--primary{background-color:var(--oruga-variant-primary),#445e00}.o-side__content--secondary{background-color:var(--oruga-variant-secondary),#6c757d}.o-side__content--success{background-color:var(--oruga-variant-success),#006724}.o-side__content--info{background-color:var(--oruga-variant-info),#005c98}.o-side__content--warning{background-color:var(--oruga-variant-warning),#f4c300}.o-side__content--danger{background-color:var(--oruga-variant-danger),#b60000}.o-side__content--left,.o-side__content--right{transition:width var(--oruga-transition-duration) var(--oruga-transition-timing);width:var(--oruga-sidebar-width,260px)}.o-side__content--bottom,.o-side__content--top{transition:height var(--oruga-transition-duration) var(--oruga-transition-timing);height:var(--oruga-sidebar-width,260px)}.o-side__content--right{left:auto;right:0;border-left:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--left{left:0;right:auto;border-right:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--top{top:0;bottom:auto;border-bottom:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--bottom{top:auto;bottom:0;border-top:var(--oruga-sidebar-border-width,1px) solid var(--oruga-sidebar-border-color,rgba(0,0,0,.175))}.o-side__content--reduced{width:var(--oruga-sidebar-reduced-width,80px)}.o-side__content--reduced-expand:hover{transition:width var(--oruga-transition-duration) var(--oruga-transition-timing);width:var(--oruga-sidebar-width,260px)}.o-side__content--fullwidth{width:100%;max-width:100%}.o-side__content--fullheight{height:100%;max-height:100%}.o-side__overlay{position:absolute;bottom:0;left:0;right:0;top:0;background:var(--oruga-sidebar-overlay,hsla(0,0%,4%,.86))}.o-side--active{display:block}.o-side--inline{position:relative}.o-side--inline .o-side__overlay{position:absolute}.o-side--inline .o-side__content{position:relative}.o-side:not(.o-side--inline){z-index:var(--oruga-sidebar-zindex,100)}.o-slide{width:100%;margin:var(--oruga-slider-margin,1em 0);background:var(--oruga-slider-background,transparent)}.o-slide__thumb{box-shadow:var(--oruga-slider-thumb-shadow,none);border:var(--oruga-slider-thumb-border,1px solid var(--oruga-grey-light));border-radius:var(--oruga-slider-thumb-radius,var(--oruga-base-border-radius));background:var(--oruga-slider-thumb-background,var(--oruga-white))}.o-slide__thumb:focus{transform:var(--oruga-slider-thumb-transform,scale(1.25))}.o-slide__thumb--rounded{border-radius:var(--oruga-slider-rounded-borded-radius,var(--oruga-base-border-radius-rounded))}.o-slide__thumb--dragging{cursor:grabbing;filter:brightness(.8)}.o-slide__track{display:flex;align-items:center;position:relative;cursor:pointer;background:var(--oruga-slider-track-background,var(--oruga-grey-lighter));border-radius:var(--oruga-slider-track-border-radius,var(--oruga-base-border-radius))}.o-slide__fill{position:absolute;height:100%;box-shadow:var(--oruga-slider-track-shadow,0 0 0 var(--oruga-grey));background:var(--oruga-slider-fill-background,var(--oruga-primary));border-radius:var(--oruga-slider-track-radius,var(--oruga-base-border-radius));border:var(--oruga-slider-track-border,0 solid var(--oruga-grey));top:50%;transform:translateY(-50%)}.o-slide__fill--primary{background:var(--oruga-variant-primary,#445e00)}.o-slide__fill--primary+.o-slide__thumb-wrapper{--oruga-focus:rgba(68, 94, 0, .25)}.o-slide__fill--secondary{background:var(--oruga-variant-secondary,#6c757d)}.o-slide__fill--secondary+.o-slide__thumb-wrapper{--oruga-focus:rgba(108, 117, 125, .25)}.o-slide__fill--success{background:var(--oruga-variant-success,#006724)}.o-slide__fill--success+.o-slide__thumb-wrapper{--oruga-focus:rgba(0, 103, 36, .25)}.o-slide__fill--info{background:var(--oruga-variant-info,#005c98)}.o-slide__fill--info+.o-slide__thumb-wrapper{--oruga-focus:rgba(0, 92, 152, .25)}.o-slide__fill--warning{background:var(--oruga-variant-warning,#f4c300)}.o-slide__fill--warning+.o-slide__thumb-wrapper{--oruga-focus:rgba(244, 195, 0, .25)}.o-slide__fill--danger{background:var(--oruga-variant-danger,#b60000)}.o-slide__fill--danger+.o-slide__thumb-wrapper{--oruga-focus:rgba(182, 0, 0, .25)}.o-slide .o-slide__track{height:var(--oruga-slider-track-height,calc(var(--oruga-base-font-size)/ 2))}.o-slide .o-slide__thumb{height:var(--oruga-slider-thumb-size,var(--oruga-base-font-size));width:var(--oruga-slider-thumb-size,var(--oruga-base-font-size))}.o-slide .o-slide__tick{height:var(--oruga-slider-tick-height,calc(var(--oruga-base-font-size)/ 2 * .5))}.o-slide .o-slide__tick-label{font-size:var(--oruga-slider-mark-size .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-,calc(var(--oruga-base-font-size)/ 2)) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--small .o-slide__track{height:var(--oruga-slider-track-height-small,.375rem)}.o-slide--small .o-slide__thumb{height:var(--oruga-slider-thumb-size-small,.75rem);width:var(--oruga-slider-thumb-size-small,.75rem)}.o-slide--small .o-slide__tick{height:var(--oruga-slider-tick-height-small,.1875rem)}.o-slide--small .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-small, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-small,.375rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--medium .o-slide__track{height:var(--oruga-slider-track-height-medium,.625rem)}.o-slide--medium .o-slide__thumb{height:var(--oruga-slider-thumb-size-medium,1.25rem);width:var(--oruga-slider-thumb-size-medium,1.25rem)}.o-slide--medium .o-slide__tick{height:var(--oruga-slider-tick-height-medium,.3125rem)}.o-slide--medium .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-medium, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-medium,.625rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide--large .o-slide__track{height:var(--oruga-slider-track-height-large,.75rem)}.o-slide--large .o-slide__thumb{height:var(--oruga-slider-thumb-size-large,1.5rem);width:var(--oruga-slider-thumb-size-large,1.5rem)}.o-slide--large .o-slide__tick{height:var(--oruga-slider-tick-height-large,.375rem)}.o-slide--large .o-slide__tick-label{font-size:var(--oruga-slider-mark-size-large, .75rem);position:absolute;top:calc(var(--oruga-slider-tick-label-top-large,.75rem) * .5 + 2px);left:50%;transform:translate(-50%)}.o-slide__tick{position:absolute;transform:translate(-50%,-50%);top:50%;width:var(--oruga-slider-tick-width,3px);background:var(--oruga-slider-tick-background,var(--oruga-primary));border-radius:var(--oruga-slider-tick-radius,var(--oruga-base-border-radius))}.o-slide__tick--hidden{background:0 0}.o-slide__thumb-wrapper{display:inline-flex;align-items:center;position:absolute;cursor:grab;transform:translate(-50%,-50%);top:50%;flex-direction:column}.o-slide--disabled{cursor:not-allowed;pointer-events:none;opacity:var(--oruga-slider-track-disabled, .5)}.o-slide:active .o-slide__thumb,.o-slide:focus .o-slide__thumb,.o-slide:focus-within .o-slide__thumb{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-steps{display:flex;flex-wrap:wrap;margin:0;padding:0;font-size:var(--oruga-steps-size, var(--oruga-base-font-size));min-height:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2)}.o-steps .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-steps-size,var(--oruga-base-font-size))}.o-steps .o-steps__marker{height:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2);width:calc(var(--oruga-steps-size,var(--oruga-base-font-size)) * 2)}.o-steps .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-steps-size, var(--oruga-base-font-size)) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-steps-size, var(--oruga-base-font-size))}.o-steps .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-steps-size,var(--oruga-base-font-size)) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small{font-size:var(--oruga-size-small, .75rem);min-height:calc(var(--oruga-size-small,.75rem) * 2)}.o-steps--small .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-small,.75rem)}.o-steps--small .o-steps__marker{height:calc(var(--oruga-size-small,.75rem) * 2);width:calc(var(--oruga-size-small,.75rem) * 2)}.o-steps--small .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-small, .75rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-small, .75rem)}.o-steps--small .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--small .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-small,.75rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium{font-size:var(--oruga-size-medium, 1.25rem);min-height:calc(var(--oruga-size-medium,1.25rem) * 2)}.o-steps--medium .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-medium,1.25rem)}.o-steps--medium .o-steps__marker{height:calc(var(--oruga-size-medium,1.25rem) * 2);width:calc(var(--oruga-size-medium,1.25rem) * 2)}.o-steps--medium .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-medium, 1.25rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-medium, 1.25rem)}.o-steps--medium .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--medium .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-medium,1.25rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large{font-size:var(--oruga-size-large, 1.5rem);min-height:calc(var(--oruga-size-large,1.5rem) * 2)}.o-steps--large .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-size-large,1.5rem)}.o-steps--large .o-steps__marker{height:calc(var(--oruga-size-large,1.5rem) * 2);width:calc(var(--oruga-size-large,1.5rem) * 2)}.o-steps--large .o-steps__title{text-align:center;z-index:1;background-color:var(--oruga-steps-details-background-color,#fff);padding:var(--oruga-steps-details-padding,.2em);font-size:calc(var(--oruga-size-large, 1.5rem) * 1.2);height:var(--oruga-steps-details-title-font-weight,600);line-height:var(--oruga-size-large, 1.5rem)}.o-steps--large .o-steps__wrapper-vertical .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-right .o-steps__divider{left:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps--large .o-steps__wrapper-vertical.o-steps__wrapper-position-right .o-steps--label-left .o-steps__divider{left:auto;right:calc((var(--oruga-size-large,1.5rem) - var(--oruga-steps-divider-height,.2em)) * .5)}.o-steps__nav-item{position:relative;display:flex;flex-grow:1;flex-basis:1em;justify-content:center;list-style:none;margin:0;padding:0;line-height:var(--oruga-steps-item-line-height, var(--oruga-base-line-height))}.o-steps__nav-item--primary.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-primary,#fff);border-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-primary,#445e00)}.o-steps__nav-item--primary.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:200% 100%}.o-steps__nav-item--primary.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-primary,#fff);background-color:var(--oruga-variant-primary,#445e00)}.o-steps__nav-item--primary.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:200% 100%}.o-steps__nav-item--secondary.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-secondary,#fff);border-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-secondary,#6c757d)}.o-steps__nav-item--secondary.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:200% 100%}.o-steps__nav-item--secondary.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-secondary,#fff);background-color:var(--oruga-variant-secondary,#6c757d)}.o-steps__nav-item--secondary.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:200% 100%}.o-steps__nav-item--success.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-success,#fff);border-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-success,#006724)}.o-steps__nav-item--success.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:200% 100%}.o-steps__nav-item--success.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-success,#fff);background-color:var(--oruga-variant-success,#006724)}.o-steps__nav-item--success.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:200% 100%}.o-steps__nav-item--info.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-info,#fff);border-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-info,#005c98)}.o-steps__nav-item--info.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:200% 100%}.o-steps__nav-item--info.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-info,#fff);background-color:var(--oruga-variant-info,#005c98)}.o-steps__nav-item--info.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:200% 100%}.o-steps__nav-item--warning.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-warning,#000);border-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-warning,#f4c300)}.o-steps__nav-item--warning.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:200% 100%}.o-steps__nav-item--warning.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-warning,#000);background-color:var(--oruga-variant-warning,#f4c300)}.o-steps__nav-item--warning.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:200% 100%}.o-steps__nav-item--danger.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-variant-invert-danger,#fff);border-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-danger,#b60000)}.o-steps__nav-item--danger.o-steps__nav-item-active .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:200% 100%}.o-steps__nav-item--danger.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-variant-invert-danger,#fff);background-color:var(--oruga-variant-danger,#b60000)}.o-steps__nav-item--danger.o-steps__nav-item-previous .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:200% 100%}.o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color,var(--oruga-primary)) 50%);background-size:200% 100%;background-position:right bottom;content:" ";display:block;position:absolute;bottom:0;left:-50%;width:100%}.o-steps__content{position:relative;overflow:visible;display:flex;flex-direction:column;padding:var(--oruga-steps-content-padding,1rem)}.o-steps__content-transitioning{overflow:hidden}.o-steps--animated .o-steps__divider{transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-steps__link{display:flex;align-items:center;justify-content:center;flex-direction:column;background:0 0;border:transparent;cursor:pointer;text-decoration:none;color:var(--oruga-steps-link-color,#494949)}.o-steps__link-label-right{flex-direction:row}.o-steps__link-label-left{flex-direction:row-reverse}.o-steps__link:hover{text-decoration:none}.o-steps__link:not(.o-steps__link-clickable){cursor:not-allowed}.o-steps__marker{align-items:center;display:flex;justify-content:center;overflow:hidden;z-index:1;font-weight:var(--oruga-steps-marker-font-weight,700);background:var(--oruga-steps-marker-background,var(--oruga-grey-light));color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));border:var(--oruga-steps-marker-border,.2em solid #fff)}.o-steps__marker--rounded{border-radius:var(--oruga-steps-marker-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-steps__details{text-align:center;z-index:1;padding:var(--oruga-steps-details-padding,.2em);background-color:var(--oruga-steps-details-background-color,#fff)}.o-steps__nav-item-active .o-steps__link{cursor:default}.o-steps__nav-item-active .o-steps__marker{background-color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));border-color:var(--oruga-steps-active-color,var(--oruga-primary));color:var(--oruga-steps-active-color,var(--oruga-primary))}.o-steps__nav-item-active .o-steps__divider{background-position:left bottom}.o-steps__nav-item-previous .o-steps__marker{color:var(--oruga-steps-marker-color,var(--oruga-primary-invert));background-color:var(--oruga-steps-previous-color,var(--oruga-primary))}.o-steps__nav-item-previous .o-steps__divider{background-position:left bottom}.o-steps__item{flex-shrink:0;flex-basis:auto}.o-steps__wrapper-vertical{display:flex;flex-direction:row;flex-wrap:wrap}.o-steps__wrapper-vertical .o-steps{height:100%;flex-direction:column}.o-steps__wrapper-vertical .o-steps__divider{height:100%;width:var(--oruga-steps-divider-height,.2em);top:-50%;left:calc(50% - .1em)}.o-steps__wrapper-vertical .o-steps__item-active .o-steps__divider,.o-steps__wrapper-vertical .o-steps__item-previous .o-steps__divider{background-position:right top}.o-steps__wrapper-vertical .o-steps__nav-item{width:100%;display:flex;align-items:center;justify-content:center;padding:var(--oruga-steps-vertical-padding,1em 0)}.o-steps__wrapper-vertical .o-steps__nav-item--primary .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-primary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-primary,#445e00) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--secondary .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-secondary,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-secondary,#6c757d) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--success .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-success,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-success,#006724) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--info .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-info,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-info,#005c98) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--warning .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-warning,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-warning,#f4c300) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__nav-item--danger .o-steps__divider{background:linear-gradient(to left,var(--oruga-steps-divider-color-bg-danger,var(--oruga-grey-lighter)) 50%,var(--oruga-steps-divider-color-danger,#b60000) 50%);background-size:100% 200%;background-position:left bottom}.o-steps__wrapper-vertical .o-steps__content{flex-grow:1;flex-basis:70%}.o-steps__wrapper-vertical .o-steps__navigation{flex-basis:100%}.o-steps__wrapper-vertical.o-steps__wrapper-position-right{flex-direction:row-reverse}.o-steps--mobile .o-steps__title{display:none;padding:0}.o-steps--mobile .o-steps__divider{height:var(--oruga-steps-divider-height,.2em);top:var(--oruga-steps-divider-top,var(--oruga-base-font-size))}.o-steps--mobile .o-steps__divider .o-steps--small{top:var(--oruga-size-small,.75rem)}.o-steps--mobile .o-steps__divider .o-steps--medium{top:var(--oruga-size-medium,1.25rem)}.o-steps--mobile .o-steps__divider .o-steps--large{top:var(--oruga-size-large,1.5rem)}.o-switch{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;position:relative;border-radius:50rem}.o-switch--small{font-size:var(--oruga-font-size-name, .75rem)}.o-switch--medium{font-size:var(--oruga-font-size-name, 1.25rem)}.o-switch--large{font-size:var(--oruga-font-size-name, 1.5rem)}.o-switch--primary{--oruga-focus:rgba(68, 94, 0, .25)}.o-switch--primary .o-switch__check--checked{background:var(--oruga-variant-primary,#445e00)}.o-switch--primary-passive{--oruga-focus:rgba(68, 94, 0, .25)}.o-switch--primary-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-primary,#445e00)}.o-switch--secondary{--oruga-focus:rgba(108, 117, 125, .25)}.o-switch--secondary .o-switch__check--checked{background:var(--oruga-variant-secondary,#6c757d)}.o-switch--secondary-passive{--oruga-focus:rgba(108, 117, 125, .25)}.o-switch--secondary-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-secondary,#6c757d)}.o-switch--success{--oruga-focus:rgba(0, 103, 36, .25)}.o-switch--success .o-switch__check--checked{background:var(--oruga-variant-success,#006724)}.o-switch--success-passive{--oruga-focus:rgba(0, 103, 36, .25)}.o-switch--success-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-success,#006724)}.o-switch--info{--oruga-focus:rgba(0, 92, 152, .25)}.o-switch--info .o-switch__check--checked{background:var(--oruga-variant-info,#005c98)}.o-switch--info-passive{--oruga-focus:rgba(0, 92, 152, .25)}.o-switch--info-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-info,#005c98)}.o-switch--warning{--oruga-focus:rgba(244, 195, 0, .25)}.o-switch--warning .o-switch__check--checked{background:var(--oruga-variant-warning,#f4c300)}.o-switch--warning-passive{--oruga-focus:rgba(244, 195, 0, .25)}.o-switch--warning-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-warning,#f4c300)}.o-switch--danger{--oruga-focus:rgba(182, 0, 0, .25)}.o-switch--danger .o-switch__check--checked{background:var(--oruga-variant-danger,#b60000)}.o-switch--danger-passive{--oruga-focus:rgba(182, 0, 0, .25)}.o-switch--danger-passive .o-switch__check:not(.o-switch__check--checked){background:var(--oruga-variant-danger,#b60000)}.o-switch__label{margin-left:var(--oruga-switch-margin-label,.5em)}.o-switch--left{flex-direction:row-reverse}.o-switch--left .o-switch__label{margin-left:0;margin-right:var(--oruga-switch-margin-label,.5em)}.o-switch__check-switch{content:"";display:block;height:calc((var(--oruga-switch-width,2.75em) - var(--oruga-switch-padding,.2em) * 2) * .5);width:calc((var(--oruga-switch-width,2.75em) - var(--oruga-switch-padding,.2em) * 2) * .5);background:var(--oruga-switch-action-background,#f5f5f5);box-shadow:var(--oruga-switch-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));transition:transform var(--oruga-transition-duration) var(--oruga-transition-timing);will-change:transform;transform-origin:left}.o-switch__check{display:flex;align-items:center;flex-shrink:0;width:var(--oruga-switch-width,2.75em);height:calc(var(--oruga-switch-width,2.75em) * .5 + var(--oruga-switch-padding,.2em));padding:var(--oruga-switch-padding,.2em);background:var(--oruga-switch-background,var(--oruga-grey-light));border-radius:var(--oruga-switch-border-radius,var(--oruga-base-border-radius));transition:background var(--oruga-transition-duration) var(--oruga-transition-timing)}.o-switch__check--checked{background:var(--oruga-switch-active-background-color,var(--oruga-primary))}.o-switch__check--checked .o-switch__check-switch{transform:translate3d(100%,0,0)}.o-switch__input{position:absolute;left:0;opacity:0;z-index:-1}.o-switch--rounded{border-radius:var(--oruga-switch-rounded-border-radius,var(--oruga-base-border-radius-rounded))}.o-switch--disabled{opacity:var(--oruga-switch-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-switch:focus .o-switch__check,.o-switch:focus-within .o-switch__check{box-shadow:0 0 0 .25rem var(--oruga-focus)}.o-table{display:table;width:100%;border-collapse:separate;border-spacing:0;border:var(--oruga-table-boder,1px solid transparent);border-radius:var(--oruga-table-border-radius,var(--oruga-base-border-radius));background-color:var(--oruga-table-background-color,#fff);color:var(--oruga-table-color,#000)}.o-table__root{position:relative}.o-table__wrapper{transition:opacity .3s ease-out;position:relative}.o-table__wrapper--sticky-header{height:var(--oruga-table-sticky-header-height,300px);overflow-y:auto}.o-table__wrapper--sticky-header th{position:-webkit-sticky;position:sticky;left:0;top:0;background:var(--oruga-table-background-color,#fff);z-index:calc(var(--oruga-table-sticky-zindex,1) + 1)}.o-table__wrapper--scrollable{-webkit-overflow-scrolling:touch;overflow-x:auto;max-width:100%}.o-table__wrapper--mobile{overflow-x:auto}.o-table__wrapper--mobile .o-table__mobile-sort{display:block}.o-table__wrapper--mobile .o-table{background-color:transparent}.o-table__wrapper--mobile thead tr{box-shadow:none;border-width:0}.o-table__wrapper--mobile thead tr th{display:none}.o-table__wrapper--mobile thead tr .o-table-th-checkbox{display:block;width:100%;text-align:right;border:0}.o-table__wrapper--mobile tfoot th{border:0;display:inherit}.o-table__wrapper--mobile tr{box-shadow:var(--oruga-table-card-box-shadow,0 2px 3px rgba(var(--oruga-black),.1),0 0 0 1px rgba(var(--oruga-black),.1));max-width:100%;position:relative;display:block}.o-table__wrapper--mobile tr td{border:0;display:inherit}.o-table__wrapper--mobile tr td:last-child{border-bottom:0}.o-table__wrapper--mobile tr:not(:last-child){margin:var(--oruga-table-card-margin,0 0 1rem 0)}.o-table__wrapper--mobile tr:not(.o-table__tr--selected){background:inherit;background:#fff}.o-table__wrapper--mobile tr:not(.o-table__tr--selected):hover{background-color:inherit;background-color:#fff}.o-table__wrapper--mobile tr.o-table--detailed{margin:var(--oruga-table-card-detail-margin,-1rem 0 0 0)}.o-table__wrapper--mobile tr:not(.o-table--detailed):not(.o-table--empty):not(.o-table__footer) td{display:flex;width:auto;justify-content:space-between;text-align:right;border-bottom:var(--oruga-table-background,#f5f5f5 1px solid)}.o-table__wrapper--mobile tr:not(.o-table--detailed):not(.o-table--empty):not(.o-table__footer) td:before{content:attr(data-label);font-weight:var(--oruga-table-card-cell-font-weight,600);padding-right:var(--oruga-table-card-cell-padding,0 .5em 0 0);text-align:var(--oruga-table-card-cell-text-align,left)}.o-table__mobile-sort{display:none}.o-table__th{vertical-align:top;text-align:left;position:relative;font-weight:var(--oruga-table-th-font-weight,600);color:var(--oruga-table-th-color,#363636);border-bottom:var(--oruga-table-th-border,2px solid var(--oruga-grey-lighter));padding:var(--oruga-table-th-padding,.5em .75em)}.o-table__th--centered{text-align:center}.o-table__th--right{text-align:right}.o-table__th__sort-icon{position:absolute;right:0}.o-table__th-checkbox{width:var(--oruga-table-th-checkbox-width,40px)}.o-table__th-current-sort{border-color:var(--oruga-table-current-sort-border-color,var(--oruga-grey));font-weight:var(--oruga-table-current-sort-font-weight,700)}.o-table__th--sortable{cursor:pointer}.o-table__th--sortable:hover{border-color:var(--oruga-table-current-sort-hover-border-color,var(--oruga-grey))}.o-table__th--sticky{position:-webkit-sticky;position:sticky;left:0;top:0;z-index:var(--oruga-table-sticky-zindex,1);background:var(--oruga-table-background-color,#fff)}.o-table__th--unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.o-table__th--detailed{width:var(--oruga-table-th-detail-width,14px)}.o-table__td{vertical-align:top;text-align:left;border-bottom:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter));padding:var(--oruga-table-td-padding,.5em .75em)}.o-table__td--sticky{position:-webkit-sticky;position:sticky;left:0;z-index:var(--oruga-table-sticky-zindex,1);background:var(--oruga-table-background-color,#fff)}.o-table__td--right{text-align:right}.o-table__td--centered{text-align:center}.o-table__td-chevron{vertical-align:middle;width:var(--oruga-table-detail-chevron-width,40px);color:var(--oruga-table-detail-chevron-color,var(--oruga-primary))}.o-table:focus{border-color:var(--oruga-table-focus-border-color,var(--oruga-primary));box-shadow:var(--oruga-table-focus-box-shadow,0 0 0 .125em rgba(var(--oruga-primary),.25))}.o-table--bordered tr:last-child td,.o-table--bordered tr:last-child th{border:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter))}.o-table--bordered td,.o-table--bordered th{border:var(--oruga-table-td-border,1px solid var(--oruga-grey-lighter))}.o-table--striped tbody tr:not(.o-table__tr--selected):nth-child(2n){background-color:var(--oruga-table-striped-background-color,#fafafa)}.o-table--narrowed td,.o-table--narrowed th{padding:var(--oruga-table-narrow-padding,.25em .5em)}.o-table--hoverable tbody tr:not(.o-table__tr--selected):hover{background-color:var(--oruga-table-hoverable-background-color,#fafafa)}.o-table__detail{box-shadow:var(--oruga-table-detail-box-shadow,inset 0 1px 3px var(--oruga-grey));background:var(--oruga-table-detail-background,#fafafa)}.o-table__detail td{padding:var(--oruga-table-detail-padding,1rem)}.o-table__tr--selected{background-color:var(--oruga-primary);color:var(--oruga-primary-invert)}.o-table__tr--selected-primary{background-color:#445e00;color:#fff}.o-table__tr--selected-secondary{background-color:#6c757d;color:#fff}.o-table__tr--selected-success{background-color:#006724;color:#fff}.o-table__tr--selected-info{background-color:#005c98;color:#fff}.o-table__tr--selected-warning{background-color:#f4c300;color:#000}.o-table__tr--selected-danger{background-color:#b60000;color:#fff}.o-table__pagination{align-items:center;justify-content:space-between;display:flex}.o-table__pagination>div{flex-basis:auto;flex-grow:0;flex-shrink:0}.o-table__pagination>div:first-child{align-items:center;justify-content:flex-start}.o-table__pagination>div:last-child{align-items:center;justify-content:flex-end}.o-table__pagination>div:last-child>div{align-items:center;display:flex;flex-basis:auto;flex-grow:0;flex-shrink:0;justify-content:center}.o-tabs--fullwidth{width:100%}.o-tabs--fullwidth .o-tabs__nav-item-wrapper{flex-grow:1;flex-shrink:0}.o-tabs--fullwidth .o-tabs__nav-item-boxed,.o-tabs--fullwidth .o-tabs__nav-item-default,.o-tabs--fullwidth .o-tabs__nav-item-toggle{height:100%}.o-tabs--vertical{display:flex;flex-direction:row}.o-tabs--vertical .o-tabs__nav{flex-direction:column;align-items:stretch;flex-grow:0;border-bottom:none}.o-tabs--vertical .o-tabs__nav-item-default{border-radius:0}.o-tabs--vertical .o-tabs__nav-item-boxed{border-bottom-color:transparent;border-right-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-radius:var(--oruga-tabs-border-bottom-color,var(--oruga-base-border-radius) 0 0 var(--oruga-base-border-radius))}.o-tabs--vertical .o-tabs__nav-item-boxed--active{border-right-color:transparent;border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter))}.o-tabs--right{flex-direction:row-reverse}.o-tabs--right .o-tabs__nav-item-boxed{border-bottom-color:transparent;border-right-color:transparent;border-left-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-radius:var(--oruga-tabs-border-bottom-color,0 var(--oruga-base-border-radius) var(--oruga-base-border-radius) 0)}.o-tabs--right .o-tabs__nav-item-boxed--active{border-left-color:transparent;border-right-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter))}.o-tabs__nav{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0;padding:0;align-items:center;display:flex;flex-grow:1;flex-shrink:0;justify-content:flex-start;padding-bottom:var(--oruga-tabs-border-bottom-width,1px);font-size:var(--oruga-tabs-font-size, var(--oruga-base-font-size))}.o-tabs__nav--small{font-size:var(--oruga-tabs-font-size-small, .75rem)}.o-tabs__nav--medium{font-size:var(--oruga-tabs-font-size-medium, 1.25rem)}.o-tabs__nav--large{font-size:var(--oruga-tabs-font-size-large, 1.5rem)}.o-tabs__nav--centered{justify-content:center}.o-tabs__nav--right{justify-content:flex-end}.o-tabs__nav-item{-moz-appearance:none;-webkit-appearance:none;width:100%;margin:0 0 -1px;border:1px solid transparent;background-color:transparent;align-items:center;line-height:var(--oruga-base-line-height);display:flex;justify-content:center;vertical-align:top;cursor:pointer;text-decoration:none;font-size:var(--oruga-tabs-font-size, var(--oruga-base-font-size));border-bottom-color:var(--oruga-tabs-border-bottom-color,var(--oruga-grey-lighter));border-bottom-style:var(--oruga-tabs-border-bottom-style,solid);border-bottom-width:var(--oruga-tabs-border-bottom-width,1px);color:var(--oruga-tabs-link-color,#494949);padding:var(--oruga-tabs-link-padding,.5em 1em)}.o-tabs__nav-item-icon{margin-right:var(--oruga-tabs-icon-margin,.5em)}.o-tabs__nav-item:focus,.o-tabs__nav-item:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0;border-radius:var(--oruga-base-border-radius)}.o-tabs__nav-item-default--active{border-bottom-color:var(--oruga-tabs-link-active-border-bottom-color,var(--oruga-primary));color:var(--oruga-tabs-link-active-color,var(--oruga-primary))}.o-tabs__nav-item-default--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-default:hover:not(.o-tabs__nav-item-default--active){background-color:var(--oruga-tabs-link-hover-background-color,#f4f4f4);border-bottom-color:var(--oruga-tabs-link-hover-border-bottom-color,#dbdbdb)}.o-tabs__nav-item-boxed{border-radius:var(--oruga-tabs-border-bottom-color,var(--oruga-base-border-radius) var(--oruga-base-border-radius) 0 0)}.o-tabs__nav-item-boxed--active{color:var(--oruga-tabs-link-active-color,var(--oruga-primary));background-color:var(--oruga-tabs-boxed-link-active-background-color,#fff);border-color:var(--oruga-tabs-boxed-link-active-border-color,#dbdbdb);border-bottom-color:var(--oruga-tabs-boxed-link-active-border-bottom-color,transparent)}.o-tabs__nav-item-boxed--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-boxed:hover:not(.o-tabs__nav-item-boxed--active){background-color:var(--oruga-tabs-boxed-link-hover-background-color,#f4f4f4)}.o-tabs__nav-item-toggle{border-color:var(--oruga-tabs-toggle-link-border-color,#dbdbdb);border-style:var(--oruga-tabs-toggle-link-border-style,solid);border-width:var(--oruga-tabs-toggle-link-border-width,1px)}.o-tabs__nav-item-toggle--active{background-color:var(--oruga-tabs-toggle-link-active-background-color,var(--oruga-primary));border-color:var(--oruga-tabs-toggle-link-active-border-color,var(--oruga-primary));color:var(--oruga-tabs-toggle-link-active-color,var(--oruga-primary-invert))}.o-tabs__nav-item-toggle--disabled{pointer-events:none;cursor:not-allowed;opacity:var(--oruga-tabs-disabled-opacity, var(--oruga-base-disabled-opacity))}.o-tabs__nav-item-toggle:hover:not(.o-tabs__nav-item-toggle--active){background-color:var(--oruga-tabs-toggle-link-hover-background-color,#f4f4f4);border-color:var(--oruga-tabs-toggle-link-hover-border-color,#b5b5b5)}.o-tabs__nav-item-pills{border-radius:var(--oruga-tabs-boxed-link-radius,var(--oruga-base-border-radius));border-color:transparent}.o-tabs__nav-item-pills--active{background-color:var(--oruga-tabs-toggle-link-active-background-color,var(--oruga-primary));color:var(--oruga-tabs-toggle-link-active-color,var(--oruga-primary-invert))}.o-tabs__content{position:relative;overflow:visible;display:flex;flex-direction:column;flex-grow:1;padding:var(--oruga-tabs-content-padding,1rem)}.o-tabs__content--transitioning{overflow:hidden}.o-tabs:not(:last-child){margin-bottom:var(--oruga-tabs-margin-bottom,1.5rem)}.o-taginput{display:flex}.o-taginput__container{display:flex;flex-wrap:wrap;box-shadow:var(--oruga-input-box-shadow,inset 0 1px 2px hsla(0,0%,4%,.1));background-color:var(--oruga-input-background-color,#fff);border-color:var(--oruga-input-border-color,var(--oruga-grey-lighter));border-style:var(--oruga-input-border-style,solid);border-width:var(--oruga-input-border-width,1px);border-radius:var(--oruga-input-border-radius,var(--oruga-base-border-radius));color:var(--oruga-input-color,#363636);font-size:var(--oruga-base-font-size, 1rem);line-height:var(--oruga-input-line-height, var(--oruga-base-line-height));margin:var(--oruga-input-margin,0);width:var(--oruga-taginput-width,inherit)}.o-taginput__container--small{font-size:var(--oruga-taginput-font-size-small, .75rem)}.o-taginput__container--medium{font-size:var(--oruga-taginput-font-size-medium, 1.25rem)}.o-taginput__container--large{font-size:var(--oruga-taginput-font-size-large, 1.5rem)}.o-taginput__autocomplete{flex-grow:1;flex-shrink:1;width:auto}.o-taginput__input{border:none;box-shadow:none;width:100%}.o-taginput__item{display:inline-flex;margin:var(--oruga-taginput-item-margin,.275em);padding:var(--oruga-taginput-item-padding,0 .75em 0 .75em);color:var(--oruga-taginput-item-color,var(--oruga-primary-invert));background-color:var(--oruga-taginput-item-background-color,var(--oruga-primary));border-radius:var(--oruga-taginput-item-border-radius,var(--oruga-base-border-radius))}.o-taginput__item--primary{--oruga-focus:rgba(68, 94, 0, .25);background-color:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-taginput__item--secondary{--oruga-focus:rgba(108, 117, 125, .25);background-color:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-taginput__item--success{--oruga-focus:rgba(0, 103, 36, .25);background-color:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-taginput__item--info{--oruga-focus:rgba(0, 92, 152, .25);background-color:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-taginput__item--warning{--oruga-focus:rgba(244, 195, 0, .25);background-color:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-taginput__item--danger{--oruga-focus:rgba(182, 0, 0, .25);background-color:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-taginput__item:focus,.o-taginput__item:focus-within{box-shadow:0 0 0 .25rem var(--oruga-focus);outline:0}.o-taginput__counter{display:block;float:right;font-size:var(--oruga-taginput-counter-font-size, .75rem);margin:var(--oruga-taginput-counter-margin,.25rem 0 0 .5rem)}.o-taginput--expanded{width:100%;flex-grow:1;flex-shrink:1}.o-tpck{font-size:var(--oruga-timepicker-font-size, var(--oruga-base-font-size))}.o-tpck--small{font-size:var(--oruga-timepicker-font-size-small, .75rem)}.o-tpck--medium{font-size:var(--oruga-timepicker-font-size-medium, 1.25rem)}.o-tpck--large{font-size:var(--oruga-timepicker-font-size-large, 1.5rem)}.o-tpck__dropdown{width:100%}.o-tpck__box{display:flex;justify-content:center;align-items:center;line-height:var(--oruga-timepicker-box-line-height, var(--oruga-base-line-height));padding:var(--oruga-timepicker-box-padding,.375rem 1rem)}.o-tpck__select{-moz-appearance:none;-webkit-appearance:none;display:inline-block;position:relative;vertical-align:top;cursor:pointer;justify-content:flex-start;align-items:center;border:0;font-size:inherit;font-weight:var(--oruga-timepicker-select-font-weight,600);line-height:var(--oruga-timepicker-select-line-height, var(--oruga-base-line-height));color:var(--oruga-timepicker-select-color,#363636);padding:var(--oruga-timepicker-select-padding, calc(.375em - 1px) calc(.625em - 1px) )}.o-tpck__select-placeholder{opacity:var(--oruga-timepicker-select-placeholder-opacity, var(--oruga-base-disabled-opacity))}.o-tpck__separator{font-weight:var(--oruga-timepicker-separator-font-weight,600)}.o-tpck__footer{padding:var(--oruga-timepicker-header-padding,0 .5rem);margin:var(--oruga-timepicker-header-margin,.875rem 0 0 0)}.o-tip{position:relative;display:inline-flex}.o-tip__arrow{position:absolute;content:"";pointer-events:none;z-index:var(--oruga-tooltip-content-zindex,38);color:var(--oruga-tooltip-background-color,var(--oruga-primary))}.o-tip__arrow--primary{color:var(--oruga-variant-primary,#445e00)}.o-tip__arrow--secondary{color:var(--oruga-variant-secondary,#6c757d)}.o-tip__arrow--success{color:var(--oruga-variant-success,#006724)}.o-tip__arrow--info{color:var(--oruga-variant-info,#005c98)}.o-tip__arrow--warning{color:var(--oruga-variant-warning,#f4c300)}.o-tip__arrow--danger{color:var(--oruga-variant-danger,#b60000)}.o-tip__arrow--bottom{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--top{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--left{top:50%;right:auto;bottom:auto;left:100%;transform:translateY(-50%);border-left-style:solid;border-top-style:solid;border-top-color:transparent;border-bottom-style:solid;border-bottom-color:transparent;border-left-width:var(--oruga-tooltip-arrow-size,5px);border-top-width:var(--oruga-tooltip-arrow-size,5px);border-bottom-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--right{top:50%;right:100%;bottom:auto;left:auto;transform:translateY(-50%);border-right-style:solid;border-top-style:solid;border-top-color:transparent;border-bottom-style:solid;border-bottom-color:transparent;border-right-width:var(--oruga-tooltip-arrow-size,5px);border-top-width:var(--oruga-tooltip-arrow-size,5px);border-bottom-width:var(--oruga-tooltip-arrow-size,5px)}.o-tip__arrow--top-right{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-left-width:0}.o-tip__arrow--top-left{top:100%;right:auto;bottom:auto;left:50%;transform:translate(-50%);border-top-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-top-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-right-width:0}.o-tip__arrow--bottom-left{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-left-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-right-width:0}.o-tip__arrow--bottom-right{top:auto;right:auto;bottom:100%;left:50%;transform:translate(-50%);border-bottom-style:solid;border-right-style:solid;border-right-color:transparent;border-left-style:solid;border-left-color:transparent;border-bottom-width:var(--oruga-tooltip-arrow-size,5px);border-right-width:calc(var(--oruga-tooltip-arrow-size,5px) * 2);border-left-width:0}.o-tip__content{position:absolute;white-space:nowrap;max-width:var(--oruga-tooltip-content-max-width,300px);padding:var(--oruga-tooltip-content-padding,.35rem .75rem);border-radius:var(--oruga-tooltip-content-radius-large,6px);font-size:var(--oruga-tooltip-content-font-size, .85rem);font-weight:var(--oruga-tooltip-content-weight-normal,400);box-shadow:var(--oruga-tooltip-content-box-shadow,0 1px 2px 1px rgba(0,1,0,.2));z-index:var(--oruga-tooltip-content-zindex,38);background-color:var(--oruga-tooltip-background-color,var(--oruga-primary));color:var(--oruga-tooltip-color,var(--oruga-primary-invert))}.o-tip__content--primary{background:var(--oruga-variant-primary,#445e00);color:var(--oruga-variant-invert-primary,#fff)}.o-tip__content--secondary{background:var(--oruga-variant-secondary,#6c757d);color:var(--oruga-variant-invert-secondary,#fff)}.o-tip__content--success{background:var(--oruga-variant-success,#006724);color:var(--oruga-variant-invert-success,#fff)}.o-tip__content--info{background:var(--oruga-variant-info,#005c98);color:var(--oruga-variant-invert-info,#fff)}.o-tip__content--warning{background:var(--oruga-variant-warning,#f4c300);color:var(--oruga-variant-invert-warning,#000)}.o-tip__content--danger{background:var(--oruga-variant-danger,#b60000);color:var(--oruga-variant-invert-danger,#fff)}.o-tip__content--top{top:auto;right:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);left:50%;transform:translate(-50%)}.o-tip__content--bottom{top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);right:auto;bottom:auto;left:50%;transform:translate(-50%)}.o-tip__content--right{top:50%;right:auto;bottom:auto;left:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translateY(-50%)}.o-tip__content--left{top:50%;right:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);bottom:auto;left:auto;transform:translateY(-50%)}.o-tip__content--top-right{left:auto;top:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(50%)}.o-tip__content--top-left{right:auto;top:auto;bottom:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(-50%)}.o-tip__content--bottom-right{left:auto;bottom:auto;top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(50%)}.o-tip__content--bottom-left{left:auto;bottom:auto;top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px) + 100%);transform:translate(-50%)}.o-tip__content--always{opacity:1;visibility:visible}.o-tip__content--multiline{text-align:center;white-space:normal;width:var(--oruga-tooltip-content-multiline-width,300px)}.o-tip--teleport .o-tip__content--top,.o-tip--teleport .o-tip__content--top-left,.o-tip--teleport .o-tip__content--top-right{margin-top:calc(-1 * (var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px)))}.o-tip--teleport .o-tip__content--bottom,.o-tip--teleport .o-tip__content--bottom-left,.o-tip--teleport .o-tip__content--bottom-right{margin-top:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px))}.o-tip--teleport .o-tip__content--right{margin-left:calc(var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px))}.o-tip--teleport .o-tip__content--left{margin-left:calc(-1 * (var(--oruga-tooltip-arrow-size,5px) + var(--oruga-tooltip-arrow-margin,2px)))}.o-tip__trigger{width:100%}.o-upl{position:relative;display:inline-flex}.o-upl--disabled{opacity:var(--oruga-upload-draggable-disabled-opacity, var(--oruga-base-disabled-opacity));cursor:not-allowed}.o-upl--expanded{width:100%}.o-upl__draggable{cursor:pointer;width:100%;padding:var(--oruga-upload-draggable-padding,.25em);border:var(--oruga-upload-draggable-border,1px dashed var(--oruga-grey-light));border-radius:var(--oruga-upload-draggable-border-radius,var(--oruga-base-border-radius))}.o-upl__draggable--hovered{border-color:var(--oruga-upload-draggable-hover-border-color,var(--oruga-grey))}.o-upl__draggable--hovered-primary{border-color:var(--oruga-variant-primary,#445e00)}.o-upl__draggable--hovered-secondary{border-color:var(--oruga-variant-secondary,#6c757d)}.o-upl__draggable--hovered-success{border-color:var(--oruga-variant-success,#006724)}.o-upl__draggable--hovered-info{border-color:var(--oruga-variant-info,#005c98)}.o-upl__draggable--hovered-warning{border-color:var(--oruga-variant-warning,#f4c300)}.o-upl__draggable--hovered-danger{border-color:var(--oruga-variant-danger,#b60000)}.o-upl input[type=file]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:-1} diff --git a/public/infection-map/assets/index.js b/public/infection-map/assets/index.js index 28418587..33957a83 100644 --- a/public/infection-map/assets/index.js +++ b/public/infection-map/assets/index.js @@ -1,28 +1,28 @@ -var VN=Object.defineProperty;var jN=(t,e,i)=>e in t?VN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var J=(t,e,i)=>jN(t,typeof e!="symbol"?e+"":e,i);function $N(t,e){for(var i=0;is[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=i(n);fetch(n.href,a)}})();/** -* @vue/shared v3.4.38 +var qN=Object.defineProperty;var XN=(t,e,i)=>e in t?qN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var K=(t,e,i)=>XN(t,typeof e!="symbol"?e+"":e,i);function ZN(t,e){for(var i=0;is[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=i(n);fetch(n.href,a)}})();/** +* @vue/shared v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function a1(t,e){const i=new Set(t.split(","));return s=>i.has(s)}const qi={},td=[],oo=()=>{},WN=()=>!1,c0=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),l1=t=>t.startsWith("onUpdate:"),Js=Object.assign,c1=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},HN=Object.prototype.hasOwnProperty,yi=(t,e)=>HN.call(t,e),Ut=Array.isArray,id=t=>Sm(t)==="[object Map]",u0=t=>Sm(t)==="[object Set]",RA=t=>Sm(t)==="[object Date]",ei=t=>typeof t=="function",As=t=>typeof t=="string",ua=t=>typeof t=="symbol",Gi=t=>t!==null&&typeof t=="object",SP=t=>(Gi(t)||ei(t))&&ei(t.then)&&ei(t.catch),EP=Object.prototype.toString,Sm=t=>EP.call(t),qN=t=>Sm(t).slice(8,-1),AP=t=>Sm(t)==="[object Object]",u1=t=>As(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Op=a1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),h0=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},XN=/-(\w)/g,fo=h0(t=>t.replace(XN,(e,i)=>i?i.toUpperCase():"")),ZN=/\B([A-Z])/g,tl=h0(t=>t.replace(ZN,"-$1").toLowerCase()),d0=h0(t=>t.charAt(0).toUpperCase()+t.slice(1)),Bv=h0(t=>t?`on${d0(t)}`:""),gr=(t,e)=>!Object.is(t,e),D_=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:i})},KN=t=>{const e=parseFloat(t);return isNaN(e)?t:e},YN=t=>{const e=As(t)?Number(t):NaN;return isNaN(e)?t:e};let MA;const CP=()=>MA||(MA=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ka(t){if(Ut(t)){const e={};for(let i=0;i{if(i){const s=i.split(GN);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Nn(t){let e="";if(As(t))e=t;else if(Ut(t))for(let i=0;if0(i,e))}const MP=t=>!!(t&&t.__v_isRef===!0),sa=t=>As(t)?t:t==null?"":Ut(t)||Gi(t)&&(t.toString===EP||!ei(t.toString))?MP(t)?sa(t.value):JSON.stringify(t,kP,2):String(t),kP=(t,e)=>MP(e)?kP(t,e.value):id(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[s,n],a)=>(i[Lv(s,a)+" =>"]=n,i),{})}:u0(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>Lv(i))}:ua(e)?Lv(e):Gi(e)&&!Ut(e)&&!AP(e)?String(e):e,Lv=(t,e="")=>{var i;return ua(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** -* @vue/reactivity v3.4.38 +**//*! #__NO_SIDE_EFFECTS__ */function h1(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const Ii={},vf=[],da=()=>{},YN=()=>!1,o0=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),f1=t=>t.startsWith("onUpdate:"),Ds=Object.assign,d1=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},KN=Object.prototype.hasOwnProperty,ki=(t,e)=>KN.call(t,e),Vt=Array.isArray,xf=t=>Og(t)==="[object Map]",a0=t=>Og(t)==="[object Set]",DA=t=>Og(t)==="[object Date]",Gt=t=>typeof t=="function",ws=t=>typeof t=="string",No=t=>typeof t=="symbol",Ki=t=>t!==null&&typeof t=="object",wP=t=>(Ki(t)||Gt(t))&&Gt(t.then)&&Gt(t.catch),TP=Object.prototype.toString,Og=t=>TP.call(t),JN=t=>Og(t).slice(8,-1),SP=t=>Og(t)==="[object Object]",p1=t=>ws(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,jp=h1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),l0=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},GN=/-(\w)/g,Qr=l0(t=>t.replace(GN,(e,i)=>i?i.toUpperCase():"")),QN=/\B([A-Z])/g,rl=l0(t=>t.replace(QN,"-$1").toLowerCase()),c0=l0(t=>t.charAt(0).toUpperCase()+t.slice(1)),Vv=l0(t=>t?`on${c0(t)}`:""),Sr=(t,e)=>!Object.is(t,e),z_=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:i})},eB=t=>{const e=parseFloat(t);return isNaN(e)?t:e},tB=t=>{const e=ws(t)?Number(t):NaN;return isNaN(e)?t:e};let FA;const u0=()=>FA||(FA=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qa(t){if(Vt(t)){const e={};for(let i=0;i{if(i){const s=i.split(sB);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Vn(t){let e="";if(ws(t))e=t;else if(Vt(t))for(let i=0;ih0(i,e))}const CP=t=>!!(t&&t.__v_isRef===!0),la=t=>ws(t)?t:t==null?"":Vt(t)||Ki(t)&&(t.toString===TP||!Gt(t.toString))?CP(t)?la(t.value):JSON.stringify(t,PP,2):String(t),PP=(t,e)=>CP(e)?PP(t,e.value):xf(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[s,n],a)=>(i[jv(s,a)+" =>"]=n,i),{})}:a0(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>jv(i))}:No(e)?jv(e):Ki(e)&&!Vt(e)&&!SP(e)?String(e):e,jv=(t,e="")=>{var i;return No(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** +* @vue/reactivity v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let jr;class OP{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=jr,!e&&jr&&(this.index=(jr.scopes||(jr.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const i=jr;try{return jr=this,e()}finally{jr=i}}}on(){jr=this}off(){jr=this.parent}stop(e){if(this._active){let i,s;for(i=0,s=this.effects.length;i=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),dc()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Zl,i=pu;try{return Zl=!0,pu=this,this._runnings++,kA(this),this.fn()}finally{OA(this),this._runnings--,pu=i,Zl=e}}stop(){this.active&&(kA(this),OA(this),this.onStop&&this.onStop(),this.active=!1)}}function oB(t){return t.value}function kA(t){t._trackId++,t._depsLength=0}function OA(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e{const i=new Map;return i.cleanup=t,i.computed=e,i},Ux=new WeakMap,mu=Symbol(""),Vx=Symbol("");function Tr(t,e,i){if(Zl&&pu){let s=Ux.get(t);s||Ux.set(t,s=new Map);let n=s.get(i);n||s.set(i,n=zP(()=>s.delete(i))),BP(pu,n)}}function Ya(t,e,i,s,n,a){const u=Ux.get(t);if(!u)return;let c=[];if(e==="clear")c=[...u.values()];else if(i==="length"&&Ut(t)){const _=Number(s);u.forEach((w,S)=>{(S==="length"||!ua(S)&&S>=_)&&c.push(w)})}else switch(i!==void 0&&c.push(u.get(i)),e){case"add":Ut(t)?u1(i)&&c.push(u.get("length")):(c.push(u.get(mu)),id(t)&&c.push(u.get(Vx)));break;case"delete":Ut(t)||(c.push(u.get(mu)),id(t)&&c.push(u.get(Vx)));break;case"set":id(t)&&c.push(u.get(mu));break}f1();for(const _ of c)_&&LP(_,4);p1()}const aB=a1("__proto__,__v_isRef,__isVue"),UP=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(ua)),DA=lB();function lB(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...i){const s=wi(this);for(let a=0,u=this.length;a{t[e]=function(...i){hc(),f1();const s=wi(this)[e].apply(this,i);return p1(),dc(),s}}),t}function cB(t){ua(t)||(t=String(t));const e=wi(this);return Tr(e,"has",t),e.hasOwnProperty(t)}class VP{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,s){const n=this._isReadonly,a=this._isShallow;if(i==="__v_isReactive")return!n;if(i==="__v_isReadonly")return n;if(i==="__v_isShallow")return a;if(i==="__v_raw")return s===(n?a?wB:HP:a?WP:$P).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const u=Ut(e);if(!n){if(u&&yi(DA,i))return Reflect.get(DA,i,s);if(i==="hasOwnProperty")return cB}const c=Reflect.get(e,i,s);return(ua(i)?UP.has(i):aB(i))||(n||Tr(e,"get",i),a)?c:zn(c)?u&&u1(i)?c:c.value:Gi(c)?n?qP(c):_1(c):c}}class jP extends VP{constructor(e=!1){super(!1,e)}set(e,i,s,n){let a=e[i];if(!this._isShallow){const _=wu(a);if(!gd(s)&&!wu(s)&&(a=wi(a),s=wi(s)),!Ut(e)&&zn(a)&&!zn(s))return _?!1:(a.value=s,!0)}const u=Ut(e)&&u1(i)?Number(i)t,p0=t=>Reflect.getPrototypeOf(t);function i_(t,e,i=!1,s=!1){t=t.__v_raw;const n=wi(t),a=wi(e);i||(gr(e,a)&&Tr(n,"get",e),Tr(n,"get",a));const{has:u}=p0(n),c=s?m1:i?b1:Jp;if(u.call(n,e))return c(t.get(e));if(u.call(n,a))return c(t.get(a));t!==n&&t.get(e)}function s_(t,e=!1){const i=this.__v_raw,s=wi(i),n=wi(t);return e||(gr(t,n)&&Tr(s,"has",t),Tr(s,"has",n)),t===n?i.has(t):i.has(t)||i.has(n)}function n_(t,e=!1){return t=t.__v_raw,!e&&Tr(wi(t),"iterate",mu),Reflect.get(t,"size",t)}function FA(t,e=!1){!e&&!gd(t)&&!wu(t)&&(t=wi(t));const i=wi(this);return p0(i).has.call(i,t)||(i.add(t),Ya(i,"add",t,t)),this}function NA(t,e,i=!1){!i&&!gd(e)&&!wu(e)&&(e=wi(e));const s=wi(this),{has:n,get:a}=p0(s);let u=n.call(s,t);u||(t=wi(t),u=n.call(s,t));const c=a.call(s,t);return s.set(t,e),u?gr(e,c)&&Ya(s,"set",t,e):Ya(s,"add",t,e),this}function BA(t){const e=wi(this),{has:i,get:s}=p0(e);let n=i.call(e,t);n||(t=wi(t),n=i.call(e,t)),s&&s.call(e,t);const a=e.delete(t);return n&&Ya(e,"delete",t,void 0),a}function LA(){const t=wi(this),e=t.size!==0,i=t.clear();return e&&Ya(t,"clear",void 0,void 0),i}function r_(t,e){return function(s,n){const a=this,u=a.__v_raw,c=wi(u),_=e?m1:t?b1:Jp;return!t&&Tr(c,"iterate",mu),u.forEach((w,S)=>s.call(n,_(w),_(S),a))}}function o_(t,e,i){return function(...s){const n=this.__v_raw,a=wi(n),u=id(a),c=t==="entries"||t===Symbol.iterator&&u,_=t==="keys"&&u,w=n[t](...s),S=i?m1:e?b1:Jp;return!e&&Tr(a,"iterate",_?Vx:mu),{next(){const{value:C,done:P}=w.next();return P?{value:C,done:P}:{value:c?[S(C[0]),S(C[1])]:S(C),done:P}},[Symbol.iterator](){return this}}}}function Il(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function pB(){const t={get(a){return i_(this,a)},get size(){return n_(this)},has:s_,add:FA,set:NA,delete:BA,clear:LA,forEach:r_(!1,!1)},e={get(a){return i_(this,a,!1,!0)},get size(){return n_(this)},has:s_,add(a){return FA.call(this,a,!0)},set(a,u){return NA.call(this,a,u,!0)},delete:BA,clear:LA,forEach:r_(!1,!0)},i={get(a){return i_(this,a,!0)},get size(){return n_(this,!0)},has(a){return s_.call(this,a,!0)},add:Il("add"),set:Il("set"),delete:Il("delete"),clear:Il("clear"),forEach:r_(!0,!1)},s={get(a){return i_(this,a,!0,!0)},get size(){return n_(this,!0)},has(a){return s_.call(this,a,!0)},add:Il("add"),set:Il("set"),delete:Il("delete"),clear:Il("clear"),forEach:r_(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(a=>{t[a]=o_(a,!1,!1),i[a]=o_(a,!0,!1),e[a]=o_(a,!1,!0),s[a]=o_(a,!0,!0)}),[t,i,e,s]}const[mB,gB,_B,yB]=pB();function g1(t,e){const i=e?t?yB:_B:t?gB:mB;return(s,n,a)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?s:Reflect.get(yi(i,n)&&n in s?i:s,n,a)}const bB={get:g1(!1,!1)},vB={get:g1(!1,!0)},xB={get:g1(!0,!1)};const $P=new WeakMap,WP=new WeakMap,HP=new WeakMap,wB=new WeakMap;function TB(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function SB(t){return t.__v_skip||!Object.isExtensible(t)?0:TB(qN(t))}function _1(t){return wu(t)?t:y1(t,!1,hB,bB,$P)}function EB(t){return y1(t,!1,fB,vB,WP)}function qP(t){return y1(t,!0,dB,xB,HP)}function y1(t,e,i,s,n){if(!Gi(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const a=n.get(t);if(a)return a;const u=SB(t);if(u===0)return t;const c=new Proxy(t,u===2?s:i);return n.set(t,c),c}function Dp(t){return wu(t)?Dp(t.__v_raw):!!(t&&t.__v_isReactive)}function wu(t){return!!(t&&t.__v_isReadonly)}function gd(t){return!!(t&&t.__v_isShallow)}function XP(t){return t?!!t.__v_raw:!1}function wi(t){const e=t&&t.__v_raw;return e?wi(e):t}function AB(t){return Object.isExtensible(t)&&IP(t,"__v_skip",!0),t}const Jp=t=>Gi(t)?_1(t):t,b1=t=>Gi(t)?qP(t):t;class ZP{constructor(e,i,s,n){this.getter=e,this._setter=i,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new d1(()=>e(this._value),()=>Fp(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=s}get value(){const e=wi(this);return(!e._cacheable||e.effect.dirty)&&gr(e._value,e._value=e.effect.run())&&Fp(e,4),v1(e),e.effect._dirtyLevel>=2&&Fp(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function IB(t,e,i=!1){let s,n;const a=ei(t);return a?(s=t,n=oo):(s=t.get,n=t.set),new ZP(s,n,a||!n,i)}function v1(t){var e;Zl&&pu&&(t=wi(t),BP(pu,(e=t.dep)!=null?e:t.dep=zP(()=>t.dep=void 0,t instanceof ZP?t:void 0)))}function Fp(t,e=4,i,s){t=wi(t);const n=t.dep;n&&LP(n,e)}function zn(t){return!!(t&&t.__v_isRef===!0)}function Ei(t){return CB(t,!1)}function CB(t,e){return zn(t)?t:new PB(t,e)}class PB{constructor(e,i){this.__v_isShallow=i,this.dep=void 0,this.__v_isRef=!0,this._rawValue=i?e:wi(e),this._value=i?e:Jp(e)}get value(){return v1(this),this._value}set value(e){const i=this.__v_isShallow||gd(e)||wu(e);e=i?e:wi(e),gr(e,this._rawValue)&&(this._rawValue,this._rawValue=e,this._value=i?e:Jp(e),Fp(this,4))}}function Pi(t){return zn(t)?t.value:t}function jx(t){return ei(t)?t():Pi(t)}const RB={get:(t,e,i)=>Pi(Reflect.get(t,e,i)),set:(t,e,i,s)=>{const n=t[e];return zn(n)&&!zn(i)?(n.value=i,!0):Reflect.set(t,e,i,s)}};function KP(t){return Dp(t)?t:new Proxy(t,RB)}class MB{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:i,set:s}=e(()=>v1(this),()=>Fp(this));this._get=i,this._set=s}get value(){return this._get()}set value(e){this._set(e)}}function kB(t){return new MB(t)}/** -* @vue/runtime-core v3.4.38 +**/let tr;class MP{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=tr,!e&&tr&&(this.index=(tr.scopes||(tr.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes)for(e=0,i=this.scopes.length;e0)return;if(Hp){let e=Hp;for(Hp=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;$p;){let e=$p;for($p=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=i}}if(t)throw t}function FP(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function NP(t){let e,i=t.depsTail,s=i;for(;s;){const n=s.prevDep;s.version===-1?(s===i&&(i=n),y1(s),uB(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}t.deps=e,t.depsTail=i}function qx(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(BP(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function BP(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===ng))return;t.globalVersion=ng;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!qx(t)){t.flags&=-3;return}const i=es,s=Oo;es=t,Oo=!0;try{FP(t);const n=t.fn(t._value);(e.version===0||Sr(n,t._value))&&(t._value=n,e.version++)}catch(n){throw e.version++,n}finally{es=i,Oo=s,NP(t),t.flags&=-3}}function y1(t,e=!1){const{dep:i,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),i.subs===t&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let a=i.computed.deps;a;a=a.nextDep)y1(a,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function uB(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let Oo=!0;const LP=[];function vc(){LP.push(Oo),Oo=!1}function xc(){const t=LP.pop();Oo=t===void 0?!0:t}function NA(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=es;es=void 0;try{e()}finally{es=i}}}let ng=0;class hB{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class f0{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!es||!Oo||es===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==es)i=this.activeLink=new hB(es,this),es.deps?(i.prevDep=es.depsTail,es.depsTail.nextDep=i,es.depsTail=i):es.deps=es.depsTail=i,zP(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const s=i.nextDep;s.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=s),i.prevDep=es.depsTail,i.nextDep=void 0,es.depsTail.nextDep=i,es.depsTail=i,es.deps===i&&(es.deps=s)}return i}trigger(e){this.version++,ng++,this.notify(e)}notify(e){m1();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{_1()}}}function zP(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)zP(s)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const Xx=new WeakMap,Su=Symbol(""),Zx=Symbol(""),rg=Symbol("");function Ln(t,e,i){if(Oo&&es){let s=Xx.get(t);s||Xx.set(t,s=new Map);let n=s.get(i);n||(s.set(i,n=new f0),n.map=s,n.key=i),n.track()}}function Ya(t,e,i,s,n,a){const u=Xx.get(t);if(!u){ng++;return}const c=_=>{_&&_.trigger()};if(m1(),e==="clear")u.forEach(c);else{const _=Vt(t),w=_&&p1(i);if(_&&i==="length"){const S=Number(s);u.forEach((A,P)=>{(P==="length"||P===rg||!No(P)&&P>=S)&&c(A)})}else switch((i!==void 0||u.has(void 0))&&c(u.get(i)),w&&c(u.get(rg)),e){case"add":_?w&&c(u.get("length")):(c(u.get(Su)),xf(t)&&c(u.get(Zx)));break;case"delete":_||(c(u.get(Su)),xf(t)&&c(u.get(Zx)));break;case"set":xf(t)&&c(u.get(Su));break}}_1()}function qh(t){const e=Ti(t);return e===t?e:(Ln(e,"iterate",rg),go(t)?e:e.map(zn))}function d0(t){return Ln(t=Ti(t),"iterate",rg),t}const fB={__proto__:null,[Symbol.iterator](){return Hv(this,Symbol.iterator,zn)},concat(...t){return qh(this).concat(...t.map(e=>Vt(e)?qh(e):e))},entries(){return Hv(this,"entries",t=>(t[1]=zn(t[1]),t))},every(t,e){return Ha(this,"every",t,e,void 0,arguments)},filter(t,e){return Ha(this,"filter",t,e,i=>i.map(zn),arguments)},find(t,e){return Ha(this,"find",t,e,zn,arguments)},findIndex(t,e){return Ha(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Ha(this,"findLast",t,e,zn,arguments)},findLastIndex(t,e){return Ha(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Ha(this,"forEach",t,e,void 0,arguments)},includes(...t){return Wv(this,"includes",t)},indexOf(...t){return Wv(this,"indexOf",t)},join(t){return qh(this).join(t)},lastIndexOf(...t){return Wv(this,"lastIndexOf",t)},map(t,e){return Ha(this,"map",t,e,void 0,arguments)},pop(){return wp(this,"pop")},push(...t){return wp(this,"push",t)},reduce(t,...e){return BA(this,"reduce",t,e)},reduceRight(t,...e){return BA(this,"reduceRight",t,e)},shift(){return wp(this,"shift")},some(t,e){return Ha(this,"some",t,e,void 0,arguments)},splice(...t){return wp(this,"splice",t)},toReversed(){return qh(this).toReversed()},toSorted(t){return qh(this).toSorted(t)},toSpliced(...t){return qh(this).toSpliced(...t)},unshift(...t){return wp(this,"unshift",t)},values(){return Hv(this,"values",zn)}};function Hv(t,e,i){const s=d0(t),n=s[e]();return s!==t&&!go(t)&&(n._next=n.next,n.next=()=>{const a=n._next();return a.value&&(a.value=i(a.value)),a}),n}const dB=Array.prototype;function Ha(t,e,i,s,n,a){const u=d0(t),c=u!==t&&!go(t),_=u[e];if(_!==dB[e]){const A=_.apply(t,a);return c?zn(A):A}let w=i;u!==t&&(c?w=function(A,P){return i.call(this,zn(A),P,t)}:i.length>2&&(w=function(A,P){return i.call(this,A,P,t)}));const S=_.call(u,w,s);return c&&n?n(S):S}function BA(t,e,i,s){const n=d0(t);let a=i;return n!==t&&(go(t)?i.length>3&&(a=function(u,c,_){return i.call(this,u,c,_,t)}):a=function(u,c,_){return i.call(this,u,zn(c),_,t)}),n[e](a,...s)}function Wv(t,e,i){const s=Ti(t);Ln(s,"iterate",rg);const n=s[e](...i);return(n===-1||n===!1)&&w1(i[0])?(i[0]=Ti(i[0]),s[e](...i)):n}function wp(t,e,i=[]){vc(),m1();const s=Ti(t)[e].apply(t,i);return _1(),xc(),s}const pB=h1("__proto__,__v_isRef,__isVue"),UP=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(No));function gB(t){No(t)||(t=String(t));const e=Ti(this);return Ln(e,"has",t),e.hasOwnProperty(t)}class VP{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,s){const n=this._isReadonly,a=this._isShallow;if(i==="__v_isReactive")return!n;if(i==="__v_isReadonly")return n;if(i==="__v_isShallow")return a;if(i==="__v_raw")return s===(n?a?EB:WP:a?HP:$P).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const u=Vt(e);if(!n){let _;if(u&&(_=fB[i]))return _;if(i==="hasOwnProperty")return gB}const c=Reflect.get(e,i,dn(e)?e:s);return(No(i)?UP.has(i):pB(i))||(n||Ln(e,"get",i),a)?c:dn(c)?u&&p1(i)?c:c.value:Ki(c)?n?qP(c):v1(c):c}}class jP extends VP{constructor(e=!1){super(!1,e)}set(e,i,s,n){let a=e[i];if(!this._isShallow){const _=ku(a);if(!go(s)&&!ku(s)&&(a=Ti(a),s=Ti(s)),!Vt(e)&&dn(a)&&!dn(s))return _?!1:(a.value=s,!0)}const u=Vt(e)&&p1(i)?Number(i)t,c_=t=>Reflect.getPrototypeOf(t);function vB(t,e,i){return function(...s){const n=this.__v_raw,a=Ti(n),u=xf(a),c=t==="entries"||t===Symbol.iterator&&u,_=t==="keys"&&u,w=n[t](...s),S=i?Yx:e?Kx:zn;return!e&&Ln(a,"iterate",_?Zx:Su),{next(){const{value:A,done:P}=w.next();return P?{value:A,done:P}:{value:c?[S(A[0]),S(A[1])]:S(A),done:P}},[Symbol.iterator](){return this}}}}function u_(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function xB(t,e){const i={get(n){const a=this.__v_raw,u=Ti(a),c=Ti(n);t||(Sr(n,c)&&Ln(u,"get",n),Ln(u,"get",c));const{has:_}=c_(u),w=e?Yx:t?Kx:zn;if(_.call(u,n))return w(a.get(n));if(_.call(u,c))return w(a.get(c));a!==u&&a.get(n)},get size(){const n=this.__v_raw;return!t&&Ln(Ti(n),"iterate",Su),Reflect.get(n,"size",n)},has(n){const a=this.__v_raw,u=Ti(a),c=Ti(n);return t||(Sr(n,c)&&Ln(u,"has",n),Ln(u,"has",c)),n===c?a.has(n):a.has(n)||a.has(c)},forEach(n,a){const u=this,c=u.__v_raw,_=Ti(c),w=e?Yx:t?Kx:zn;return!t&&Ln(_,"iterate",Su),c.forEach((S,A)=>n.call(a,w(S),w(A),u))}};return Ds(i,t?{add:u_("add"),set:u_("set"),delete:u_("delete"),clear:u_("clear")}:{add(n){!e&&!go(n)&&!ku(n)&&(n=Ti(n));const a=Ti(this);return c_(a).has.call(a,n)||(a.add(n),Ya(a,"add",n,n)),this},set(n,a){!e&&!go(a)&&!ku(a)&&(a=Ti(a));const u=Ti(this),{has:c,get:_}=c_(u);let w=c.call(u,n);w||(n=Ti(n),w=c.call(u,n));const S=_.call(u,n);return u.set(n,a),w?Sr(a,S)&&Ya(u,"set",n,a):Ya(u,"add",n,a),this},delete(n){const a=Ti(this),{has:u,get:c}=c_(a);let _=u.call(a,n);_||(n=Ti(n),_=u.call(a,n)),c&&c.call(a,n);const w=a.delete(n);return _&&Ya(a,"delete",n,void 0),w},clear(){const n=Ti(this),a=n.size!==0,u=n.clear();return a&&Ya(n,"clear",void 0,void 0),u}}),["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=vB(n,t,e)}),i}function b1(t,e){const i=xB(t,e);return(s,n,a)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?s:Reflect.get(ki(i,n)&&n in s?i:s,n,a)}const wB={get:b1(!1,!1)},TB={get:b1(!1,!0)},SB={get:b1(!0,!1)};const $P=new WeakMap,HP=new WeakMap,WP=new WeakMap,EB=new WeakMap;function AB(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function IB(t){return t.__v_skip||!Object.isExtensible(t)?0:AB(JN(t))}function v1(t){return ku(t)?t:x1(t,!1,_B,wB,$P)}function CB(t){return x1(t,!1,bB,TB,HP)}function qP(t){return x1(t,!0,yB,SB,WP)}function x1(t,e,i,s,n){if(!Ki(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const a=n.get(t);if(a)return a;const u=IB(t);if(u===0)return t;const c=new Proxy(t,u===2?s:i);return n.set(t,c),c}function wf(t){return ku(t)?wf(t.__v_raw):!!(t&&t.__v_isReactive)}function ku(t){return!!(t&&t.__v_isReadonly)}function go(t){return!!(t&&t.__v_isShallow)}function w1(t){return t?!!t.__v_raw:!1}function Ti(t){const e=t&&t.__v_raw;return e?Ti(e):t}function PB(t){return!ki(t,"__v_skip")&&Object.isExtensible(t)&&EP(t,"__v_skip",!0),t}const zn=t=>Ki(t)?v1(t):t,Kx=t=>Ki(t)?qP(t):t;function dn(t){return t?t.__v_isRef===!0:!1}function Ci(t){return MB(t,!1)}function MB(t,e){return dn(t)?t:new RB(t,e)}class RB{constructor(e,i){this.dep=new f0,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Ti(e),this._value=i?e:zn(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,s=this.__v_isShallow||go(e)||ku(e);e=s?e:Ti(e),Sr(e,i)&&(this._rawValue=e,this._value=s?e:zn(e),this.dep.trigger())}}function Oi(t){return dn(t)?t.value:t}function Jx(t){return Gt(t)?t():Oi(t)}const kB={get:(t,e,i)=>e==="__v_raw"?t:Oi(Reflect.get(t,e,i)),set:(t,e,i,s)=>{const n=t[e];return dn(n)&&!dn(i)?(n.value=i,!0):Reflect.set(t,e,i,s)}};function XP(t){return wf(t)?t:new Proxy(t,kB)}class OB{constructor(e){this.__v_isRef=!0,this._value=void 0;const i=this.dep=new f0,{get:s,set:n}=e(i.track.bind(i),i.trigger.bind(i));this._get=s,this._set=n}get value(){return this._value=this._get()}set value(e){this._set(e)}}function DB(t){return new OB(t)}class FB{constructor(e,i,s){this.fn=e,this.setter=i,this._value=void 0,this.dep=new f0(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ng-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&es!==this)return DP(this,!0),!0}get value(){const e=this.dep.track();return BP(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function NB(t,e,i=!1){let s,n;return Gt(t)?s=t:(s=t.get,n=t.set),new FB(s,n,i)}const h_={},ty=new WeakMap;let uu;function BB(t,e=!1,i=uu){if(i){let s=ty.get(i);s||ty.set(i,s=[]),s.push(t)}}function LB(t,e,i=Ii){const{immediate:s,deep:n,once:a,scheduler:u,augmentJob:c,call:_}=i,w=fe=>n?fe:go(fe)||n===!1||n===0?Ka(fe,1):Ka(fe);let S,A,P,D,U=!1,L=!1;if(dn(t)?(A=()=>t.value,U=go(t)):wf(t)?(A=()=>w(t),U=!0):Vt(t)?(L=!0,U=t.some(fe=>wf(fe)||go(fe)),A=()=>t.map(fe=>{if(dn(fe))return fe.value;if(wf(fe))return w(fe);if(Gt(fe))return _?_(fe,2):fe()})):Gt(t)?e?A=_?()=>_(t,2):t:A=()=>{if(P){vc();try{P()}finally{xc()}}const fe=uu;uu=S;try{return _?_(t,3,[D]):t(D)}finally{uu=fe}}:A=da,e&&n){const fe=A,Se=n===!0?1/0:n;A=()=>Ka(fe(),Se)}const W=g1(),ee=()=>{S.stop(),W&&d1(W.effects,S)};if(a&&e){const fe=e;e=(...Se)=>{fe(...Se),ee()}}let G=L?new Array(t.length).fill(h_):h_;const se=fe=>{if(!(!(S.flags&1)||!S.dirty&&!fe))if(e){const Se=S.run();if(n||U||(L?Se.some((Te,Fe)=>Sr(Te,G[Fe])):Sr(Se,G))){P&&P();const Te=uu;uu=S;try{const Fe=[Se,G===h_?void 0:L&&G[0]===h_?[]:G,D];_?_(e,3,Fe):e(...Fe),G=Se}finally{uu=Te}}}else S.run()};return c&&c(se),S=new kP(A),S.scheduler=u?()=>u(se,!1):se,D=fe=>BB(fe,!1,S),P=S.onStop=()=>{const fe=ty.get(S);if(fe){if(_)_(fe,4);else for(const Se of fe)Se();ty.delete(S)}},e?s?se(!0):G=S.run():u?u(se.bind(null,!0),!0):S.run(),ee.pause=S.pause.bind(S),ee.resume=S.resume.bind(S),ee.stop=ee,ee}function Ka(t,e=1/0,i){if(e<=0||!Ki(t)||t.__v_skip||(i=i||new Set,i.has(t)))return t;if(i.add(t),e--,dn(t))Ka(t.value,e,i);else if(Vt(t))for(let s=0;s{Ka(s,e,i)});else if(SP(t)){for(const s in t)Ka(t[s],e,i);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Ka(t[s],e,i)}return t}/** +* @vue/runtime-core v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Kl(t,e,i,s){try{return s?t(...s):t()}catch(n){m0(n,e,i)}}function lo(t,e,i,s){if(ei(t)){const n=Kl(t,e,i,s);return n&&SP(n)&&n.catch(a=>{m0(a,e,i)}),n}if(Ut(t)){const n=[];for(let a=0;a>>1,n=Bn[s],a=Qp(n);ata&&Bn.splice(e,1)}function NB(t){Ut(t)?sd.push(...t):(!Fl||!Fl.includes(t,t.allowRecurse?iu+1:iu))&&sd.push(t),JP()}function zA(t,e,i=Gp?ta+1:0){for(;iQp(i)-Qp(s));if(sd.length=0,Fl){Fl.push(...e);return}for(Fl=e,iu=0;iut.id==null?1/0:t.id,BB=(t,e)=>{const i=Qp(t)-Qp(e);if(i===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return i};function QP(t){$x=!1,Gp=!0,Bn.sort(BB);try{for(ta=0;ta{s._d&&YA(-1);const a=K_(e);let u;try{u=t(...n)}finally{K_(a),s._d&&YA(1)}return u};return s._n=!0,s._c=!0,s._d=!0,s}function eR(t,e){if(fn===null)return t;const i=T0(fn),s=t.dirs||(t.dirs=[]);for(let n=0;n{t.isMounted=!0}),S1(()=>{t.isUnmounting=!0}),t}const ro=[Function,Array],tR={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ro,onEnter:ro,onAfterEnter:ro,onEnterCancelled:ro,onBeforeLeave:ro,onLeave:ro,onAfterLeave:ro,onLeaveCancelled:ro,onBeforeAppear:ro,onAppear:ro,onAfterAppear:ro,onAppearCancelled:ro},iR=t=>{const e=t.subTree;return e.component?iR(e.component):e},VB={name:"BaseTransition",props:tR,setup(t,{slots:e}){const i=Am(),s=UB();return()=>{const n=e.default&&nR(e.default(),!0);if(!n||!n.length)return;let a=n[0];if(n.length>1){for(const P of n)if(P.type!==br){a=P;break}}const u=wi(t),{mode:c}=u;if(s.isLeaving)return zv(a);const _=UA(a);if(!_)return zv(a);let w=Wx(_,u,s,i,P=>w=P);Y_(_,w);const S=i.subTree,C=S&&UA(S);if(C&&C.type!==br&&!su(_,C)&&iR(i).type!==br){const P=Wx(C,u,s,i);if(Y_(C,P),c==="out-in"&&_.type!==br)return s.isLeaving=!0,P.afterLeave=()=>{s.isLeaving=!1,i.update.active!==!1&&(i.effect.dirty=!0,i.update())},zv(a);c==="in-out"&&_.type!==br&&(P.delayLeave=(D,j,L)=>{const H=sR(s,C);H[String(C.key)]=C,D[Nl]=()=>{j(),D[Nl]=void 0,delete w.delayedLeave},w.delayedLeave=L})}return a}}},jB=VB;function sR(t,e){const{leavingVNodes:i}=t;let s=i.get(e.type);return s||(s=Object.create(null),i.set(e.type,s)),s}function Wx(t,e,i,s,n){const{appear:a,mode:u,persisted:c=!1,onBeforeEnter:_,onEnter:w,onAfterEnter:S,onEnterCancelled:C,onBeforeLeave:P,onLeave:D,onAfterLeave:j,onLeaveCancelled:L,onBeforeAppear:H,onAppear:te,onAfterAppear:G,onAppearCancelled:se}=e,ve=String(t.key),Se=sR(i,t),ge=(Be,Qe)=>{Be&&lo(Be,s,9,Qe)},De=(Be,Qe)=>{const He=Qe[1];ge(Be,Qe),Ut(Be)?Be.every(Xe=>Xe.length<=1)&&He():Be.length<=1&&He()},Fe={mode:u,persisted:c,beforeEnter(Be){let Qe=_;if(!i.isMounted)if(a)Qe=H||_;else return;Be[Nl]&&Be[Nl](!0);const He=Se[ve];He&&su(t,He)&&He.el[Nl]&&He.el[Nl](),ge(Qe,[Be])},enter(Be){let Qe=w,He=S,Xe=C;if(!i.isMounted)if(a)Qe=te||w,He=G||S,Xe=se||C;else return;let dt=!1;const yt=Be[a_]=Ft=>{dt||(dt=!0,Ft?ge(Xe,[Be]):ge(He,[Be]),Fe.delayedLeave&&Fe.delayedLeave(),Be[a_]=void 0)};Qe?De(Qe,[Be,yt]):yt()},leave(Be,Qe){const He=String(t.key);if(Be[a_]&&Be[a_](!0),i.isUnmounting)return Qe();ge(P,[Be]);let Xe=!1;const dt=Be[Nl]=yt=>{Xe||(Xe=!0,Qe(),yt?ge(L,[Be]):ge(j,[Be]),Be[Nl]=void 0,Se[He]===t&&delete Se[He])};Se[He]=t,D?De(D,[Be,dt]):dt()},clone(Be){const Qe=Wx(Be,e,i,s,n);return n&&n(Qe),Qe}};return Fe}function zv(t){if(_0(t))return t=ic(t),t.children=null,t}function UA(t){if(!_0(t))return t;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&ei(i.default))return i.default()}}function Y_(t,e){t.shapeFlag&6&&t.component?Y_(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function nR(t,e=!1,i){let s=[],n=0;for(let a=0;a1)for(let a=0;a!!t.type.__asyncLoader,_0=t=>t.type.__isKeepAlive;function $B(t,e){rR(t,"a",e)}function WB(t,e){rR(t,"da",e)}function rR(t,e,i=Tn){const s=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(y0(e,s,i),i){let n=i.parent;for(;n&&n.parent;)_0(n.parent.vnode)&&HB(s,e,i,n),n=n.parent}}function HB(t,e,i,s){const n=y0(e,t,s,!0);E1(()=>{c1(s[e],n)},i)}function y0(t,e,i=Tn,s=!1){if(i){const n=i[t]||(i[t]=[]),a=e.__weh||(e.__weh=(...u)=>{hc();const c=Im(i),_=lo(e,i,t,u);return c(),dc(),_});return s?n.unshift(a):n.push(a),a}}const il=t=>(e,i=Tn)=>{(!w0||t==="sp")&&y0(t,(...s)=>e(...s),i)},qB=il("bm"),T1=il("m"),XB=il("bu"),ZB=il("u"),S1=il("bum"),E1=il("um"),KB=il("sp"),YB=il("rtg"),JB=il("rtc");function GB(t,e=Tn){y0("ec",t,e)}const oR="components";function Uv(t,e){return lR(oR,t,!0,e)||t}const aR=Symbol.for("v-ndc");function QB(t){return As(t)?lR(oR,t,!1)||t:t||aR}function lR(t,e,i=!0,s=!1){const n=fn||Tn;if(n){const a=n.type;{const c=$L(a,!1);if(c&&(c===e||c===fo(e)||c===d0(fo(e))))return a}const u=VA(n[t]||a[t],e)||VA(n.appContext[t],e);return!u&&s?a:u}}function VA(t,e){return t&&(t[e]||t[fo(e)]||t[d0(fo(e))])}function Hx(t,e,i,s){let n;const a=i;if(Ut(t)||As(t)){n=new Array(t.length);for(let u=0,c=t.length;ue(u,c,void 0,a));else{const u=Object.keys(t);n=new Array(u.length);for(let c=0,_=u.length;c<_;c++){const w=u[c];n[c]=e(t[w],w,c,a)}}else n=[];return n}function Tu(t,e,i={},s,n){if(fn.isCE||fn.parent&&Np(fn.parent)&&fn.parent.isCE)return e!=="default"&&(i.name=e),Ys("slot",i,s&&s());let a=t[e];a&&a._c&&(a._d=!1),us();const u=a&&cR(a(i)),c=tc(ir,{key:(i.key||u&&u.key||`_${e}`)+(!u&&s?"_fb":"")},u||(s?s():[]),u&&t._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),a&&a._c&&(a._d=!0),c}function cR(t){return t.some(e=>ey(e)?!(e.type===br||e.type===ir&&!cR(e.children)):!0)?t:null}const qx=t=>t?MR(t)?T0(t):qx(t.parent):null,Bp=Js(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>qx(t.parent),$root:t=>qx(t.root),$emit:t=>t.emit,$options:t=>A1(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,w1(t.update)}),$nextTick:t=>t.n||(t.n=nd.bind(t.proxy)),$watch:t=>EL.bind(t)}),Vv=(t,e)=>t!==qi&&!t.__isScriptSetup&&yi(t,e),eL={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:s,data:n,props:a,accessCache:u,type:c,appContext:_}=t;let w;if(e[0]!=="$"){const D=u[e];if(D!==void 0)switch(D){case 1:return s[e];case 2:return n[e];case 4:return i[e];case 3:return a[e]}else{if(Vv(s,e))return u[e]=1,s[e];if(n!==qi&&yi(n,e))return u[e]=2,n[e];if((w=t.propsOptions[0])&&yi(w,e))return u[e]=3,a[e];if(i!==qi&&yi(i,e))return u[e]=4,i[e];Xx&&(u[e]=0)}}const S=Bp[e];let C,P;if(S)return e==="$attrs"&&Tr(t.attrs,"get",""),S(t);if((C=c.__cssModules)&&(C=C[e]))return C;if(i!==qi&&yi(i,e))return u[e]=4,i[e];if(P=_.config.globalProperties,yi(P,e))return P[e]},set({_:t},e,i){const{data:s,setupState:n,ctx:a}=t;return Vv(n,e)?(n[e]=i,!0):s!==qi&&yi(s,e)?(s[e]=i,!0):yi(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(a[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:s,appContext:n,propsOptions:a}},u){let c;return!!i[u]||t!==qi&&yi(t,u)||Vv(e,u)||(c=a[0])&&yi(c,u)||yi(s,u)||yi(Bp,u)||yi(n.config.globalProperties,u)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:yi(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function J_(t){return Ut(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}function G_(t,e){return!t||!e?t||e:Ut(t)&&Ut(e)?t.concat(e):Js({},J_(t),J_(e))}let Xx=!0;function tL(t){const e=A1(t),i=t.proxy,s=t.ctx;Xx=!1,e.beforeCreate&&jA(e.beforeCreate,t,"bc");const{data:n,computed:a,methods:u,watch:c,provide:_,inject:w,created:S,beforeMount:C,mounted:P,beforeUpdate:D,updated:j,activated:L,deactivated:H,beforeDestroy:te,beforeUnmount:G,destroyed:se,unmounted:ve,render:Se,renderTracked:ge,renderTriggered:De,errorCaptured:Fe,serverPrefetch:Be,expose:Qe,inheritAttrs:He,components:Xe,directives:dt,filters:yt}=e;if(w&&iL(w,s,null),u)for(const kt in u){const Yt=u[kt];ei(Yt)&&(s[kt]=Yt.bind(i))}if(n){const kt=n.call(i,i);Gi(kt)&&(t.data=_1(kt))}if(Xx=!0,a)for(const kt in a){const Yt=a[kt],bi=ei(Yt)?Yt.bind(i,i):ei(Yt.get)?Yt.get.bind(i,i):oo,Jt=!ei(Yt)&&ei(Yt.set)?Yt.set.bind(i):oo,pi=Lt({get:bi,set:Jt});Object.defineProperty(s,kt,{enumerable:!0,configurable:!0,get:()=>pi.value,set:mi=>pi.value=mi})}if(c)for(const kt in c)uR(c[kt],s,i,kt);if(_){const kt=ei(_)?_.call(i):_;Reflect.ownKeys(kt).forEach(Yt=>{dR(Yt,kt[Yt])})}S&&jA(S,t,"c");function jt(kt,Yt){Ut(Yt)?Yt.forEach(bi=>kt(bi.bind(i))):Yt&&kt(Yt.bind(i))}if(jt(qB,C),jt(T1,P),jt(XB,D),jt(ZB,j),jt($B,L),jt(WB,H),jt(GB,Fe),jt(JB,ge),jt(YB,De),jt(S1,G),jt(E1,ve),jt(KB,Be),Ut(Qe))if(Qe.length){const kt=t.exposed||(t.exposed={});Qe.forEach(Yt=>{Object.defineProperty(kt,Yt,{get:()=>i[Yt],set:bi=>i[Yt]=bi})})}else t.exposed||(t.exposed={});Se&&t.render===oo&&(t.render=Se),He!=null&&(t.inheritAttrs=He),Xe&&(t.components=Xe),dt&&(t.directives=dt)}function iL(t,e,i=oo){Ut(t)&&(t=Zx(t));for(const s in t){const n=t[s];let a;Gi(n)?"default"in n?a=ad(n.from||s,n.default,!0):a=ad(n.from||s):a=ad(n),zn(a)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:u=>a.value=u}):e[s]=a}}function jA(t,e,i){lo(Ut(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,i)}function uR(t,e,i,s){const n=s.includes(".")?AR(i,s):()=>i[s];if(As(t)){const a=e[t];ei(a)&&sr(n,a)}else if(ei(t))sr(n,t.bind(i));else if(Gi(t))if(Ut(t))t.forEach(a=>uR(a,e,i,s));else{const a=ei(t.handler)?t.handler.bind(i):e[t.handler];ei(a)&&sr(n,a,t)}}function A1(t){const e=t.type,{mixins:i,extends:s}=e,{mixins:n,optionsCache:a,config:{optionMergeStrategies:u}}=t.appContext,c=a.get(e);let _;return c?_=c:!n.length&&!i&&!s?_=e:(_={},n.length&&n.forEach(w=>Q_(_,w,u,!0)),Q_(_,e,u)),Gi(e)&&a.set(e,_),_}function Q_(t,e,i,s=!1){const{mixins:n,extends:a}=e;a&&Q_(t,a,i,!0),n&&n.forEach(u=>Q_(t,u,i,!0));for(const u in e)if(!(s&&u==="expose")){const c=sL[u]||i&&i[u];t[u]=c?c(t[u],e[u]):e[u]}return t}const sL={data:$A,props:WA,emits:WA,methods:Ip,computed:Ip,beforeCreate:Gn,created:Gn,beforeMount:Gn,mounted:Gn,beforeUpdate:Gn,updated:Gn,beforeDestroy:Gn,beforeUnmount:Gn,destroyed:Gn,unmounted:Gn,activated:Gn,deactivated:Gn,errorCaptured:Gn,serverPrefetch:Gn,components:Ip,directives:Ip,watch:rL,provide:$A,inject:nL};function $A(t,e){return e?t?function(){return Js(ei(t)?t.call(this,this):t,ei(e)?e.call(this,this):e)}:e:t}function nL(t,e){return Ip(Zx(t),Zx(e))}function Zx(t){if(Ut(t)){const e={};for(let i=0;i1)return i&&ei(e)?e.call(s&&s.proxy):e}}const fR={},pR=()=>Object.create(fR),mR=t=>Object.getPrototypeOf(t)===fR;function lL(t,e,i,s=!1){const n={},a=pR();t.propsDefaults=Object.create(null),gR(t,e,n,a);for(const u in t.propsOptions[0])u in n||(n[u]=void 0);i?t.props=s?n:EB(n):t.type.props?t.props=n:t.props=a,t.attrs=a}function cL(t,e,i,s){const{props:n,attrs:a,vnode:{patchFlag:u}}=t,c=wi(n),[_]=t.propsOptions;let w=!1;if((s||u>0)&&!(u&16)){if(u&8){const S=t.vnode.dynamicProps;for(let C=0;C{_=!0;const[P,D]=_R(C,e,!0);Js(u,P),D&&c.push(...D)};!i&&e.mixins.length&&e.mixins.forEach(S),t.extends&&S(t.extends),t.mixins&&t.mixins.forEach(S)}if(!a&&!_)return Gi(t)&&s.set(t,td),td;if(Ut(a))for(let S=0;St[0]==="_"||t==="$stable",I1=t=>Ut(t)?t.map(Qo):[Qo(t)],hL=(t,e,i)=>{if(e._n)return e;const s=rd((...n)=>I1(e(...n)),i);return s._c=!1,s},bR=(t,e,i)=>{const s=t._ctx;for(const n in t){if(yR(n))continue;const a=t[n];if(ei(a))e[n]=hL(n,a,s);else if(a!=null){const u=I1(a);e[n]=()=>u}}},vR=(t,e)=>{const i=I1(e);t.slots.default=()=>i},xR=(t,e,i)=>{for(const s in e)(i||s!=="_")&&(t[s]=e[s])},dL=(t,e,i)=>{const s=t.slots=pR();if(t.vnode.shapeFlag&32){const n=e._;n?(xR(s,e,i),i&&IP(s,"_",n,!0)):bR(e,s)}else e&&vR(t,e)},fL=(t,e,i)=>{const{vnode:s,slots:n}=t;let a=!0,u=qi;if(s.shapeFlag&32){const c=e._;c?i&&c===1?a=!1:xR(n,e,i):(a=!e.$stable,bR(e,n)),u=e}else e&&(vR(t,e),u={default:1});if(a)for(const c in n)!yR(c)&&u[c]==null&&delete n[c]};function Yx(t,e,i,s,n=!1){if(Ut(t)){t.forEach((P,D)=>Yx(P,e&&(Ut(e)?e[D]:e),i,s,n));return}if(Np(s)&&!n)return;const a=s.shapeFlag&4?T0(s.component):s.el,u=n?null:a,{i:c,r:_}=t,w=e&&e.r,S=c.refs===qi?c.refs={}:c.refs,C=c.setupState;if(w!=null&&w!==_&&(As(w)?(S[w]=null,yi(C,w)&&(C[w]=null)):zn(w)&&(w.value=null)),ei(_))Kl(_,c,12,[u,S]);else{const P=As(_),D=zn(_);if(P||D){const j=()=>{if(t.f){const L=P?yi(C,_)?C[_]:S[_]:_.value;n?Ut(L)&&c1(L,a):Ut(L)?L.includes(a)||L.push(a):P?(S[_]=[a],yi(C,_)&&(C[_]=S[_])):(_.value=[a],t.k&&(S[t.k]=_.value))}else P?(S[_]=u,yi(C,_)&&(C[_]=u)):D&&(_.value=u,t.k&&(S[t.k]=u))};u?(j.id=-1,pr(j,i)):j()}}}const wR=Symbol("_vte"),pL=t=>t.__isTeleport,Lp=t=>t&&(t.disabled||t.disabled===""),qA=t=>typeof SVGElement<"u"&&t instanceof SVGElement,XA=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Jx=(t,e)=>{const i=t&&t.to;return As(i)?e?e(i):null:i},mL={name:"Teleport",__isTeleport:!0,process(t,e,i,s,n,a,u,c,_,w){const{mc:S,pc:C,pbc:P,o:{insert:D,querySelector:j,createText:L,createComment:H}}=w,te=Lp(e.props);let{shapeFlag:G,children:se,dynamicChildren:ve}=e;if(t==null){const Se=e.el=L(""),ge=e.anchor=L("");D(Se,i,s),D(ge,i,s);const De=e.target=Jx(e.props,j),Fe=SR(De,e,L,D);De&&(u==="svg"||qA(De)?u="svg":(u==="mathml"||XA(De))&&(u="mathml"));const Be=(Qe,He)=>{G&16&&S(se,Qe,He,n,a,u,c,_)};te?Be(i,ge):De&&Be(De,Fe)}else{e.el=t.el,e.targetStart=t.targetStart;const Se=e.anchor=t.anchor,ge=e.target=t.target,De=e.targetAnchor=t.targetAnchor,Fe=Lp(t.props),Be=Fe?i:ge,Qe=Fe?Se:De;if(u==="svg"||qA(ge)?u="svg":(u==="mathml"||XA(ge))&&(u="mathml"),ve?(P(t.dynamicChildren,ve,Be,n,a,u,c),C1(t,e,!0)):_||C(t,e,Be,Qe,n,a,u,c,!1),te)Fe?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):l_(e,i,Se,w,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const He=e.target=Jx(e.props,j);He&&l_(e,He,null,w,0)}else Fe&&l_(e,ge,De,w,1)}TR(e)},remove(t,e,i,{um:s,o:{remove:n}},a){const{shapeFlag:u,children:c,anchor:_,targetStart:w,targetAnchor:S,target:C,props:P}=t;if(C&&(n(w),n(S)),a&&n(_),u&16){const D=a||!Lp(P);for(let j=0;j{if(pe===xe)return;pe&&!su(pe,xe)&&(he=hi(pe),mi(pe,qe,it,!0),pe=null),xe.patchFlag===-2&&(st=!1,xe.dynamicChildren=null);const{type:Ye,ref:_t,shapeFlag:Rt}=xe;switch(Ye){case v0:H(pe,xe,Ue,he);break;case br:te(pe,xe,Ue,he);break;case Wv:pe==null&&G(xe,Ue,he,Ze);break;case ir:Xe(pe,xe,Ue,he,qe,it,Ze,Ke,st);break;default:Rt&1?Se(pe,xe,Ue,he,qe,it,Ze,Ke,st):Rt&6?dt(pe,xe,Ue,he,qe,it,Ze,Ke,st):(Rt&64||Rt&128)&&Ye.process(pe,xe,Ue,he,qe,it,Ze,Ke,st,Ii)}_t!=null&&qe&&Yx(_t,pe&&pe.ref,it,xe||pe,!xe)},H=(pe,xe,Ue,he)=>{if(pe==null)s(xe.el=c(xe.children),Ue,he);else{const qe=xe.el=pe.el;xe.children!==pe.children&&w(qe,xe.children)}},te=(pe,xe,Ue,he)=>{pe==null?s(xe.el=_(xe.children||""),Ue,he):xe.el=pe.el},G=(pe,xe,Ue,he)=>{[pe.el,pe.anchor]=j(pe.children,xe,Ue,he,pe.el,pe.anchor)},se=({el:pe,anchor:xe},Ue,he)=>{let qe;for(;pe&&pe!==xe;)qe=P(pe),s(pe,Ue,he),pe=qe;s(xe,Ue,he)},ve=({el:pe,anchor:xe})=>{let Ue;for(;pe&&pe!==xe;)Ue=P(pe),n(pe),pe=Ue;n(xe)},Se=(pe,xe,Ue,he,qe,it,Ze,Ke,st)=>{xe.type==="svg"?Ze="svg":xe.type==="math"&&(Ze="mathml"),pe==null?ge(xe,Ue,he,qe,it,Ze,Ke,st):Be(pe,xe,qe,it,Ze,Ke,st)},ge=(pe,xe,Ue,he,qe,it,Ze,Ke)=>{let st,Ye;const{props:_t,shapeFlag:Rt,transition:St,dirs:$t}=pe;if(st=pe.el=u(pe.type,it,_t&&_t.is,_t),Rt&8?S(st,pe.children):Rt&16&&Fe(pe.children,st,null,he,qe,jv(pe,it),Ze,Ke),$t&&Zc(pe,null,he,"created"),De(st,pe,pe.scopeId,Ze,he),_t){for(const je in _t)je!=="value"&&!Op(je)&&a(st,je,null,_t[je],it,he);"value"in _t&&a(st,"value",null,_t.value,it),(Ye=_t.onVnodeBeforeMount)&&Xo(Ye,he,pe)}$t&&Zc(pe,null,he,"beforeMount");const Kt=vL(qe,St);Kt&&St.beforeEnter(st),s(st,xe,Ue),((Ye=_t&&_t.onVnodeMounted)||Kt||$t)&&pr(()=>{Ye&&Xo(Ye,he,pe),Kt&&St.enter(st),$t&&Zc(pe,null,he,"mounted")},qe)},De=(pe,xe,Ue,he,qe)=>{if(Ue&&D(pe,Ue),he)for(let it=0;it{for(let Ye=st;Ye{const Ke=xe.el=pe.el;let{patchFlag:st,dynamicChildren:Ye,dirs:_t}=xe;st|=pe.patchFlag&16;const Rt=pe.props||qi,St=xe.props||qi;let $t;if(Ue&&Kc(Ue,!1),($t=St.onVnodeBeforeUpdate)&&Xo($t,Ue,xe,pe),_t&&Zc(xe,pe,Ue,"beforeUpdate"),Ue&&Kc(Ue,!0),(Rt.innerHTML&&St.innerHTML==null||Rt.textContent&&St.textContent==null)&&S(Ke,""),Ye?Qe(pe.dynamicChildren,Ye,Ke,Ue,he,jv(xe,qe),it):Ze||Yt(pe,xe,Ke,null,Ue,he,jv(xe,qe),it,!1),st>0){if(st&16)He(Ke,Rt,St,Ue,qe);else if(st&2&&Rt.class!==St.class&&a(Ke,"class",null,St.class,qe),st&4&&a(Ke,"style",Rt.style,St.style,qe),st&8){const Kt=xe.dynamicProps;for(let je=0;je{$t&&Xo($t,Ue,xe,pe),_t&&Zc(xe,pe,Ue,"updated")},he)},Qe=(pe,xe,Ue,he,qe,it,Ze)=>{for(let Ke=0;Ke{if(xe!==Ue){if(xe!==qi)for(const it in xe)!Op(it)&&!(it in Ue)&&a(pe,it,xe[it],null,qe,he);for(const it in Ue){if(Op(it))continue;const Ze=Ue[it],Ke=xe[it];Ze!==Ke&&it!=="value"&&a(pe,it,Ke,Ze,qe,he)}"value"in Ue&&a(pe,"value",xe.value,Ue.value,qe)}},Xe=(pe,xe,Ue,he,qe,it,Ze,Ke,st)=>{const Ye=xe.el=pe?pe.el:c(""),_t=xe.anchor=pe?pe.anchor:c("");let{patchFlag:Rt,dynamicChildren:St,slotScopeIds:$t}=xe;$t&&(Ke=Ke?Ke.concat($t):$t),pe==null?(s(Ye,Ue,he),s(_t,Ue,he),Fe(xe.children||[],Ue,_t,qe,it,Ze,Ke,st)):Rt>0&&Rt&64&&St&&pe.dynamicChildren?(Qe(pe.dynamicChildren,St,Ue,qe,it,Ze,Ke),(xe.key!=null||qe&&xe===qe.subTree)&&C1(pe,xe,!0)):Yt(pe,xe,Ue,_t,qe,it,Ze,Ke,st)},dt=(pe,xe,Ue,he,qe,it,Ze,Ke,st)=>{xe.slotScopeIds=Ke,pe==null?xe.shapeFlag&512?qe.ctx.activate(xe,Ue,he,Ze,st):yt(xe,Ue,he,qe,it,Ze,st):Ft(pe,xe,st)},yt=(pe,xe,Ue,he,qe,it,Ze)=>{const Ke=pe.component=LL(pe,he,qe);if(_0(pe)&&(Ke.ctx.renderer=Ii),zL(Ke,!1,Ze),Ke.asyncDep){if(qe&&qe.registerDep(Ke,jt,Ze),!pe.el){const st=Ke.subTree=Ys(br);te(null,st,xe,Ue)}}else jt(Ke,pe,xe,Ue,qe,it,Ze)},Ft=(pe,xe,Ue)=>{const he=xe.component=pe.component;if(PL(pe,xe,Ue))if(he.asyncDep&&!he.asyncResolved){kt(he,xe,Ue);return}else he.next=xe,FB(he.update),he.effect.dirty=!0,he.update();else xe.el=pe.el,he.vnode=xe},jt=(pe,xe,Ue,he,qe,it,Ze)=>{const Ke=()=>{if(pe.isMounted){let{next:_t,bu:Rt,u:St,parent:$t,vnode:Kt}=pe;{const Cs=ER(pe);if(Cs){_t&&(_t.el=Kt.el,kt(pe,_t,Ze)),Cs.asyncDep.then(()=>{pe.isUnmounted||Ke()});return}}let je=_t,Gt;Kc(pe,!1),_t?(_t.el=Kt.el,kt(pe,_t,Ze)):_t=Kt,Rt&&D_(Rt),(Gt=_t.props&&_t.props.onVnodeBeforeUpdate)&&Xo(Gt,$t,_t,Kt),Kc(pe,!0);const ri=$v(pe),Mi=pe.subTree;pe.subTree=ri,L(Mi,ri,C(Mi.el),hi(Mi),pe,qe,it),_t.el=ri.el,je===null&&RL(pe,ri.el),St&&pr(St,qe),(Gt=_t.props&&_t.props.onVnodeUpdated)&&pr(()=>Xo(Gt,$t,_t,Kt),qe)}else{let _t;const{el:Rt,props:St}=xe,{bm:$t,m:Kt,parent:je}=pe,Gt=Np(xe);if(Kc(pe,!1),$t&&D_($t),!Gt&&(_t=St&&St.onVnodeBeforeMount)&&Xo(_t,je,xe),Kc(pe,!0),Rt&&Bs){const ri=()=>{pe.subTree=$v(pe),Bs(Rt,pe.subTree,pe,qe,null)};Gt?xe.type.__asyncLoader().then(()=>!pe.isUnmounted&&ri()):ri()}else{const ri=pe.subTree=$v(pe);L(null,ri,Ue,he,pe,qe,it),xe.el=ri.el}if(Kt&&pr(Kt,qe),!Gt&&(_t=St&&St.onVnodeMounted)){const ri=xe;pr(()=>Xo(_t,je,ri),qe)}(xe.shapeFlag&256||je&&Np(je.vnode)&&je.vnode.shapeFlag&256)&&pe.a&&pr(pe.a,qe),pe.isMounted=!0,xe=Ue=he=null}},st=pe.effect=new d1(Ke,oo,()=>w1(Ye),pe.scope),Ye=pe.update=()=>{st.dirty&&st.run()};Ye.i=pe,Ye.id=pe.uid,Kc(pe,!0),Ye()},kt=(pe,xe,Ue)=>{xe.component=pe;const he=pe.vnode.props;pe.vnode=xe,pe.next=null,cL(pe,xe.props,he,Ue),fL(pe,xe.children,Ue),hc(),zA(pe),dc()},Yt=(pe,xe,Ue,he,qe,it,Ze,Ke,st=!1)=>{const Ye=pe&&pe.children,_t=pe?pe.shapeFlag:0,Rt=xe.children,{patchFlag:St,shapeFlag:$t}=xe;if(St>0){if(St&128){Jt(Ye,Rt,Ue,he,qe,it,Ze,Ke,st);return}else if(St&256){bi(Ye,Rt,Ue,he,qe,it,Ze,Ke,st);return}}$t&8?(_t&16&&In(Ye,qe,it),Rt!==Ye&&S(Ue,Rt)):_t&16?$t&16?Jt(Ye,Rt,Ue,he,qe,it,Ze,Ke,st):In(Ye,qe,it,!0):(_t&8&&S(Ue,""),$t&16&&Fe(Rt,Ue,he,qe,it,Ze,Ke,st))},bi=(pe,xe,Ue,he,qe,it,Ze,Ke,st)=>{pe=pe||td,xe=xe||td;const Ye=pe.length,_t=xe.length,Rt=Math.min(Ye,_t);let St;for(St=0;St_t?In(pe,qe,it,!0,!1,Rt):Fe(xe,Ue,he,qe,it,Ze,Ke,st,Rt)},Jt=(pe,xe,Ue,he,qe,it,Ze,Ke,st)=>{let Ye=0;const _t=xe.length;let Rt=pe.length-1,St=_t-1;for(;Ye<=Rt&&Ye<=St;){const $t=pe[Ye],Kt=xe[Ye]=st?Bl(xe[Ye]):Qo(xe[Ye]);if(su($t,Kt))L($t,Kt,Ue,null,qe,it,Ze,Ke,st);else break;Ye++}for(;Ye<=Rt&&Ye<=St;){const $t=pe[Rt],Kt=xe[St]=st?Bl(xe[St]):Qo(xe[St]);if(su($t,Kt))L($t,Kt,Ue,null,qe,it,Ze,Ke,st);else break;Rt--,St--}if(Ye>Rt){if(Ye<=St){const $t=St+1,Kt=$t<_t?xe[$t].el:he;for(;Ye<=St;)L(null,xe[Ye]=st?Bl(xe[Ye]):Qo(xe[Ye]),Ue,Kt,qe,it,Ze,Ke,st),Ye++}}else if(Ye>St)for(;Ye<=Rt;)mi(pe[Ye],qe,it,!0),Ye++;else{const $t=Ye,Kt=Ye,je=new Map;for(Ye=Kt;Ye<=St;Ye++){const vi=xe[Ye]=st?Bl(xe[Ye]):Qo(xe[Ye]);vi.key!=null&&je.set(vi.key,Ye)}let Gt,ri=0;const Mi=St-Kt+1;let Cs=!1,ot=0;const Wt=new Array(Mi);for(Ye=0;Ye=Mi){mi(vi,qe,it,!0);continue}let Qi;if(vi.key!=null)Qi=je.get(vi.key);else for(Gt=Kt;Gt<=St;Gt++)if(Wt[Gt-Kt]===0&&su(vi,xe[Gt])){Qi=Gt;break}Qi===void 0?mi(vi,qe,it,!0):(Wt[Qi-Kt]=Ye+1,Qi>=ot?ot=Qi:Cs=!0,L(vi,xe[Qi],Ue,null,qe,it,Ze,Ke,st),ri++)}const Ot=Cs?xL(Wt):td;for(Gt=Ot.length-1,Ye=Mi-1;Ye>=0;Ye--){const vi=Kt+Ye,Qi=xe[vi],Bt=vi+1<_t?xe[vi+1].el:he;Wt[Ye]===0?L(null,Qi,Ue,Bt,qe,it,Ze,Ke,st):Cs&&(Gt<0||Ye!==Ot[Gt]?pi(Qi,Ue,Bt,2):Gt--)}}},pi=(pe,xe,Ue,he,qe=null)=>{const{el:it,type:Ze,transition:Ke,children:st,shapeFlag:Ye}=pe;if(Ye&6){pi(pe.component.subTree,xe,Ue,he);return}if(Ye&128){pe.suspense.move(xe,Ue,he);return}if(Ye&64){Ze.move(pe,xe,Ue,Ii);return}if(Ze===ir){s(it,xe,Ue);for(let Rt=0;RtKe.enter(it),qe);else{const{leave:Rt,delayLeave:St,afterLeave:$t}=Ke,Kt=()=>s(it,xe,Ue),je=()=>{Rt(it,()=>{Kt(),$t&&$t()})};St?St(it,Kt,je):je()}else s(it,xe,Ue)},mi=(pe,xe,Ue,he=!1,qe=!1)=>{const{type:it,props:Ze,ref:Ke,children:st,dynamicChildren:Ye,shapeFlag:_t,patchFlag:Rt,dirs:St,cacheIndex:$t}=pe;if(Rt===-2&&(qe=!1),Ke!=null&&Yx(Ke,null,Ue,pe,!0),$t!=null&&(xe.renderCache[$t]=void 0),_t&256){xe.ctx.deactivate(pe);return}const Kt=_t&1&&St,je=!Np(pe);let Gt;if(je&&(Gt=Ze&&Ze.onVnodeBeforeUnmount)&&Xo(Gt,xe,pe),_t&6)An(pe.component,Ue,he);else{if(_t&128){pe.suspense.unmount(Ue,he);return}Kt&&Zc(pe,null,xe,"beforeUnmount"),_t&64?pe.type.remove(pe,xe,Ue,Ii,he):Ye&&!Ye.hasOnce&&(it!==ir||Rt>0&&Rt&64)?In(Ye,xe,Ue,!1,!0):(it===ir&&Rt&384||!qe&&_t&16)&&In(st,xe,Ue),he&&Hs(pe)}(je&&(Gt=Ze&&Ze.onVnodeUnmounted)||Kt)&&pr(()=>{Gt&&Xo(Gt,xe,pe),Kt&&Zc(pe,null,xe,"unmounted")},Ue)},Hs=pe=>{const{type:xe,el:Ue,anchor:he,transition:qe}=pe;if(xe===ir){En(Ue,he);return}if(xe===Wv){ve(pe);return}const it=()=>{n(Ue),qe&&!qe.persisted&&qe.afterLeave&&qe.afterLeave()};if(pe.shapeFlag&1&&qe&&!qe.persisted){const{leave:Ze,delayLeave:Ke}=qe,st=()=>Ze(Ue,it);Ke?Ke(pe.el,it,st):st()}else it()},En=(pe,xe)=>{let Ue;for(;pe!==xe;)Ue=P(pe),n(pe),pe=Ue;n(xe)},An=(pe,xe,Ue)=>{const{bum:he,scope:qe,update:it,subTree:Ze,um:Ke,m:st,a:Ye}=pe;ZA(st),ZA(Ye),he&&D_(he),qe.stop(),it&&(it.active=!1,mi(Ze,pe,xe,Ue)),Ke&&pr(Ke,xe),pr(()=>{pe.isUnmounted=!0},xe),xe&&xe.pendingBranch&&!xe.isUnmounted&&pe.asyncDep&&!pe.asyncResolved&&pe.suspenseId===xe.pendingId&&(xe.deps--,xe.deps===0&&xe.resolve())},In=(pe,xe,Ue,he=!1,qe=!1,it=0)=>{for(let Ze=it;Ze{if(pe.shapeFlag&6)return hi(pe.component.subTree);if(pe.shapeFlag&128)return pe.suspense.next();const xe=P(pe.anchor||pe.el),Ue=xe&&xe[wR];return Ue?P(Ue):xe};let as=!1;const gi=(pe,xe,Ue)=>{pe==null?xe._vnode&&mi(xe._vnode,null,null,!0):L(xe._vnode||null,pe,xe,null,null,null,Ue),xe._vnode=pe,as||(as=!0,zA(),GP(),as=!1)},Ii={p:L,um:mi,m:pi,r:Hs,mt:yt,mc:Fe,pc:Yt,pbc:Qe,n:hi,o:t};let Wn,Bs;return{render:gi,hydrate:Wn,createApp:aL(gi,Wn)}}function jv({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function Kc({effect:t,update:e},i){t.allowRecurse=e.allowRecurse=i}function vL(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function C1(t,e,i=!1){const s=t.children,n=e.children;if(Ut(s)&&Ut(n))for(let a=0;a>1,t[i[c]]0&&(e[s]=i[a-1]),i[a]=s)}}for(a=i.length,u=i[a-1];a-- >0;)i[a]=u,u=e[u];return i}function ER(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:ER(e)}function ZA(t){if(t)for(let e=0;ead(wL);function SL(t,e){return P1(t,null,{flush:"sync"})}const c_={};function sr(t,e,i){return P1(t,e,i)}function P1(t,e,{immediate:i,deep:s,flush:n,once:a,onTrack:u,onTrigger:c}=qi){if(e&&a){const ge=e;e=(...De)=>{ge(...De),Se()}}const _=Tn,w=ge=>s===!0?ge:jl(ge,s===!1?1:void 0);let S,C=!1,P=!1;if(zn(t)?(S=()=>t.value,C=gd(t)):Dp(t)?(S=()=>w(t),C=!0):Ut(t)?(P=!0,C=t.some(ge=>Dp(ge)||gd(ge)),S=()=>t.map(ge=>{if(zn(ge))return ge.value;if(Dp(ge))return w(ge);if(ei(ge))return Kl(ge,_,2)})):ei(t)?e?S=()=>Kl(t,_,2):S=()=>(D&&D(),lo(t,_,3,[j])):S=oo,e&&s){const ge=S;S=()=>jl(ge())}let D,j=ge=>{D=se.onStop=()=>{Kl(ge,_,4),D=se.onStop=void 0}},L;if(w0)if(j=oo,e?i&&lo(e,_,3,[S(),P?[]:void 0,j]):S(),n==="sync"){const ge=TL();L=ge.__watcherHandles||(ge.__watcherHandles=[])}else return oo;let H=P?new Array(t.length).fill(c_):c_;const te=()=>{if(!(!se.active||!se.dirty))if(e){const ge=se.run();(s||C||(P?ge.some((De,Fe)=>gr(De,H[Fe])):gr(ge,H)))&&(D&&D(),lo(e,_,3,[ge,H===c_?void 0:P&&H[0]===c_?[]:H,j]),H=ge)}else se.run()};te.allowRecurse=!!e;let G;n==="sync"?G=te:n==="post"?G=()=>pr(te,_&&_.suspense):(te.pre=!0,_&&(te.id=_.uid),G=()=>w1(te));const se=new d1(S,oo,G),ve=h1(),Se=()=>{se.stop(),ve&&c1(ve.effects,se)};return e?i?te():H=se.run():n==="post"?pr(se.run.bind(se),_&&_.suspense):se.run(),L&&L.push(Se),Se}function EL(t,e,i){const s=this.proxy,n=As(t)?t.includes(".")?AR(s,t):()=>s[t]:t.bind(s,s);let a;ei(e)?a=e:(a=e.handler,i=e);const u=Im(this),c=P1(n,a.bind(s),i);return u(),c}function AR(t,e){const i=e.split(".");return()=>{let s=t;for(let n=0;n{jl(s,e,i)});else if(AP(t)){for(const s in t)jl(t[s],e,i);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&jl(t[s],e,i)}return t}function Gx(t,e,i=qi){const s=Am(),n=fo(e),a=tl(e),u=IR(t,e),c=kB((_,w)=>{let S,C=qi,P;return SL(()=>{const D=t[e];gr(S,D)&&(S=D,w())}),{get(){return _(),i.get?i.get(S):S},set(D){const j=i.set?i.set(D):D;if(!gr(j,S)&&!(C!==qi&&gr(D,C)))return;const L=s.vnode.props;L&&(e in L||n in L||a in L)&&(`onUpdate:${e}`in L||`onUpdate:${n}`in L||`onUpdate:${a}`in L)||(S=D,w()),s.emit(`update:${e}`,j),gr(D,j)&&gr(D,C)&&!gr(j,P)&&w(),C=D,P=j}}});return c[Symbol.iterator]=()=>{let _=0;return{next(){return _<2?{value:_++?u||qi:c,done:!1}:{done:!0}}}},c}const IR=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${fo(e)}Modifiers`]||t[`${tl(e)}Modifiers`];function AL(t,e,...i){if(t.isUnmounted)return;const s=t.vnode.props||qi;let n=i;const a=e.startsWith("update:"),u=a&&IR(s,e.slice(7));u&&(u.trim&&(n=i.map(S=>As(S)?S.trim():S)),u.number&&(n=i.map(KN)));let c,_=s[c=Bv(e)]||s[c=Bv(fo(e))];!_&&a&&(_=s[c=Bv(tl(e))]),_&&lo(_,t,6,n);const w=s[c+"Once"];if(w){if(!t.emitted)t.emitted={};else if(t.emitted[c])return;t.emitted[c]=!0,lo(w,t,6,n)}}function CR(t,e,i=!1){const s=e.emitsCache,n=s.get(t);if(n!==void 0)return n;const a=t.emits;let u={},c=!1;if(!ei(t)){const _=w=>{const S=CR(w,e,!0);S&&(c=!0,Js(u,S))};!i&&e.mixins.length&&e.mixins.forEach(_),t.extends&&_(t.extends),t.mixins&&t.mixins.forEach(_)}return!a&&!c?(Gi(t)&&s.set(t,null),null):(Ut(a)?a.forEach(_=>u[_]=null):Js(u,a),Gi(t)&&s.set(t,u),u)}function b0(t,e){return!t||!c0(e)?!1:(e=e.slice(2).replace(/Once$/,""),yi(t,e[0].toLowerCase()+e.slice(1))||yi(t,tl(e))||yi(t,e))}function $v(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[a],slots:u,attrs:c,emit:_,render:w,renderCache:S,props:C,data:P,setupState:D,ctx:j,inheritAttrs:L}=t,H=K_(t);let te,G;try{if(i.shapeFlag&4){const ve=n||s,Se=ve;te=Qo(w.call(Se,ve,S,C,D,P,j)),G=c}else{const ve=e;te=Qo(ve.length>1?ve(C,{attrs:c,slots:u,emit:_}):ve(C,null)),G=e.props?c:IL(c)}}catch(ve){zp.length=0,m0(ve,t,1),te=Ys(br)}let se=te;if(G&&L!==!1){const ve=Object.keys(G),{shapeFlag:Se}=se;ve.length&&Se&7&&(a&&ve.some(l1)&&(G=CL(G,a)),se=ic(se,G,!1,!0))}return i.dirs&&(se=ic(se,null,!1,!0),se.dirs=se.dirs?se.dirs.concat(i.dirs):i.dirs),i.transition&&(se.transition=i.transition),te=se,K_(H),te}const IL=t=>{let e;for(const i in t)(i==="class"||i==="style"||c0(i))&&((e||(e={}))[i]=t[i]);return e},CL=(t,e)=>{const i={};for(const s in t)(!l1(s)||!(s.slice(9)in e))&&(i[s]=t[s]);return i};function PL(t,e,i){const{props:s,children:n,component:a}=t,{props:u,children:c,patchFlag:_}=e,w=a.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&_>=0){if(_&1024)return!0;if(_&16)return s?KA(s,u,w):!!u;if(_&8){const S=e.dynamicProps;for(let C=0;Ct.__isSuspense;function kL(t,e){e&&e.pendingBranch?Ut(t)?e.effects.push(...t):e.effects.push(t):NB(t)}const ir=Symbol.for("v-fgt"),v0=Symbol.for("v-txt"),br=Symbol.for("v-cmt"),Wv=Symbol.for("v-stc"),zp=[];let qr=null;function us(t=!1){zp.push(qr=t?null:[])}function OL(){zp.pop(),qr=zp[zp.length-1]||null}let em=1;function YA(t){em+=t,t<0&&qr&&(qr.hasOnce=!0)}function PR(t){return t.dynamicChildren=em>0?qr||td:null,OL(),em>0&&qr&&qr.push(t),t}function xn(t,e,i,s,n,a){return PR(Ds(t,e,i,s,n,a,!0))}function tc(t,e,i,s,n){return PR(Ys(t,e,i,s,n,!0))}function ey(t){return t?t.__v_isVNode===!0:!1}function su(t,e){return t.type===e.type&&t.key===e.key}const RR=({key:t})=>t??null,F_=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?As(t)||zn(t)||ei(t)?{i:fn,r:t,k:e,f:!!i}:t:null);function Ds(t,e=null,i=null,s=0,n=null,a=t===ir?0:1,u=!1,c=!1){const _={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&RR(e),ref:e&&F_(e),scopeId:g0,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:fn};return c?(R1(_,i),a&128&&t.normalize(_)):i&&(_.shapeFlag|=As(i)?8:16),em>0&&!u&&qr&&(_.patchFlag>0||a&6)&&_.patchFlag!==32&&qr.push(_),_}const Ys=DL;function DL(t,e=null,i=null,s=0,n=null,a=!1){if((!t||t===aR)&&(t=br),ey(t)){const c=ic(t,e,!0);return i&&R1(c,i),em>0&&!a&&qr&&(c.shapeFlag&6?qr[qr.indexOf(t)]=c:qr.push(c)),c.patchFlag=-2,c}if(WL(t)&&(t=t.__vccOpts),e){e=FL(e);let{class:c,style:_}=e;c&&!As(c)&&(e.class=Nn(c)),Gi(_)&&(XP(_)&&!Ut(_)&&(_=Js({},_)),e.style=Ka(_))}const u=As(t)?1:ML(t)?128:pL(t)?64:Gi(t)?4:ei(t)?2:0;return Ds(t,e,i,s,n,u,a,!0)}function FL(t){return t?XP(t)||mR(t)?Js({},t):t:null}function ic(t,e,i=!1,s=!1){const{props:n,ref:a,patchFlag:u,children:c,transition:_}=t,w=e?x0(n||{},e):n,S={__v_isVNode:!0,__v_skip:!0,type:t.type,props:w,key:w&&RR(w),ref:e&&e.ref?i&&a?Ut(a)?a.concat(F_(e)):[a,F_(e)]:F_(e):a,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ir?u===-1?16:u|16:u,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:_,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ic(t.ssContent),ssFallback:t.ssFallback&&ic(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return _&&s&&Y_(S,_.clone(S)),S}function Em(t=" ",e=0){return Ys(v0,null,t,e)}function sc(t="",e=!1){return e?(us(),tc(br,null,t)):Ys(br,null,t)}function Qo(t){return t==null||typeof t=="boolean"?Ys(br):Ut(t)?Ys(ir,null,t.slice()):typeof t=="object"?Bl(t):Ys(v0,null,String(t))}function Bl(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:ic(t)}function R1(t,e){let i=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(Ut(e))i=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),R1(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!mR(e)?e._ctx=fn:n===3&&fn&&(fn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ei(e)?(e={default:e,_ctx:fn},i=32):(e=String(e),s&64?(i=16,e=[Em(e)]):i=8);t.children=e,t.shapeFlag|=i}function x0(...t){const e={};for(let i=0;iTn||fn;let ty,Qx;{const t=CP(),e=(i,s)=>{let n;return(n=t[i])||(n=t[i]=[]),n.push(s),a=>{n.length>1?n.forEach(u=>u(a)):n[0](a)}};ty=e("__VUE_INSTANCE_SETTERS__",i=>Tn=i),Qx=e("__VUE_SSR_SETTERS__",i=>w0=i)}const Im=t=>{const e=Tn;return ty(t),t.scope.on(),()=>{t.scope.off(),ty(e)}},JA=()=>{Tn&&Tn.scope.off(),ty(null)};function MR(t){return t.vnode.shapeFlag&4}let w0=!1;function zL(t,e=!1,i=!1){e&&Qx(e);const{props:s,children:n}=t.vnode,a=MR(t);lL(t,s,a,e),dL(t,n,i);const u=a?UL(t,e):void 0;return e&&Qx(!1),u}function UL(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,eL);const{setup:s}=i;if(s){const n=t.setupContext=s.length>1?jL(t):null,a=Im(t);hc();const u=Kl(s,t,0,[t.props,n]);if(dc(),a(),SP(u)){if(u.then(JA,JA),e)return u.then(c=>{GA(t,c,e)}).catch(c=>{m0(c,t,0)});t.asyncDep=u}else GA(t,u,e)}else kR(t,e)}function GA(t,e,i){ei(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Gi(e)&&(t.setupState=KP(e)),kR(t,i)}let QA;function kR(t,e,i){const s=t.type;if(!t.render){if(!e&&QA&&!s.render){const n=s.template||A1(t).template;if(n){const{isCustomElement:a,compilerOptions:u}=t.appContext.config,{delimiters:c,compilerOptions:_}=s,w=Js(Js({isCustomElement:a,delimiters:c},u),_);s.render=QA(n,w)}}t.render=s.render||oo}{const n=Im(t);hc();try{tL(t)}finally{dc(),n()}}}const VL={get(t,e){return Tr(t,"get",""),t[e]}};function jL(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,VL),slots:t.slots,emit:t.emit,expose:e}}function T0(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(KP(AB(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Bp)return Bp[i](t)},has(e,i){return i in e||i in Bp}})):t.proxy}function $L(t,e=!0){return ei(t)?t.displayName||t.name:t.name||e&&t.__name}function WL(t){return ei(t)&&"__vccOpts"in t}const Lt=(t,e)=>IB(t,e,w0);function HL(t,e,i){const s=arguments.length;return s===2?Gi(e)&&!Ut(e)?ey(e)?Ys(t,null,[e]):Ys(t,e):Ys(t,null,e):(s>3?i=Array.prototype.slice.call(arguments,2):s===3&&ey(i)&&(i=[i]),Ys(t,e,i))}const qL="3.4.38";/** -* @vue/runtime-dom v3.4.38 +**/function Dg(t,e,i,s){try{return s?t(...s):t()}catch(n){p0(n,e,i)}}function Bo(t,e,i,s){if(Gt(t)){const n=Dg(t,e,i,s);return n&&wP(n)&&n.catch(a=>{p0(a,e,i)}),n}if(Vt(t)){const n=[];for(let a=0;a>>1,n=rr[s],a=og(n);a=og(i)?rr.push(t):rr.splice(UB(e),0,t),t.flags|=1,YP()}}function YP(){iy||(iy=ZP.then(JP))}function VB(t){Vt(t)?Tf.push(...t):Zl&&t.id===-1?Zl.splice(of+1,0,t):t.flags&1||(Tf.push(t),t.flags|=1),YP()}function LA(t,e,i=sa+1){for(;iog(i)-og(s));if(Tf.length=0,Zl){Zl.push(...e);return}for(Zl=e,of=0;oft.id==null?t.flags&2?-1:1/0:t.id;function JP(t){try{for(sa=0;sa{s._d&&YA(-1);const a=sy(e);let u;try{u=t(...n)}finally{sy(a),s._d&&YA(1)}return u};return s._n=!0,s._c=!0,s._d=!0,s}function QP(t,e){if(fn===null)return t;const i=v0(fn),s=t.dirs||(t.dirs=[]);for(let n=0;nt.__isTeleport,Wp=t=>t&&(t.disabled||t.disabled===""),jB=t=>t&&(t.defer||t.defer===""),zA=t=>typeof SVGElement<"u"&&t instanceof SVGElement,UA=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Gx=(t,e)=>{const i=t&&t.to;return ws(i)?e?e(i):null:i},$B={name:"Teleport",__isTeleport:!0,process(t,e,i,s,n,a,u,c,_,w){const{mc:S,pc:A,pbc:P,o:{insert:D,querySelector:U,createText:L,createComment:W}}=w,ee=Wp(e.props);let{shapeFlag:G,children:se,dynamicChildren:fe}=e;if(t==null){const Se=e.el=L(""),Te=e.anchor=L("");D(Se,i,s),D(Te,i,s);const Fe=(Oe,Je)=>{G&16&&(n&&n.isCE&&(n.ce._teleportTarget=Oe),S(se,Oe,Je,n,a,u,c,_))},Ne=()=>{const Oe=e.target=Gx(e.props,U),Je=iM(Oe,e,L,D);Oe&&(u!=="svg"&&zA(Oe)?u="svg":u!=="mathml"&&UA(Oe)&&(u="mathml"),ee||(Fe(Oe,Je),U_(e,!1)))};ee&&(Fe(i,Te),U_(e,!0)),jB(e.props)?wr(Ne,a):Ne()}else{e.el=t.el,e.targetStart=t.targetStart;const Se=e.anchor=t.anchor,Te=e.target=t.target,Fe=e.targetAnchor=t.targetAnchor,Ne=Wp(t.props),Oe=Ne?i:Te,Je=Ne?Se:Fe;if(u==="svg"||zA(Te)?u="svg":(u==="mathml"||UA(Te))&&(u="mathml"),fe?(P(t.dynamicChildren,fe,Oe,n,a,u,c),P1(t,e,!0)):_||A(t,e,Oe,Je,n,a,u,c,!1),ee)Ne?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):f_(e,i,Se,w,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const Xe=e.target=Gx(e.props,U);Xe&&f_(e,Xe,null,w,0)}else Ne&&f_(e,Te,Fe,w,1);U_(e,ee)}},remove(t,e,i,{um:s,o:{remove:n}},a){const{shapeFlag:u,children:c,anchor:_,targetStart:w,targetAnchor:S,target:A,props:P}=t;if(A&&(n(w),n(S)),a&&n(_),u&16){const D=a||!Wp(P);for(let U=0;U{t.isMounted=!0}),E1(()=>{t.isUnmounting=!0}),t}const fo=[Function,Array],sM={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fo,onEnter:fo,onAfterEnter:fo,onEnterCancelled:fo,onBeforeLeave:fo,onLeave:fo,onAfterLeave:fo,onLeaveCancelled:fo,onBeforeAppear:fo,onAppear:fo,onAfterAppear:fo,onAppearCancelled:fo},nM=t=>{const e=t.subTree;return e.component?nM(e.component):e},XB={name:"BaseTransition",props:sM,setup(t,{slots:e}){const i=Ng(),s=qB();return()=>{const n=e.default&&aM(e.default(),!0);if(!n||!n.length)return;const a=rM(n),u=Ti(t),{mode:c}=u;if(s.isLeaving)return qv(a);const _=VA(a);if(!_)return qv(a);let w=Qx(_,u,s,i,P=>w=P);_.type!==or&&ag(_,w);const S=i.subTree,A=S&&VA(S);if(A&&A.type!==or&&!du(_,A)&&nM(i).type!==or){const P=Qx(A,u,s,i);if(ag(A,P),c==="out-in"&&_.type!==or)return s.isLeaving=!0,P.afterLeave=()=>{s.isLeaving=!1,i.job.flags&8||i.update(),delete P.afterLeave},qv(a);c==="in-out"&&_.type!==or&&(P.delayLeave=(D,U,L)=>{const W=oM(s,A);W[String(A.key)]=A,D[Yl]=()=>{U(),D[Yl]=void 0,delete w.delayedLeave},w.delayedLeave=L})}return a}}};function rM(t){let e=t[0];if(t.length>1){for(const i of t)if(i.type!==or){e=i;break}}return e}const ZB=XB;function oM(t,e){const{leavingVNodes:i}=t;let s=i.get(e.type);return s||(s=Object.create(null),i.set(e.type,s)),s}function Qx(t,e,i,s,n){const{appear:a,mode:u,persisted:c=!1,onBeforeEnter:_,onEnter:w,onAfterEnter:S,onEnterCancelled:A,onBeforeLeave:P,onLeave:D,onAfterLeave:U,onLeaveCancelled:L,onBeforeAppear:W,onAppear:ee,onAfterAppear:G,onAppearCancelled:se}=e,fe=String(t.key),Se=oM(i,t),Te=(Oe,Je)=>{Oe&&Bo(Oe,s,9,Je)},Fe=(Oe,Je)=>{const Xe=Je[1];Te(Oe,Je),Vt(Oe)?Oe.every(qe=>qe.length<=1)&&Xe():Oe.length<=1&&Xe()},Ne={mode:u,persisted:c,beforeEnter(Oe){let Je=_;if(!i.isMounted)if(a)Je=W||_;else return;Oe[Yl]&&Oe[Yl](!0);const Xe=Se[fe];Xe&&du(t,Xe)&&Xe.el[Yl]&&Xe.el[Yl](),Te(Je,[Oe])},enter(Oe){let Je=w,Xe=S,qe=A;if(!i.isMounted)if(a)Je=ee||w,Xe=G||S,qe=se||A;else return;let ht=!1;const _t=Oe[d_]=Dt=>{ht||(ht=!0,Dt?Te(qe,[Oe]):Te(Xe,[Oe]),Ne.delayedLeave&&Ne.delayedLeave(),Oe[d_]=void 0)};Je?Fe(Je,[Oe,_t]):_t()},leave(Oe,Je){const Xe=String(t.key);if(Oe[d_]&&Oe[d_](!0),i.isUnmounting)return Je();Te(P,[Oe]);let qe=!1;const ht=Oe[Yl]=_t=>{qe||(qe=!0,Je(),_t?Te(L,[Oe]):Te(U,[Oe]),Oe[Yl]=void 0,Se[Xe]===t&&delete Se[Xe])};Se[Xe]=t,D?Fe(D,[Oe,ht]):ht()},clone(Oe){const Je=Qx(Oe,e,i,s,n);return n&&n(Je),Je}};return Ne}function qv(t){if(g0(t))return t=hc(t),t.children=null,t}function VA(t){if(!g0(t))return tM(t.type)&&t.children?rM(t.children):t;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&Gt(i.default))return i.default()}}function ag(t,e){t.shapeFlag&6&&t.component?(t.transition=e,ag(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function aM(t,e=!1,i){let s=[],n=0;for(let a=0;a1)for(let a=0;aew(U,e&&(Vt(e)?e[L]:e),i,s,n));return}if(Ef(s)&&!n)return;const a=s.shapeFlag&4?v0(s.component):s.el,u=n?null:a,{i:c,r:_}=t,w=e&&e.r,S=c.refs===Ii?c.refs={}:c.refs,A=c.setupState,P=Ti(A),D=A===Ii?()=>!1:U=>ki(P,U);if(w!=null&&w!==_&&(ws(w)?(S[w]=null,D(w)&&(A[w]=null)):dn(w)&&(w.value=null)),Gt(_))Dg(_,c,12,[u,S]);else{const U=ws(_),L=dn(_);if(U||L){const W=()=>{if(t.f){const ee=U?D(_)?A[_]:S[_]:_.value;n?Vt(ee)&&d1(ee,a):Vt(ee)?ee.includes(a)||ee.push(a):U?(S[_]=[a],D(_)&&(A[_]=S[_])):(_.value=[a],t.k&&(S[t.k]=_.value))}else U?(S[_]=u,D(_)&&(A[_]=u)):L&&(_.value=u,t.k&&(S[t.k]=u))};u?(W.id=-1,wr(W,i)):W()}}}u0().requestIdleCallback;u0().cancelIdleCallback;const Ef=t=>!!t.type.__asyncLoader,g0=t=>t.type.__isKeepAlive;function YB(t,e){cM(t,"a",e)}function KB(t,e){cM(t,"da",e)}function cM(t,e,i=Sn){const s=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(m0(e,s,i),i){let n=i.parent;for(;n&&n.parent;)g0(n.parent.vnode)&&JB(s,e,i,n),n=n.parent}}function JB(t,e,i,s){const n=m0(e,t,s,!0);A1(()=>{d1(s[e],n)},i)}function m0(t,e,i=Sn,s=!1){if(i){const n=i[t]||(i[t]=[]),a=e.__weh||(e.__weh=(...u)=>{vc();const c=Bg(i),_=Bo(e,i,t,u);return c(),xc(),_});return s?n.unshift(a):n.push(a),a}}const ol=t=>(e,i=Sn)=>{(!ug||t==="sp")&&m0(t,(...s)=>e(...s),i)},GB=ol("bm"),S1=ol("m"),QB=ol("bu"),eL=ol("u"),E1=ol("bum"),A1=ol("um"),tL=ol("sp"),iL=ol("rtg"),sL=ol("rtc");function nL(t,e=Sn){m0("ec",t,e)}const uM="components";function Xv(t,e){return fM(uM,t,!0,e)||t}const hM=Symbol.for("v-ndc");function rL(t){return ws(t)?fM(uM,t,!1)||t:t||hM}function fM(t,e,i=!0,s=!1){const n=fn||Sn;if(n){const a=n.type;{const c=HL(a,!1);if(c&&(c===e||c===Qr(e)||c===c0(Qr(e))))return a}const u=jA(n[t]||a[t],e)||jA(n.appContext[t],e);return!u&&s?a:u}}function jA(t,e){return t&&(t[e]||t[Qr(e)]||t[c0(Qr(e))])}function tw(t,e,i,s){let n;const a=i,u=Vt(t);if(u||ws(t)){const c=u&&wf(t);let _=!1;c&&(_=!go(t),t=d0(t)),n=new Array(t.length);for(let w=0,S=t.length;we(c,_,void 0,a));else{const c=Object.keys(t);n=new Array(c.length);for(let _=0,w=c.length;_cg(e)?!(e.type===or||e.type===Un&&!dM(e.children)):!0)?t:null}const iw=t=>t?OM(t)?v0(t):iw(t.parent):null,qp=Ds(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>iw(t.parent),$root:t=>iw(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>I1(t),$forceUpdate:t=>t.f||(t.f=()=>{T1(t.update)}),$nextTick:t=>t.n||(t.n=Eu.bind(t.proxy)),$watch:t=>IL.bind(t)}),Zv=(t,e)=>t!==Ii&&!t.__isScriptSetup&&ki(t,e),oL={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:s,data:n,props:a,accessCache:u,type:c,appContext:_}=t;let w;if(e[0]!=="$"){const D=u[e];if(D!==void 0)switch(D){case 1:return s[e];case 2:return n[e];case 4:return i[e];case 3:return a[e]}else{if(Zv(s,e))return u[e]=1,s[e];if(n!==Ii&&ki(n,e))return u[e]=2,n[e];if((w=t.propsOptions[0])&&ki(w,e))return u[e]=3,a[e];if(i!==Ii&&ki(i,e))return u[e]=4,i[e];sw&&(u[e]=0)}}const S=qp[e];let A,P;if(S)return e==="$attrs"&&Ln(t.attrs,"get",""),S(t);if((A=c.__cssModules)&&(A=A[e]))return A;if(i!==Ii&&ki(i,e))return u[e]=4,i[e];if(P=_.config.globalProperties,ki(P,e))return P[e]},set({_:t},e,i){const{data:s,setupState:n,ctx:a}=t;return Zv(n,e)?(n[e]=i,!0):s!==Ii&&ki(s,e)?(s[e]=i,!0):ki(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(a[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:s,appContext:n,propsOptions:a}},u){let c;return!!i[u]||t!==Ii&&ki(t,u)||Zv(e,u)||(c=a[0])&&ki(c,u)||ki(s,u)||ki(qp,u)||ki(n.config.globalProperties,u)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:ki(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function ny(t){return Vt(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}function ry(t,e){return!t||!e?t||e:Vt(t)&&Vt(e)?t.concat(e):Ds({},ny(t),ny(e))}let sw=!0;function aL(t){const e=I1(t),i=t.proxy,s=t.ctx;sw=!1,e.beforeCreate&&$A(e.beforeCreate,t,"bc");const{data:n,computed:a,methods:u,watch:c,provide:_,inject:w,created:S,beforeMount:A,mounted:P,beforeUpdate:D,updated:U,activated:L,deactivated:W,beforeDestroy:ee,beforeUnmount:G,destroyed:se,unmounted:fe,render:Se,renderTracked:Te,renderTriggered:Fe,errorCaptured:Ne,serverPrefetch:Oe,expose:Je,inheritAttrs:Xe,components:qe,directives:ht,filters:_t}=e;if(w&&lL(w,s,null),u)for(const Rt in u){const Xt=u[Rt];Gt(Xt)&&(s[Rt]=Xt.bind(i))}if(n){const Rt=n.call(i,i);Ki(Rt)&&(t.data=v1(Rt))}if(sw=!0,a)for(const Rt in a){const Xt=a[Rt],xi=Gt(Xt)?Xt.bind(i,i):Gt(Xt.get)?Xt.get.bind(i,i):da,Zt=!Gt(Xt)&&Gt(Xt.set)?Xt.set.bind(i):da,pi=Bt({get:xi,set:Zt});Object.defineProperty(s,Rt,{enumerable:!0,configurable:!0,get:()=>pi.value,set:gi=>pi.value=gi})}if(c)for(const Rt in c)pM(c[Rt],s,i,Rt);if(_){const Rt=Gt(_)?_.call(i):_;Reflect.ownKeys(Rt).forEach(Xt=>{mM(Xt,Rt[Xt])})}S&&$A(S,t,"c");function jt(Rt,Xt){Vt(Xt)?Xt.forEach(xi=>Rt(xi.bind(i))):Xt&&Rt(Xt.bind(i))}if(jt(GB,A),jt(S1,P),jt(QB,D),jt(eL,U),jt(YB,L),jt(KB,W),jt(nL,Ne),jt(sL,Te),jt(iL,Fe),jt(E1,G),jt(A1,fe),jt(tL,Oe),Vt(Je))if(Je.length){const Rt=t.exposed||(t.exposed={});Je.forEach(Xt=>{Object.defineProperty(Rt,Xt,{get:()=>i[Xt],set:xi=>i[Xt]=xi})})}else t.exposed||(t.exposed={});Se&&t.render===da&&(t.render=Se),Xe!=null&&(t.inheritAttrs=Xe),qe&&(t.components=qe),ht&&(t.directives=ht),Oe&&lM(t)}function lL(t,e,i=da){Vt(t)&&(t=nw(t));for(const s in t){const n=t[s];let a;Ki(n)?"default"in n?a=If(n.from||s,n.default,!0):a=If(n.from||s):a=If(n),dn(a)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:u=>a.value=u}):e[s]=a}}function $A(t,e,i){Bo(Vt(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,i)}function pM(t,e,i,s){let n=s.includes(".")?IM(i,s):()=>i[s];if(ws(t)){const a=e[t];Gt(a)&&ar(n,a)}else if(Gt(t))ar(n,t.bind(i));else if(Ki(t))if(Vt(t))t.forEach(a=>pM(a,e,i,s));else{const a=Gt(t.handler)?t.handler.bind(i):e[t.handler];Gt(a)&&ar(n,a,t)}}function I1(t){const e=t.type,{mixins:i,extends:s}=e,{mixins:n,optionsCache:a,config:{optionMergeStrategies:u}}=t.appContext,c=a.get(e);let _;return c?_=c:!n.length&&!i&&!s?_=e:(_={},n.length&&n.forEach(w=>oy(_,w,u,!0)),oy(_,e,u)),Ki(e)&&a.set(e,_),_}function oy(t,e,i,s=!1){const{mixins:n,extends:a}=e;a&&oy(t,a,i,!0),n&&n.forEach(u=>oy(t,u,i,!0));for(const u in e)if(!(s&&u==="expose")){const c=cL[u]||i&&i[u];t[u]=c?c(t[u],e[u]):e[u]}return t}const cL={data:HA,props:WA,emits:WA,methods:Np,computed:Np,beforeCreate:er,created:er,beforeMount:er,mounted:er,beforeUpdate:er,updated:er,beforeDestroy:er,beforeUnmount:er,destroyed:er,unmounted:er,activated:er,deactivated:er,errorCaptured:er,serverPrefetch:er,components:Np,directives:Np,watch:hL,provide:HA,inject:uL};function HA(t,e){return e?t?function(){return Ds(Gt(t)?t.call(this,this):t,Gt(e)?e.call(this,this):e)}:e:t}function uL(t,e){return Np(nw(t),nw(e))}function nw(t){if(Vt(t)){const e={};for(let i=0;i1)return i&&Gt(e)?e.call(s&&s.proxy):e}}const _M={},yM=()=>Object.create(_M),bM=t=>Object.getPrototypeOf(t)===_M;function pL(t,e,i,s=!1){const n={},a=yM();t.propsDefaults=Object.create(null),vM(t,e,n,a);for(const u in t.propsOptions[0])u in n||(n[u]=void 0);i?t.props=s?n:CB(n):t.type.props?t.props=n:t.props=a,t.attrs=a}function gL(t,e,i,s){const{props:n,attrs:a,vnode:{patchFlag:u}}=t,c=Ti(n),[_]=t.propsOptions;let w=!1;if((s||u>0)&&!(u&16)){if(u&8){const S=t.vnode.dynamicProps;for(let A=0;A{_=!0;const[P,D]=xM(A,e,!0);Ds(u,P),D&&c.push(...D)};!i&&e.mixins.length&&e.mixins.forEach(S),t.extends&&S(t.extends),t.mixins&&t.mixins.forEach(S)}if(!a&&!_)return Ki(t)&&s.set(t,vf),vf;if(Vt(a))for(let S=0;St[0]==="_"||t==="$stable",C1=t=>Vt(t)?t.map(na):[na(t)],_L=(t,e,i)=>{if(e._n)return e;const s=Sf((...n)=>C1(e(...n)),i);return s._c=!1,s},TM=(t,e,i)=>{const s=t._ctx;for(const n in t){if(wM(n))continue;const a=t[n];if(Gt(a))e[n]=_L(n,a,s);else if(a!=null){const u=C1(a);e[n]=()=>u}}},SM=(t,e)=>{const i=C1(e);t.slots.default=()=>i},EM=(t,e,i)=>{for(const s in e)(i||s!=="_")&&(t[s]=e[s])},yL=(t,e,i)=>{const s=t.slots=yM();if(t.vnode.shapeFlag&32){const n=e._;n?(EM(s,e,i),i&&EP(s,"_",n,!0)):TM(e,s)}else e&&SM(t,e)},bL=(t,e,i)=>{const{vnode:s,slots:n}=t;let a=!0,u=Ii;if(s.shapeFlag&32){const c=e._;c?i&&c===1?a=!1:EM(n,e,i):(a=!e.$stable,TM(e,n)),u=e}else e&&(SM(t,e),u={default:1});if(a)for(const c in n)!wM(c)&&u[c]==null&&delete n[c]},wr=OL;function vL(t){return xL(t)}function xL(t,e){const i=u0();i.__VUE__=!0;const{insert:s,remove:n,patchProp:a,createElement:u,createText:c,createComment:_,setText:w,setElementText:S,parentNode:A,nextSibling:P,setScopeId:D=da,insertStaticContent:U}=t,L=(ge,ve,Ue,ce=null,We=null,Ge=null,Ze=void 0,Ye=null,it=!!ve.dynamicChildren)=>{if(ge===ve)return;ge&&!du(ge,ve)&&(ce=hi(ge),gi(ge,We,Ge,!0),ge=null),ve.patchFlag===-2&&(it=!1,ve.dynamicChildren=null);const{type:Qe,ref:Mt,shapeFlag:gt}=ve;switch(Qe){case y0:W(ge,ve,Ue,ce);break;case or:ee(ge,ve,Ue,ce);break;case Jv:ge==null&&G(ve,Ue,ce,Ze);break;case Un:qe(ge,ve,Ue,ce,We,Ge,Ze,Ye,it);break;default:gt&1?Se(ge,ve,Ue,ce,We,Ge,Ze,Ye,it):gt&6?ht(ge,ve,Ue,ce,We,Ge,Ze,Ye,it):(gt&64||gt&128)&&Qe.process(ge,ve,Ue,ce,We,Ge,Ze,Ye,it,Mi)}Mt!=null&&We&&ew(Mt,ge&&ge.ref,Ge,ve||ge,!ve)},W=(ge,ve,Ue,ce)=>{if(ge==null)s(ve.el=c(ve.children),Ue,ce);else{const We=ve.el=ge.el;ve.children!==ge.children&&w(We,ve.children)}},ee=(ge,ve,Ue,ce)=>{ge==null?s(ve.el=_(ve.children||""),Ue,ce):ve.el=ge.el},G=(ge,ve,Ue,ce)=>{[ge.el,ge.anchor]=U(ge.children,ve,Ue,ce,ge.el,ge.anchor)},se=({el:ge,anchor:ve},Ue,ce)=>{let We;for(;ge&&ge!==ve;)We=P(ge),s(ge,Ue,ce),ge=We;s(ve,Ue,ce)},fe=({el:ge,anchor:ve})=>{let Ue;for(;ge&&ge!==ve;)Ue=P(ge),n(ge),ge=Ue;n(ve)},Se=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it)=>{ve.type==="svg"?Ze="svg":ve.type==="math"&&(Ze="mathml"),ge==null?Te(ve,Ue,ce,We,Ge,Ze,Ye,it):Oe(ge,ve,We,Ge,Ze,Ye,it)},Te=(ge,ve,Ue,ce,We,Ge,Ze,Ye)=>{let it,Qe;const{props:Mt,shapeFlag:gt,transition:wt,dirs:Lt}=ge;if(it=ge.el=u(ge.type,Ge,Mt&&Mt.is,Mt),gt&8?S(it,ge.children):gt&16&&Ne(ge.children,it,null,ce,We,Yv(ge,Ge),Ze,Ye),Lt&&nu(ge,null,ce,"created"),Fe(it,ge,ge.scopeId,Ze,ce),Mt){for(const je in Mt)je!=="value"&&!jp(je)&&a(it,je,null,Mt[je],Ge,ce);"value"in Mt&&a(it,"value",null,Mt.value,Ge),(Qe=Mt.onVnodeBeforeMount)&&Jo(Qe,ce,ge)}Lt&&nu(ge,null,ce,"beforeMount");const Kt=wL(We,wt);Kt&&wt.beforeEnter(it),s(it,ve,Ue),((Qe=Mt&&Mt.onVnodeMounted)||Kt||Lt)&&wr(()=>{Qe&&Jo(Qe,ce,ge),Kt&&wt.enter(it),Lt&&nu(ge,null,ce,"mounted")},We)},Fe=(ge,ve,Ue,ce,We)=>{if(Ue&&D(ge,Ue),ce)for(let Ge=0;Ge{for(let Qe=it;Qe{const Ye=ve.el=ge.el;let{patchFlag:it,dynamicChildren:Qe,dirs:Mt}=ve;it|=ge.patchFlag&16;const gt=ge.props||Ii,wt=ve.props||Ii;let Lt;if(Ue&&ru(Ue,!1),(Lt=wt.onVnodeBeforeUpdate)&&Jo(Lt,Ue,ve,ge),Mt&&nu(ve,ge,Ue,"beforeUpdate"),Ue&&ru(Ue,!0),(gt.innerHTML&&wt.innerHTML==null||gt.textContent&&wt.textContent==null)&&S(Ye,""),Qe?Je(ge.dynamicChildren,Qe,Ye,Ue,ce,Yv(ve,We),Ge):Ze||Xt(ge,ve,Ye,null,Ue,ce,Yv(ve,We),Ge,!1),it>0){if(it&16)Xe(Ye,gt,wt,Ue,We);else if(it&2&>.class!==wt.class&&a(Ye,"class",null,wt.class,We),it&4&&a(Ye,"style",gt.style,wt.style,We),it&8){const Kt=ve.dynamicProps;for(let je=0;je{Lt&&Jo(Lt,Ue,ve,ge),Mt&&nu(ve,ge,Ue,"updated")},ce)},Je=(ge,ve,Ue,ce,We,Ge,Ze)=>{for(let Ye=0;Ye{if(ve!==Ue){if(ve!==Ii)for(const Ge in ve)!jp(Ge)&&!(Ge in Ue)&&a(ge,Ge,ve[Ge],null,We,ce);for(const Ge in Ue){if(jp(Ge))continue;const Ze=Ue[Ge],Ye=ve[Ge];Ze!==Ye&&Ge!=="value"&&a(ge,Ge,Ye,Ze,We,ce)}"value"in Ue&&a(ge,"value",ve.value,Ue.value,We)}},qe=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it)=>{const Qe=ve.el=ge?ge.el:c(""),Mt=ve.anchor=ge?ge.anchor:c("");let{patchFlag:gt,dynamicChildren:wt,slotScopeIds:Lt}=ve;Lt&&(Ye=Ye?Ye.concat(Lt):Lt),ge==null?(s(Qe,Ue,ce),s(Mt,Ue,ce),Ne(ve.children||[],Ue,Mt,We,Ge,Ze,Ye,it)):gt>0&>&64&&wt&&ge.dynamicChildren?(Je(ge.dynamicChildren,wt,Ue,We,Ge,Ze,Ye),(ve.key!=null||We&&ve===We.subTree)&&P1(ge,ve,!0)):Xt(ge,ve,Ue,Mt,We,Ge,Ze,Ye,it)},ht=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it)=>{ve.slotScopeIds=Ye,ge==null?ve.shapeFlag&512?We.ctx.activate(ve,Ue,ce,Ze,it):_t(ve,Ue,ce,We,Ge,Ze,it):Dt(ge,ve,it)},_t=(ge,ve,Ue,ce,We,Ge,Ze)=>{const Ye=ge.component=zL(ge,ce,We);if(g0(ge)&&(Ye.ctx.renderer=Mi),UL(Ye,!1,Ze),Ye.asyncDep){if(We&&We.registerDep(Ye,jt,Ze),!ge.el){const it=Ye.subTree=Ks(or);ee(null,it,ve,Ue)}}else jt(Ye,ge,ve,Ue,We,Ge,Ze)},Dt=(ge,ve,Ue)=>{const ce=ve.component=ge.component;if(RL(ge,ve,Ue))if(ce.asyncDep&&!ce.asyncResolved){Rt(ce,ve,Ue);return}else ce.next=ve,ce.update();else ve.el=ge.el,ce.vnode=ve},jt=(ge,ve,Ue,ce,We,Ge,Ze)=>{const Ye=()=>{if(ge.isMounted){let{next:gt,bu:wt,u:Lt,parent:Kt,vnode:je}=ge;{const et=AM(ge);if(et){gt&&(gt.el=je.el,Rt(ge,gt,Ze)),et.asyncDep.then(()=>{ge.isUnmounted||Ye()});return}}let Jt=gt,mi;ru(ge,!1),gt?(gt.el=je.el,Rt(ge,gt,Ze)):gt=je,wt&&z_(wt),(mi=gt.props&>.props.onVnodeBeforeUpdate)&&Jo(mi,Kt,gt,je),ru(ge,!0);const _i=Kv(ge),Gi=ge.subTree;ge.subTree=_i,L(Gi,_i,A(Gi.el),hi(Gi),ge,We,Ge),gt.el=_i.el,Jt===null&&kL(ge,_i.el),Lt&&wr(Lt,We),(mi=gt.props&>.props.onVnodeUpdated)&&wr(()=>Jo(mi,Kt,gt,je),We)}else{let gt;const{el:wt,props:Lt}=ve,{bm:Kt,m:je,parent:Jt,root:mi,type:_i}=ge,Gi=Ef(ve);if(ru(ge,!1),Kt&&z_(Kt),!Gi&&(gt=Lt&&Lt.onVnodeBeforeMount)&&Jo(gt,Jt,ve),ru(ge,!0),wt&&Fs){const et=()=>{ge.subTree=Kv(ge),Fs(wt,ge.subTree,ge,We,null)};Gi&&_i.__asyncHydrate?_i.__asyncHydrate(wt,ge,et):et()}else{mi.ce&&mi.ce._injectChildStyle(_i);const et=ge.subTree=Kv(ge);L(null,et,Ue,ce,ge,We,Ge),ve.el=et.el}if(je&&wr(je,We),!Gi&&(gt=Lt&&Lt.onVnodeMounted)){const et=ve;wr(()=>Jo(gt,Jt,et),We)}(ve.shapeFlag&256||Jt&&Ef(Jt.vnode)&&Jt.vnode.shapeFlag&256)&&ge.a&&wr(ge.a,We),ge.isMounted=!0,ve=Ue=ce=null}};ge.scope.on();const it=ge.effect=new kP(Ye);ge.scope.off();const Qe=ge.update=it.run.bind(it),Mt=ge.job=it.runIfDirty.bind(it);Mt.i=ge,Mt.id=ge.uid,it.scheduler=()=>T1(Mt),ru(ge,!0),Qe()},Rt=(ge,ve,Ue)=>{ve.component=ge;const ce=ge.vnode.props;ge.vnode=ve,ge.next=null,gL(ge,ve.props,ce,Ue),bL(ge,ve.children,Ue),vc(),LA(ge),xc()},Xt=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it=!1)=>{const Qe=ge&&ge.children,Mt=ge?ge.shapeFlag:0,gt=ve.children,{patchFlag:wt,shapeFlag:Lt}=ve;if(wt>0){if(wt&128){Zt(Qe,gt,Ue,ce,We,Ge,Ze,Ye,it);return}else if(wt&256){xi(Qe,gt,Ue,ce,We,Ge,Ze,Ye,it);return}}Lt&8?(Mt&16&&Cn(Qe,We,Ge),gt!==Qe&&S(Ue,gt)):Mt&16?Lt&16?Zt(Qe,gt,Ue,ce,We,Ge,Ze,Ye,it):Cn(Qe,We,Ge,!0):(Mt&8&&S(Ue,""),Lt&16&&Ne(gt,Ue,ce,We,Ge,Ze,Ye,it))},xi=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it)=>{ge=ge||vf,ve=ve||vf;const Qe=ge.length,Mt=ve.length,gt=Math.min(Qe,Mt);let wt;for(wt=0;wtMt?Cn(ge,We,Ge,!0,!1,gt):Ne(ve,Ue,ce,We,Ge,Ze,Ye,it,gt)},Zt=(ge,ve,Ue,ce,We,Ge,Ze,Ye,it)=>{let Qe=0;const Mt=ve.length;let gt=ge.length-1,wt=Mt-1;for(;Qe<=gt&&Qe<=wt;){const Lt=ge[Qe],Kt=ve[Qe]=it?Kl(ve[Qe]):na(ve[Qe]);if(du(Lt,Kt))L(Lt,Kt,Ue,null,We,Ge,Ze,Ye,it);else break;Qe++}for(;Qe<=gt&&Qe<=wt;){const Lt=ge[gt],Kt=ve[wt]=it?Kl(ve[wt]):na(ve[wt]);if(du(Lt,Kt))L(Lt,Kt,Ue,null,We,Ge,Ze,Ye,it);else break;gt--,wt--}if(Qe>gt){if(Qe<=wt){const Lt=wt+1,Kt=Ltwt)for(;Qe<=gt;)gi(ge[Qe],We,Ge,!0),Qe++;else{const Lt=Qe,Kt=Qe,je=new Map;for(Qe=Kt;Qe<=wt;Qe++){const wi=ve[Qe]=it?Kl(ve[Qe]):na(ve[Qe]);wi.key!=null&&je.set(wi.key,Qe)}let Jt,mi=0;const _i=wt-Kt+1;let Gi=!1,et=0;const $t=new Array(_i);for(Qe=0;Qe<_i;Qe++)$t[Qe]=0;for(Qe=Lt;Qe<=gt;Qe++){const wi=ge[Qe];if(mi>=_i){gi(wi,We,Ge,!0);continue}let Qi;if(wi.key!=null)Qi=je.get(wi.key);else for(Jt=Kt;Jt<=wt;Jt++)if($t[Jt-Kt]===0&&du(wi,ve[Jt])){Qi=Jt;break}Qi===void 0?gi(wi,We,Ge,!0):($t[Qi-Kt]=Qe+1,Qi>=et?et=Qi:Gi=!0,L(wi,ve[Qi],Ue,null,We,Ge,Ze,Ye,it),mi++)}const kt=Gi?TL($t):vf;for(Jt=kt.length-1,Qe=_i-1;Qe>=0;Qe--){const wi=Kt+Qe,Qi=ve[wi],Nt=wi+1{const{el:Ge,type:Ze,transition:Ye,children:it,shapeFlag:Qe}=ge;if(Qe&6){pi(ge.component.subTree,ve,Ue,ce);return}if(Qe&128){ge.suspense.move(ve,Ue,ce);return}if(Qe&64){Ze.move(ge,ve,Ue,Mi);return}if(Ze===Un){s(Ge,ve,Ue);for(let gt=0;gtYe.enter(Ge),We);else{const{leave:gt,delayLeave:wt,afterLeave:Lt}=Ye,Kt=()=>s(Ge,ve,Ue),je=()=>{gt(Ge,()=>{Kt(),Lt&&Lt()})};wt?wt(Ge,Kt,je):je()}else s(Ge,ve,Ue)},gi=(ge,ve,Ue,ce=!1,We=!1)=>{const{type:Ge,props:Ze,ref:Ye,children:it,dynamicChildren:Qe,shapeFlag:Mt,patchFlag:gt,dirs:wt,cacheIndex:Lt}=ge;if(gt===-2&&(We=!1),Ye!=null&&ew(Ye,null,Ue,ge,!0),Lt!=null&&(ve.renderCache[Lt]=void 0),Mt&256){ve.ctx.deactivate(ge);return}const Kt=Mt&1&&wt,je=!Ef(ge);let Jt;if(je&&(Jt=Ze&&Ze.onVnodeBeforeUnmount)&&Jo(Jt,ve,ge),Mt&6)In(ge.component,Ue,ce);else{if(Mt&128){ge.suspense.unmount(Ue,ce);return}Kt&&nu(ge,null,ve,"beforeUnmount"),Mt&64?ge.type.remove(ge,ve,Ue,Mi,ce):Qe&&!Qe.hasOnce&&(Ge!==Un||gt>0&>&64)?Cn(Qe,ve,Ue,!1,!0):(Ge===Un&>&384||!We&&Mt&16)&&Cn(it,ve,Ue),ce&&$s(ge)}(je&&(Jt=Ze&&Ze.onVnodeUnmounted)||Kt)&&wr(()=>{Jt&&Jo(Jt,ve,ge),Kt&&nu(ge,null,ve,"unmounted")},Ue)},$s=ge=>{const{type:ve,el:Ue,anchor:ce,transition:We}=ge;if(ve===Un){An(Ue,ce);return}if(ve===Jv){fe(ge);return}const Ge=()=>{n(Ue),We&&!We.persisted&&We.afterLeave&&We.afterLeave()};if(ge.shapeFlag&1&&We&&!We.persisted){const{leave:Ze,delayLeave:Ye}=We,it=()=>Ze(Ue,Ge);Ye?Ye(ge.el,Ge,it):it()}else Ge()},An=(ge,ve)=>{let Ue;for(;ge!==ve;)Ue=P(ge),n(ge),ge=Ue;n(ve)},In=(ge,ve,Ue)=>{const{bum:ce,scope:We,job:Ge,subTree:Ze,um:Ye,m:it,a:Qe}=ge;XA(it),XA(Qe),ce&&z_(ce),We.stop(),Ge&&(Ge.flags|=8,gi(Ze,ge,ve,Ue)),Ye&&wr(Ye,ve),wr(()=>{ge.isUnmounted=!0},ve),ve&&ve.pendingBranch&&!ve.isUnmounted&&ge.asyncDep&&!ge.asyncResolved&&ge.suspenseId===ve.pendingId&&(ve.deps--,ve.deps===0&&ve.resolve())},Cn=(ge,ve,Ue,ce=!1,We=!1,Ge=0)=>{for(let Ze=Ge;Ze{if(ge.shapeFlag&6)return hi(ge.component.subTree);if(ge.shapeFlag&128)return ge.suspense.next();const ve=P(ge.anchor||ge.el),Ue=ve&&ve[eM];return Ue?P(Ue):ve};let ns=!1;const bi=(ge,ve,Ue)=>{ge==null?ve._vnode&&gi(ve._vnode,null,null,!0):L(ve._vnode||null,ge,ve,null,null,null,Ue),ve._vnode=ge,ns||(ns=!0,LA(),KP(),ns=!1)},Mi={p:L,um:gi,m:pi,r:$s,mt:_t,mc:Ne,pc:Xt,pbc:Je,n:hi,o:t};let Xn,Fs;return{render:bi,hydrate:Xn,createApp:dL(bi,Xn)}}function Yv({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function ru({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function wL(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function P1(t,e,i=!1){const s=t.children,n=e.children;if(Vt(s)&&Vt(n))for(let a=0;a>1,t[i[c]]0&&(e[s]=i[a-1]),i[a]=s)}}for(a=i.length,u=i[a-1];a-- >0;)i[a]=u,u=e[u];return i}function AM(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:AM(e)}function XA(t){if(t)for(let e=0;eIf(SL);function AL(t,e){return M1(t,null,{flush:"sync"})}function ar(t,e,i){return M1(t,e,i)}function M1(t,e,i=Ii){const{immediate:s,deep:n,flush:a,once:u}=i,c=Ds({},i),_=e&&s||!e&&a!=="post";let w;if(ug){if(a==="sync"){const D=EL();w=D.__watcherHandles||(D.__watcherHandles=[])}else if(!_){const D=()=>{};return D.stop=da,D.resume=da,D.pause=da,D}}const S=Sn;c.call=(D,U,L)=>Bo(D,S,U,L);let A=!1;a==="post"?c.scheduler=D=>{wr(D,S&&S.suspense)}:a!=="sync"&&(A=!0,c.scheduler=(D,U)=>{U?D():T1(D)}),c.augmentJob=D=>{e&&(D.flags|=4),A&&(D.flags|=2,S&&(D.id=S.uid,D.i=S))};const P=LB(t,e,c);return ug&&(w?w.push(P):_&&P()),P}function IL(t,e,i){const s=this.proxy,n=ws(t)?t.includes(".")?IM(s,t):()=>s[t]:t.bind(s,s);let a;Gt(e)?a=e:(a=e.handler,i=e);const u=Bg(this),c=M1(n,a.bind(s),i);return u(),c}function IM(t,e){const i=e.split(".");return()=>{let s=t;for(let n=0;n{let S,A=Ii,P;return AL(()=>{const D=t[n];Sr(S,D)&&(S=D,w())}),{get(){return _(),i.get?i.get(S):S},set(D){const U=i.set?i.set(D):D;if(!Sr(U,S)&&!(A!==Ii&&Sr(D,A)))return;const L=s.vnode.props;L&&(e in L||n in L||a in L)&&(`onUpdate:${e}`in L||`onUpdate:${n}`in L||`onUpdate:${a}`in L)||(S=D,w()),s.emit(`update:${e}`,U),Sr(D,U)&&Sr(D,A)&&!Sr(U,P)&&w(),A=D,P=U}}});return c[Symbol.iterator]=()=>{let _=0;return{next(){return _<2?{value:_++?u||Ii:c,done:!1}:{done:!0}}}},c}const CM=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Qr(e)}Modifiers`]||t[`${rl(e)}Modifiers`];function CL(t,e,...i){if(t.isUnmounted)return;const s=t.vnode.props||Ii;let n=i;const a=e.startsWith("update:"),u=a&&CM(s,e.slice(7));u&&(u.trim&&(n=i.map(S=>ws(S)?S.trim():S)),u.number&&(n=i.map(eB)));let c,_=s[c=Vv(e)]||s[c=Vv(Qr(e))];!_&&a&&(_=s[c=Vv(rl(e))]),_&&Bo(_,t,6,n);const w=s[c+"Once"];if(w){if(!t.emitted)t.emitted={};else if(t.emitted[c])return;t.emitted[c]=!0,Bo(w,t,6,n)}}function PM(t,e,i=!1){const s=e.emitsCache,n=s.get(t);if(n!==void 0)return n;const a=t.emits;let u={},c=!1;if(!Gt(t)){const _=w=>{const S=PM(w,e,!0);S&&(c=!0,Ds(u,S))};!i&&e.mixins.length&&e.mixins.forEach(_),t.extends&&_(t.extends),t.mixins&&t.mixins.forEach(_)}return!a&&!c?(Ki(t)&&s.set(t,null),null):(Vt(a)?a.forEach(_=>u[_]=null):Ds(u,a),Ki(t)&&s.set(t,u),u)}function _0(t,e){return!t||!o0(e)?!1:(e=e.slice(2).replace(/Once$/,""),ki(t,e[0].toLowerCase()+e.slice(1))||ki(t,rl(e))||ki(t,e))}function Kv(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[a],slots:u,attrs:c,emit:_,render:w,renderCache:S,props:A,data:P,setupState:D,ctx:U,inheritAttrs:L}=t,W=sy(t);let ee,G;try{if(i.shapeFlag&4){const fe=n||s,Se=fe;ee=na(w.call(Se,fe,S,A,D,P,U)),G=c}else{const fe=e;ee=na(fe.length>1?fe(A,{attrs:c,slots:u,emit:_}):fe(A,null)),G=e.props?c:PL(c)}}catch(fe){Xp.length=0,p0(fe,t,1),ee=Ks(or)}let se=ee;if(G&&L!==!1){const fe=Object.keys(G),{shapeFlag:Se}=se;fe.length&&Se&7&&(a&&fe.some(f1)&&(G=ML(G,a)),se=hc(se,G,!1,!0))}return i.dirs&&(se=hc(se,null,!1,!0),se.dirs=se.dirs?se.dirs.concat(i.dirs):i.dirs),i.transition&&ag(se,i.transition),ee=se,sy(W),ee}const PL=t=>{let e;for(const i in t)(i==="class"||i==="style"||o0(i))&&((e||(e={}))[i]=t[i]);return e},ML=(t,e)=>{const i={};for(const s in t)(!f1(s)||!(s.slice(9)in e))&&(i[s]=t[s]);return i};function RL(t,e,i){const{props:s,children:n,component:a}=t,{props:u,children:c,patchFlag:_}=e,w=a.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&_>=0){if(_&1024)return!0;if(_&16)return s?ZA(s,u,w):!!u;if(_&8){const S=e.dynamicProps;for(let A=0;At.__isSuspense;function OL(t,e){e&&e.pendingBranch?Vt(t)?e.effects.push(...t):e.effects.push(t):VB(t)}const Un=Symbol.for("v-fgt"),y0=Symbol.for("v-txt"),or=Symbol.for("v-cmt"),Jv=Symbol.for("v-stc"),Xp=[];let Yr=null;function ts(t=!1){Xp.push(Yr=t?null:[])}function DL(){Xp.pop(),Yr=Xp[Xp.length-1]||null}let lg=1;function YA(t){lg+=t,t<0&&Yr&&(Yr.hasOnce=!0)}function RM(t){return t.dynamicChildren=lg>0?Yr||vf:null,DL(),lg>0&&Yr&&Yr.push(t),t}function wn(t,e,i,s,n,a){return RM(Ms(t,e,i,s,n,a,!0))}function sl(t,e,i,s,n){return RM(Ks(t,e,i,s,n,!0))}function cg(t){return t?t.__v_isVNode===!0:!1}function du(t,e){return t.type===e.type&&t.key===e.key}const kM=({key:t})=>t??null,V_=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?ws(t)||dn(t)||Gt(t)?{i:fn,r:t,k:e,f:!!i}:t:null);function Ms(t,e=null,i=null,s=0,n=null,a=t===Un?0:1,u=!1,c=!1){const _={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&kM(e),ref:e&&V_(e),scopeId:GP,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:fn};return c?(R1(_,i),a&128&&t.normalize(_)):i&&(_.shapeFlag|=ws(i)?8:16),lg>0&&!u&&Yr&&(_.patchFlag>0||a&6)&&_.patchFlag!==32&&Yr.push(_),_}const Ks=FL;function FL(t,e=null,i=null,s=0,n=null,a=!1){if((!t||t===hM)&&(t=or),cg(t)){const c=hc(t,e,!0);return i&&R1(c,i),lg>0&&!a&&Yr&&(c.shapeFlag&6?Yr[Yr.indexOf(t)]=c:Yr.push(c)),c.patchFlag=-2,c}if(WL(t)&&(t=t.__vccOpts),e){e=NL(e);let{class:c,style:_}=e;c&&!ws(c)&&(e.class=Vn(c)),Ki(_)&&(w1(_)&&!Vt(_)&&(_=Ds({},_)),e.style=Qa(_))}const u=ws(t)?1:MM(t)?128:tM(t)?64:Ki(t)?4:Gt(t)?2:0;return Ms(t,e,i,s,n,u,a,!0)}function NL(t){return t?w1(t)||bM(t)?Ds({},t):t:null}function hc(t,e,i=!1,s=!1){const{props:n,ref:a,patchFlag:u,children:c,transition:_}=t,w=e?b0(n||{},e):n,S={__v_isVNode:!0,__v_skip:!0,type:t.type,props:w,key:w&&kM(w),ref:e&&e.ref?i&&a?Vt(a)?a.concat(V_(e)):[a,V_(e)]:V_(e):a,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Un?u===-1?16:u|16:u,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:_,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&hc(t.ssContent),ssFallback:t.ssFallback&&hc(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return _&&s&&ag(S,_.clone(S)),S}function Fg(t=" ",e=0){return Ks(y0,null,t,e)}function fc(t="",e=!1){return e?(ts(),sl(or,null,t)):Ks(or,null,t)}function na(t){return t==null||typeof t=="boolean"?Ks(or):Vt(t)?Ks(Un,null,t.slice()):cg(t)?Kl(t):Ks(y0,null,String(t))}function Kl(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:hc(t)}function R1(t,e){let i=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(Vt(e))i=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),R1(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!bM(e)?e._ctx=fn:n===3&&fn&&(fn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Gt(e)?(e={default:e,_ctx:fn},i=32):(e=String(e),s&64?(i=16,e=[Fg(e)]):i=8);t.children=e,t.shapeFlag|=i}function b0(...t){const e={};for(let i=0;iSn||fn;let ay,aw;{const t=u0(),e=(i,s)=>{let n;return(n=t[i])||(n=t[i]=[]),n.push(s),a=>{n.length>1?n.forEach(u=>u(a)):n[0](a)}};ay=e("__VUE_INSTANCE_SETTERS__",i=>Sn=i),aw=e("__VUE_SSR_SETTERS__",i=>ug=i)}const Bg=t=>{const e=Sn;return ay(t),t.scope.on(),()=>{t.scope.off(),ay(e)}},KA=()=>{Sn&&Sn.scope.off(),ay(null)};function OM(t){return t.vnode.shapeFlag&4}let ug=!1;function UL(t,e=!1,i=!1){e&&aw(e);const{props:s,children:n}=t.vnode,a=OM(t);pL(t,s,a,e),yL(t,n,i);const u=a?VL(t,e):void 0;return e&&aw(!1),u}function VL(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,oL);const{setup:s}=i;if(s){vc();const n=t.setupContext=s.length>1?$L(t):null,a=Bg(t),u=Dg(s,t,0,[t.props,n]),c=wP(u);if(xc(),a(),(c||t.sp)&&!Ef(t)&&lM(t),c){if(u.then(KA,KA),e)return u.then(_=>{JA(t,_,e)}).catch(_=>{p0(_,t,0)});t.asyncDep=u}else JA(t,u,e)}else DM(t,e)}function JA(t,e,i){Gt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ki(e)&&(t.setupState=XP(e)),DM(t,i)}let GA;function DM(t,e,i){const s=t.type;if(!t.render){if(!e&&GA&&!s.render){const n=s.template||I1(t).template;if(n){const{isCustomElement:a,compilerOptions:u}=t.appContext.config,{delimiters:c,compilerOptions:_}=s,w=Ds(Ds({isCustomElement:a,delimiters:c},u),_);s.render=GA(n,w)}}t.render=s.render||da}{const n=Bg(t);vc();try{aL(t)}finally{xc(),n()}}}const jL={get(t,e){return Ln(t,"get",""),t[e]}};function $L(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,jL),slots:t.slots,emit:t.emit,expose:e}}function v0(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(XP(PB(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in qp)return qp[i](t)},has(e,i){return i in e||i in qp}})):t.proxy}function HL(t,e=!0){return Gt(t)?t.displayName||t.name:t.name||e&&t.__name}function WL(t){return Gt(t)&&"__vccOpts"in t}const Bt=(t,e)=>NB(t,e,ug);function qL(t,e,i){const s=arguments.length;return s===2?Ki(e)&&!Vt(e)?cg(e)?Ks(t,null,[e]):Ks(t,e):Ks(t,null,e):(s>3?i=Array.prototype.slice.call(arguments,2):s===3&&cg(i)&&(i=[i]),Ks(t,e,i))}const XL="3.5.12";/** +* @vue/runtime-dom v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const XL="http://www.w3.org/2000/svg",ZL="http://www.w3.org/1998/Math/MathML",$a=typeof document<"u"?document:null,e2=$a&&$a.createElement("template"),KL={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,s)=>{const n=e==="svg"?$a.createElementNS(XL,t):e==="mathml"?$a.createElementNS(ZL,t):i?$a.createElement(t,{is:i}):$a.createElement(t);return t==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:t=>$a.createTextNode(t),createComment:t=>$a.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>$a.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,s,n,a){const u=i?i.previousSibling:e.lastChild;if(n&&(n===a||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===a||!(n=n.nextSibling)););else{e2.innerHTML=s==="svg"?`${t}`:s==="mathml"?`${t}`:t;const c=e2.content;if(s==="svg"||s==="mathml"){const _=c.firstChild;for(;_.firstChild;)c.appendChild(_.firstChild);c.removeChild(_)}e.insertBefore(c,i)}return[u?u.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Cl="transition",pp="animation",tm=Symbol("_vtc"),M1=(t,{slots:e})=>HL(jB,YL(t),e);M1.displayName="Transition";const OR={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};M1.props=Js({},tR,OR);const Yc=(t,e=[])=>{Ut(t)?t.forEach(i=>i(...e)):t&&t(...e)},t2=t=>t?Ut(t)?t.some(e=>e.length>1):t.length>1:!1;function YL(t){const e={};for(const Xe in t)Xe in OR||(e[Xe]=t[Xe]);if(t.css===!1)return e;const{name:i="v",type:s,duration:n,enterFromClass:a=`${i}-enter-from`,enterActiveClass:u=`${i}-enter-active`,enterToClass:c=`${i}-enter-to`,appearFromClass:_=a,appearActiveClass:w=u,appearToClass:S=c,leaveFromClass:C=`${i}-leave-from`,leaveActiveClass:P=`${i}-leave-active`,leaveToClass:D=`${i}-leave-to`}=t,j=JL(n),L=j&&j[0],H=j&&j[1],{onBeforeEnter:te,onEnter:G,onEnterCancelled:se,onLeave:ve,onLeaveCancelled:Se,onBeforeAppear:ge=te,onAppear:De=G,onAppearCancelled:Fe=se}=e,Be=(Xe,dt,yt)=>{Jc(Xe,dt?S:c),Jc(Xe,dt?w:u),yt&&yt()},Qe=(Xe,dt)=>{Xe._isLeaving=!1,Jc(Xe,C),Jc(Xe,D),Jc(Xe,P),dt&&dt()},He=Xe=>(dt,yt)=>{const Ft=Xe?De:G,jt=()=>Be(dt,Xe,yt);Yc(Ft,[dt,jt]),i2(()=>{Jc(dt,Xe?_:a),Pl(dt,Xe?S:c),t2(Ft)||s2(dt,s,L,jt)})};return Js(e,{onBeforeEnter(Xe){Yc(te,[Xe]),Pl(Xe,a),Pl(Xe,u)},onBeforeAppear(Xe){Yc(ge,[Xe]),Pl(Xe,_),Pl(Xe,w)},onEnter:He(!1),onAppear:He(!0),onLeave(Xe,dt){Xe._isLeaving=!0;const yt=()=>Qe(Xe,dt);Pl(Xe,C),Pl(Xe,P),e4(),i2(()=>{Xe._isLeaving&&(Jc(Xe,C),Pl(Xe,D),t2(ve)||s2(Xe,s,H,yt))}),Yc(ve,[Xe,yt])},onEnterCancelled(Xe){Be(Xe,!1),Yc(se,[Xe])},onAppearCancelled(Xe){Be(Xe,!0),Yc(Fe,[Xe])},onLeaveCancelled(Xe){Qe(Xe),Yc(Se,[Xe])}})}function JL(t){if(t==null)return null;if(Gi(t))return[Hv(t.enter),Hv(t.leave)];{const e=Hv(t);return[e,e]}}function Hv(t){return YN(t)}function Pl(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[tm]||(t[tm]=new Set)).add(e)}function Jc(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const i=t[tm];i&&(i.delete(e),i.size||(t[tm]=void 0))}function i2(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let GL=0;function s2(t,e,i,s){const n=t._endId=++GL,a=()=>{n===t._endId&&s()};if(i)return setTimeout(a,i);const{type:u,timeout:c,propCount:_}=QL(t,e);if(!u)return s();const w=u+"end";let S=0;const C=()=>{t.removeEventListener(w,P),a()},P=D=>{D.target===t&&++S>=_&&C()};setTimeout(()=>{S<_&&C()},c+1),t.addEventListener(w,P)}function QL(t,e){const i=window.getComputedStyle(t),s=j=>(i[j]||"").split(", "),n=s(`${Cl}Delay`),a=s(`${Cl}Duration`),u=n2(n,a),c=s(`${pp}Delay`),_=s(`${pp}Duration`),w=n2(c,_);let S=null,C=0,P=0;e===Cl?u>0&&(S=Cl,C=u,P=a.length):e===pp?w>0&&(S=pp,C=w,P=_.length):(C=Math.max(u,w),S=C>0?u>w?Cl:pp:null,P=S?S===Cl?a.length:_.length:0);const D=S===Cl&&/\b(transform|all)(,|$)/.test(s(`${Cl}Property`).toString());return{type:S,timeout:C,propCount:P,hasTransform:D}}function n2(t,e){for(;t.lengthr2(i)+r2(t[s])))}function r2(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function e4(){return document.body.offsetHeight}function t4(t,e,i){const s=t[tm];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const iy=Symbol("_vod"),DR=Symbol("_vsh"),i4={beforeMount(t,{value:e},{transition:i}){t[iy]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):mp(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:s}){!e!=!i&&(s?e?(s.beforeEnter(t),mp(t,!0),s.enter(t)):s.leave(t,()=>{mp(t,!1)}):mp(t,e))},beforeUnmount(t,{value:e}){mp(t,e)}};function mp(t,e){t.style.display=e?t[iy]:"none",t[DR]=!e}const s4=Symbol(""),n4=/(^|;)\s*display\s*:/;function r4(t,e,i){const s=t.style,n=As(i);let a=!1;if(i&&!n){if(e)if(As(e))for(const u of e.split(";")){const c=u.slice(0,u.indexOf(":")).trim();i[c]==null&&N_(s,c,"")}else for(const u in e)i[u]==null&&N_(s,u,"");for(const u in i)u==="display"&&(a=!0),N_(s,u,i[u])}else if(n){if(e!==i){const u=s[s4];u&&(i+=";"+u),s.cssText=i,a=n4.test(i)}}else e&&t.removeAttribute("style");iy in t&&(t[iy]=a?s.display:"",t[DR]&&(s.display="none"))}const o2=/\s*!important$/;function N_(t,e,i){if(Ut(i))i.forEach(s=>N_(t,e,s));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const s=o4(t,e);o2.test(i)?t.setProperty(tl(s),i.replace(o2,""),"important"):t[s]=i}}const a2=["Webkit","Moz","ms"],qv={};function o4(t,e){const i=qv[e];if(i)return i;let s=fo(e);if(s!=="filter"&&s in t)return qv[e]=s;s=d0(s);for(let n=0;nXv||(h4.then(()=>Xv=0),Xv=Date.now());function f4(t,e){const i=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=i.attached)return;lo(p4(s,i.value),e,5,[s])};return i.value=t,i.attached=d4(),i}function p4(t,e){if(Ut(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(s=>n=>!n._stopped&&s&&s(n))}else return e}const d2=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,m4=(t,e,i,s,n,a)=>{const u=n==="svg";e==="class"?t4(t,s,u):e==="style"?r4(t,i,s):c0(e)?l1(e)||c4(t,e,i,s,a):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):g4(t,e,s,u))?(a4(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&c2(t,e,s,u,a,e!=="value")):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),c2(t,e,s,u))};function g4(t,e,i,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&d2(e)&&ei(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=t.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return d2(e)&&As(i)?!1:e in t}const f2=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Ut(e)?i=>D_(e,i):e},Zv=Symbol("_assign"),_4={deep:!0,created(t,e,i){t[Zv]=f2(i),FR(t,"change",()=>{const s=t._modelValue,n=y4(t),a=t.checked,u=t[Zv];if(Ut(s)){const c=RP(s,n),_=c!==-1;if(a&&!_)u(s.concat(n));else if(!a&&_){const w=[...s];w.splice(c,1),u(w)}}else if(u0(s)){const c=new Set(s);a?c.add(n):c.delete(n),u(c)}else u(NR(t,a))})},mounted:p2,beforeUpdate(t,e,i){t[Zv]=f2(i),p2(t,e,i)}};function p2(t,{value:e,oldValue:i},s){t._modelValue=e,Ut(e)?t.checked=RP(e,s.props.value)>-1:u0(e)?t.checked=e.has(s.props.value):e!==i&&(t.checked=f0(e,NR(t,!0)))}function y4(t){return"_value"in t?t._value:t.value}function NR(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const b4=["ctrl","shift","alt","meta"],v4={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>b4.some(i=>t[`${i}Key`]&&!e.includes(i))},vn=(t,e)=>{const i=t._withMods||(t._withMods={}),s=e.join(".");return i[s]||(i[s]=(n,...a)=>{for(let u=0;u{const i=t._withKeys||(t._withKeys={}),s=e.join(".");return i[s]||(i[s]=n=>{if(!("key"in n))return;const a=tl(n.key);if(e.some(u=>u===a||x4[u]===a))return t(n)})},w4=Js({patchProp:m4},KL);let m2;function T4(){return m2||(m2=yL(w4))}const S4=(...t)=>{const e=T4().createApp(...t),{mount:i}=e;return e.mount=s=>{const n=A4(s);if(!n)return;const a=e._component;!ei(a)&&!a.render&&!a.template&&(a.template=n.innerHTML),n.innerHTML="";const u=i(n,!1,E4(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),u},e};function E4(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function A4(t){return As(t)?document.querySelector(t):t}function sy(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const k1=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),g2=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);g2&&parseFloat(g2[1]);const u_=globalThis,Rh=globalThis.process||{},I4=globalThis.navigator||{};function BR(t){var s,n;if(typeof window<"u"&&((s=window.process)==null?void 0:s.type)==="renderer"||typeof process<"u"&&((n=process.versions)!=null&&n.electron))return!0;const i=typeof navigator<"u"&&navigator.userAgent;return!!(i&&i.indexOf("Electron")>=0)}function pc(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||BR()}function C4(t){return pc()?BR()?"Electron":(I4.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const LR="4.0.7";function P4(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch{return null}}class R4{constructor(e,i,s="sessionStorage"){this.storage=P4(s),this.id=e,this.config=i,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const i=JSON.stringify(this.config);this.storage.setItem(this.id,i)}}_loadConfiguration(){let e={};if(this.storage){const i=this.storage.getItem(this.id);e=i?JSON.parse(i):{}}return Object.assign(this.config,e),this}}function M4(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function k4(t,e=8){const i=Math.max(e-t.length,0);return`${" ".repeat(i)}${t}`}var ny;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ny||(ny={}));const O4=10;function _2(t){return typeof t!="string"?t:(t=t.toUpperCase(),ny[t]||ny.WHITE)}function D4(t,e,i){return!pc&&typeof t=="string"&&(e&&(t=`\x1B[${_2(e)}m${t}\x1B[39m`),i&&(t=`\x1B[${_2(i)+O4}m${t}\x1B[49m`)),t}function F4(t,e=["constructor"]){const i=Object.getPrototypeOf(t),s=Object.getOwnPropertyNames(i),n=t;for(const a of s){const u=n[a];typeof u=="function"&&(e.find(c=>a===c)||(n[a]=u.bind(t)))}}function O1(t,e){if(!t)throw new Error("Assertion failed")}function Mh(){var e,i,s;let t;if(pc()&&u_.performance)t=(i=(e=u_==null?void 0:u_.performance)==null?void 0:e.now)==null?void 0:i.call(e);else if("hrtime"in Rh){const n=(s=Rh==null?void 0:Rh.hrtime)==null?void 0:s.call(Rh);t=n[0]*1e3+n[1]/1e6}else t=Date.now();return t}const kh={debug:pc()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},N4={enabled:!0,level:0};function Oh(){}const y2={},b2={once:!0};class Cm{constructor({id:e}={id:""}){this.VERSION=LR,this._startTs=Mh(),this._deltaTs=Mh(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new R4(`__probe-${this.id}__`,N4),this.timeStamp(`${this.id} started`),F4(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Mh()-this._startTs).toPrecision(10))}getDelta(){return Number((Mh()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,i){this._storage.setConfiguration({[e]:i})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,i){if(!e)throw new Error(i||"Assertion failed")}warn(e){return this._getLogFunction(0,e,kh.warn,arguments,b2)}error(e){return this._getLogFunction(0,e,kh.error,arguments)}deprecated(e,i){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${i}\` instead`)}removed(e,i){return this.error(`\`${e}\` has been removed. Use \`${i}\` instead`)}probe(e,i){return this._getLogFunction(e,i,kh.log,arguments,{time:!0,once:!0})}log(e,i){return this._getLogFunction(e,i,kh.debug,arguments)}info(e,i){return this._getLogFunction(e,i,console.info,arguments)}once(e,i){return this._getLogFunction(e,i,kh.debug||kh.info,arguments,b2)}table(e,i,s){return i?this._getLogFunction(e,i,console.table||Oh,s&&[s],{tag:L4(i)}):Oh}time(e,i){return this._getLogFunction(e,i,console.time?console.time:console.info)}timeEnd(e,i){return this._getLogFunction(e,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,i){return this._getLogFunction(e,i,console.timeStamp||Oh)}group(e,i,s={collapsed:!1}){const n=v2({logLevel:e,message:i,opts:s}),{collapsed:a}=s;return n.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,i,s={}){return this.group(e,i,Object.assign({},s,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Oh)}withGroup(e,i,s){this.group(e,i)();try{s()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=zR(e)}_getLogFunction(e,i,s,n,a){if(this._shouldLog(e)){a=v2({logLevel:e,message:i,args:n,opts:a}),s=s||a.method,O1(s),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Mh();const u=a.tag||a.message;if(a.once&&u)if(!y2[u])y2[u]=Mh();else return Oh;return i=B4(this.id,a.message,a),s.bind(console,i,...a.args)}return Oh}}Cm.VERSION=LR;function zR(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return O1(Number.isFinite(e)&&e>=0),e}function v2(t){const{logLevel:e,message:i}=t;t.logLevel=zR(e);const s=t.args?Array.from(t.args):[];for(;s.length&&s.shift()!==i;);switch(typeof e){case"string":case"function":i!==void 0&&s.unshift(i),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const n=typeof t.message;return O1(n==="string"||n==="object"),Object.assign(t,{args:s},t.opts)}function B4(t,e,i){if(typeof e=="string"){const s=i.time?k4(M4(i.total)):"";e=i.time?`${t}: ${s} ${e}`:`${t}: ${e}`,e=D4(e,i.color,i.background)}return e}function L4(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}function z4(t,e){return UR(t||{},e)}function UR(t,e,i=0){if(i>3)return e;const s={...t};for(const[n,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?s[n]=UR(s[n]||{},e[n],i+1):s[n]=e[n];return s}const U4="latest";function V4(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.1"),globalThis._loadersgl_.version}const j4=V4();function nc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const gu=typeof process!="object"||String(process)!=="[object process]"||process.browser,$4=typeof window<"u"&&typeof window.orientation<"u",x2=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);x2&&parseFloat(x2[1]);class W4{constructor(e,i){J(this,"name");J(this,"workerThread");J(this,"isRunning",!0);J(this,"result");J(this,"_resolve",()=>{});J(this,"_reject",()=>{});this.name=e,this.workerThread=i,this.result=new Promise((s,n)=>{this._resolve=s,this._reject=n})}postMessage(e,i){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:i})}done(e){nc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){nc(this.isRunning),this.isRunning=!1,this._reject(e)}}class Kv{terminate(){}}const Yv=new Map;function H4(t){nc(t.source&&!t.url||!t.source&&t.url);let e=Yv.get(t.source||t.url);return e||(t.url&&(e=q4(t.url),Yv.set(t.url,e)),t.source&&(e=VR(t.source),Yv.set(t.source,e))),nc(e),e}function q4(t){if(!t.startsWith("http"))return t;const e=X4(t);return VR(e)}function VR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function X4(t){return`try { +**/let lw;const QA=typeof window<"u"&&window.trustedTypes;if(QA)try{lw=QA.createPolicy("vue",{createHTML:t=>t})}catch{}const FM=lw?t=>lw.createHTML(t):t=>t,ZL="http://www.w3.org/2000/svg",YL="http://www.w3.org/1998/Math/MathML",qa=typeof document<"u"?document:null,e2=qa&&qa.createElement("template"),KL={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,s)=>{const n=e==="svg"?qa.createElementNS(ZL,t):e==="mathml"?qa.createElementNS(YL,t):i?qa.createElement(t,{is:i}):qa.createElement(t);return t==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:t=>qa.createTextNode(t),createComment:t=>qa.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>qa.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,s,n,a){const u=i?i.previousSibling:e.lastChild;if(n&&(n===a||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===a||!(n=n.nextSibling)););else{e2.innerHTML=FM(s==="svg"?`${t}`:s==="mathml"?`${t}`:t);const c=e2.content;if(s==="svg"||s==="mathml"){const _=c.firstChild;for(;_.firstChild;)c.appendChild(_.firstChild);c.removeChild(_)}e.insertBefore(c,i)}return[u?u.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Vl="transition",Tp="animation",hg=Symbol("_vtc"),NM={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},JL=Ds({},sM,NM),GL=t=>(t.displayName="Transition",t.props=JL,t),QL=GL((t,{slots:e})=>qL(ZB,ez(t),e)),ou=(t,e=[])=>{Vt(t)?t.forEach(i=>i(...e)):t&&t(...e)},t2=t=>t?Vt(t)?t.some(e=>e.length>1):t.length>1:!1;function ez(t){const e={};for(const qe in t)qe in NM||(e[qe]=t[qe]);if(t.css===!1)return e;const{name:i="v",type:s,duration:n,enterFromClass:a=`${i}-enter-from`,enterActiveClass:u=`${i}-enter-active`,enterToClass:c=`${i}-enter-to`,appearFromClass:_=a,appearActiveClass:w=u,appearToClass:S=c,leaveFromClass:A=`${i}-leave-from`,leaveActiveClass:P=`${i}-leave-active`,leaveToClass:D=`${i}-leave-to`}=t,U=tz(n),L=U&&U[0],W=U&&U[1],{onBeforeEnter:ee,onEnter:G,onEnterCancelled:se,onLeave:fe,onLeaveCancelled:Se,onBeforeAppear:Te=ee,onAppear:Fe=G,onAppearCancelled:Ne=se}=e,Oe=(qe,ht,_t)=>{au(qe,ht?S:c),au(qe,ht?w:u),_t&&_t()},Je=(qe,ht)=>{qe._isLeaving=!1,au(qe,A),au(qe,D),au(qe,P),ht&&ht()},Xe=qe=>(ht,_t)=>{const Dt=qe?Fe:G,jt=()=>Oe(ht,qe,_t);ou(Dt,[ht,jt]),i2(()=>{au(ht,qe?_:a),jl(ht,qe?S:c),t2(Dt)||s2(ht,s,L,jt)})};return Ds(e,{onBeforeEnter(qe){ou(ee,[qe]),jl(qe,a),jl(qe,u)},onBeforeAppear(qe){ou(Te,[qe]),jl(qe,_),jl(qe,w)},onEnter:Xe(!1),onAppear:Xe(!0),onLeave(qe,ht){qe._isLeaving=!0;const _t=()=>Je(qe,ht);jl(qe,A),jl(qe,P),nz(),i2(()=>{qe._isLeaving&&(au(qe,A),jl(qe,D),t2(fe)||s2(qe,s,W,_t))}),ou(fe,[qe,_t])},onEnterCancelled(qe){Oe(qe,!1),ou(se,[qe])},onAppearCancelled(qe){Oe(qe,!0),ou(Ne,[qe])},onLeaveCancelled(qe){Je(qe),ou(Se,[qe])}})}function tz(t){if(t==null)return null;if(Ki(t))return[Gv(t.enter),Gv(t.leave)];{const e=Gv(t);return[e,e]}}function Gv(t){return tB(t)}function jl(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[hg]||(t[hg]=new Set)).add(e)}function au(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const i=t[hg];i&&(i.delete(e),i.size||(t[hg]=void 0))}function i2(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let iz=0;function s2(t,e,i,s){const n=t._endId=++iz,a=()=>{n===t._endId&&s()};if(i!=null)return setTimeout(a,i);const{type:u,timeout:c,propCount:_}=sz(t,e);if(!u)return s();const w=u+"end";let S=0;const A=()=>{t.removeEventListener(w,P),a()},P=D=>{D.target===t&&++S>=_&&A()};setTimeout(()=>{S<_&&A()},c+1),t.addEventListener(w,P)}function sz(t,e){const i=window.getComputedStyle(t),s=U=>(i[U]||"").split(", "),n=s(`${Vl}Delay`),a=s(`${Vl}Duration`),u=n2(n,a),c=s(`${Tp}Delay`),_=s(`${Tp}Duration`),w=n2(c,_);let S=null,A=0,P=0;e===Vl?u>0&&(S=Vl,A=u,P=a.length):e===Tp?w>0&&(S=Tp,A=w,P=_.length):(A=Math.max(u,w),S=A>0?u>w?Vl:Tp:null,P=S?S===Vl?a.length:_.length:0);const D=S===Vl&&/\b(transform|all)(,|$)/.test(s(`${Vl}Property`).toString());return{type:S,timeout:A,propCount:P,hasTransform:D}}function n2(t,e){for(;t.lengthr2(i)+r2(t[s])))}function r2(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function nz(){return document.body.offsetHeight}function rz(t,e,i){const s=t[hg];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const ly=Symbol("_vod"),BM=Symbol("_vsh"),oz={beforeMount(t,{value:e},{transition:i}){t[ly]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):Sp(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:s}){!e!=!i&&(s?e?(s.beforeEnter(t),Sp(t,!0),s.enter(t)):s.leave(t,()=>{Sp(t,!1)}):Sp(t,e))},beforeUnmount(t,{value:e}){Sp(t,e)}};function Sp(t,e){t.style.display=e?t[ly]:"none",t[BM]=!e}const az=Symbol(""),lz=/(^|;)\s*display\s*:/;function cz(t,e,i){const s=t.style,n=ws(i);let a=!1;if(i&&!n){if(e)if(ws(e))for(const u of e.split(";")){const c=u.slice(0,u.indexOf(":")).trim();i[c]==null&&j_(s,c,"")}else for(const u in e)i[u]==null&&j_(s,u,"");for(const u in i)u==="display"&&(a=!0),j_(s,u,i[u])}else if(n){if(e!==i){const u=s[az];u&&(i+=";"+u),s.cssText=i,a=lz.test(i)}}else e&&t.removeAttribute("style");ly in t&&(t[ly]=a?s.display:"",t[BM]&&(s.display="none"))}const o2=/\s*!important$/;function j_(t,e,i){if(Vt(i))i.forEach(s=>j_(t,e,s));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const s=uz(t,e);o2.test(i)?t.setProperty(rl(s),i.replace(o2,""),"important"):t[s]=i}}const a2=["Webkit","Moz","ms"],Qv={};function uz(t,e){const i=Qv[e];if(i)return i;let s=Qr(e);if(s!=="filter"&&s in t)return Qv[e]=s;s=c0(s);for(let n=0;nex||(pz.then(()=>ex=0),ex=Date.now());function mz(t,e){const i=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=i.attached)return;Bo(_z(s,i.value),e,5,[s])};return i.value=t,i.attached=gz(),i}function _z(t,e){if(Vt(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(s=>n=>!n._stopped&&s&&s(n))}else return e}const d2=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,yz=(t,e,i,s,n,a)=>{const u=n==="svg";e==="class"?rz(t,s,u):e==="style"?cz(t,i,s):o0(e)?f1(e)||fz(t,e,i,s,a):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):bz(t,e,s,u))?(u2(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&c2(t,e,s,u,a,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!ws(s))?u2(t,Qr(e),s,a,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),c2(t,e,s,u))};function bz(t,e,i,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&d2(e)&&Gt(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=t.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return d2(e)&&ws(i)?!1:e in t}const p2=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Vt(e)?i=>z_(e,i):e},tx=Symbol("_assign"),vz={deep:!0,created(t,e,i){t[tx]=p2(i),LM(t,"change",()=>{const s=t._modelValue,n=xz(t),a=t.checked,u=t[tx];if(Vt(s)){const c=IP(s,n),_=c!==-1;if(a&&!_)u(s.concat(n));else if(!a&&_){const w=[...s];w.splice(c,1),u(w)}}else if(a0(s)){const c=new Set(s);a?c.add(n):c.delete(n),u(c)}else u(zM(t,a))})},mounted:g2,beforeUpdate(t,e,i){t[tx]=p2(i),g2(t,e,i)}};function g2(t,{value:e,oldValue:i},s){t._modelValue=e;let n;if(Vt(e))n=IP(e,s.props.value)>-1;else if(a0(e))n=e.has(s.props.value);else{if(e===i)return;n=h0(e,zM(t,!0))}t.checked!==n&&(t.checked=n)}function xz(t){return"_value"in t?t._value:t.value}function zM(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const wz=["ctrl","shift","alt","meta"],Tz={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>wz.some(i=>t[`${i}Key`]&&!e.includes(i))},xn=(t,e)=>{const i=t._withMods||(t._withMods={}),s=e.join(".");return i[s]||(i[s]=(n,...a)=>{for(let u=0;u{const i=t._withKeys||(t._withKeys={}),s=e.join(".");return i[s]||(i[s]=n=>{if(!("key"in n))return;const a=rl(n.key);if(e.some(u=>u===a||Sz[u]===a))return t(n)})},Ez=Ds({patchProp:yz},KL);let m2;function Az(){return m2||(m2=vL(Ez))}const Iz=(...t)=>{const e=Az().createApp(...t),{mount:i}=e;return e.mount=s=>{const n=Pz(s);if(!n)return;const a=e._component;!Gt(a)&&!a.render&&!a.template&&(a.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const u=i(n,!1,Cz(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),u},e};function Cz(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Pz(t){return ws(t)?document.querySelector(t):t}function cy(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const k1=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),_2=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);_2&&parseFloat(_2[1]);const p_=globalThis,Xh=globalThis.process||{},Mz=globalThis.navigator||{};function UM(t){var s,n;if(typeof window<"u"&&((s=window.process)==null?void 0:s.type)==="renderer"||typeof process<"u"&&((n=process.versions)!=null&&n.electron))return!0;const i=typeof navigator<"u"&&navigator.userAgent;return!!(i&&i.indexOf("Electron")>=0)}function Tc(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||UM()}function Rz(t){return Tc()?UM()?"Electron":(Mz.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const VM="4.0.7";function kz(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch{return null}}class Oz{constructor(e,i,s="sessionStorage"){this.storage=kz(s),this.id=e,this.config=i,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const i=JSON.stringify(this.config);this.storage.setItem(this.id,i)}}_loadConfiguration(){let e={};if(this.storage){const i=this.storage.getItem(this.id);e=i?JSON.parse(i):{}}return Object.assign(this.config,e),this}}function Dz(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function Fz(t,e=8){const i=Math.max(e-t.length,0);return`${" ".repeat(i)}${t}`}var uy;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(uy||(uy={}));const Nz=10;function y2(t){return typeof t!="string"?t:(t=t.toUpperCase(),uy[t]||uy.WHITE)}function Bz(t,e,i){return!Tc&&typeof t=="string"&&(e&&(t=`\x1B[${y2(e)}m${t}\x1B[39m`),i&&(t=`\x1B[${y2(i)+Nz}m${t}\x1B[49m`)),t}function Lz(t,e=["constructor"]){const i=Object.getPrototypeOf(t),s=Object.getOwnPropertyNames(i),n=t;for(const a of s){const u=n[a];typeof u=="function"&&(e.find(c=>a===c)||(n[a]=u.bind(t)))}}function O1(t,e){if(!t)throw new Error("Assertion failed")}function Zh(){var e,i,s;let t;if(Tc()&&p_.performance)t=(i=(e=p_==null?void 0:p_.performance)==null?void 0:e.now)==null?void 0:i.call(e);else if("hrtime"in Xh){const n=(s=Xh==null?void 0:Xh.hrtime)==null?void 0:s.call(Xh);t=n[0]*1e3+n[1]/1e6}else t=Date.now();return t}const Yh={debug:Tc()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},zz={enabled:!0,level:0};function Kh(){}const b2={},v2={once:!0};class Lg{constructor({id:e}={id:""}){this.VERSION=VM,this._startTs=Zh(),this._deltaTs=Zh(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Oz(`__probe-${this.id}__`,zz),this.timeStamp(`${this.id} started`),Lz(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Zh()-this._startTs).toPrecision(10))}getDelta(){return Number((Zh()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,i){this._storage.setConfiguration({[e]:i})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,i){if(!e)throw new Error(i||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Yh.warn,arguments,v2)}error(e){return this._getLogFunction(0,e,Yh.error,arguments)}deprecated(e,i){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${i}\` instead`)}removed(e,i){return this.error(`\`${e}\` has been removed. Use \`${i}\` instead`)}probe(e,i){return this._getLogFunction(e,i,Yh.log,arguments,{time:!0,once:!0})}log(e,i){return this._getLogFunction(e,i,Yh.debug,arguments)}info(e,i){return this._getLogFunction(e,i,console.info,arguments)}once(e,i){return this._getLogFunction(e,i,Yh.debug||Yh.info,arguments,v2)}table(e,i,s){return i?this._getLogFunction(e,i,console.table||Kh,s&&[s],{tag:Vz(i)}):Kh}time(e,i){return this._getLogFunction(e,i,console.time?console.time:console.info)}timeEnd(e,i){return this._getLogFunction(e,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,i){return this._getLogFunction(e,i,console.timeStamp||Kh)}group(e,i,s={collapsed:!1}){const n=x2({logLevel:e,message:i,opts:s}),{collapsed:a}=s;return n.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,i,s={}){return this.group(e,i,Object.assign({},s,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Kh)}withGroup(e,i,s){this.group(e,i)();try{s()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=jM(e)}_getLogFunction(e,i,s,n,a){if(this._shouldLog(e)){a=x2({logLevel:e,message:i,args:n,opts:a}),s=s||a.method,O1(s),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Zh();const u=a.tag||a.message;if(a.once&&u)if(!b2[u])b2[u]=Zh();else return Kh;return i=Uz(this.id,a.message,a),s.bind(console,i,...a.args)}return Kh}}Lg.VERSION=VM;function jM(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return O1(Number.isFinite(e)&&e>=0),e}function x2(t){const{logLevel:e,message:i}=t;t.logLevel=jM(e);const s=t.args?Array.from(t.args):[];for(;s.length&&s.shift()!==i;);switch(typeof e){case"string":case"function":i!==void 0&&s.unshift(i),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const n=typeof t.message;return O1(n==="string"||n==="object"),Object.assign(t,{args:s},t.opts)}function Uz(t,e,i){if(typeof e=="string"){const s=i.time?Fz(Dz(i.total)):"";e=i.time?`${t}: ${s} ${e}`:`${t}: ${e}`,e=Bz(e,i.color,i.background)}return e}function Vz(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}const ix="4.3.1",jz=ix[0]>="0"&&ix[0]<="9"?`v${ix}`:"";function $z(){const t=new Lg({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=t,globalThis.loaders.version=jz,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=t,t}const Hz=$z();function Wz(t,e){return $M(t||{},e)}function $M(t,e,i=0){if(i>3)return e;const s={...t};for(const[n,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?s[n]=$M(s[n]||{},e[n],i+1):s[n]=e[n];return s}const qz="latest";function Xz(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.1"),globalThis._loadersgl_.version}const Zz=Xz();function dc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Au=typeof process!="object"||String(process)!=="[object process]"||process.browser,Yz=typeof window<"u"&&typeof window.orientation<"u",w2=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);w2&&parseFloat(w2[1]);class Kz{constructor(e,i){K(this,"name");K(this,"workerThread");K(this,"isRunning",!0);K(this,"result");K(this,"_resolve",()=>{});K(this,"_reject",()=>{});this.name=e,this.workerThread=i,this.result=new Promise((s,n)=>{this._resolve=s,this._reject=n})}postMessage(e,i){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:i})}done(e){dc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){dc(this.isRunning),this.isRunning=!1,this._reject(e)}}class sx{terminate(){}}const nx=new Map;function Jz(t){dc(t.source&&!t.url||!t.source&&t.url);let e=nx.get(t.source||t.url);return e||(t.url&&(e=Gz(t.url),nx.set(t.url,e)),t.source&&(e=HM(t.source),nx.set(t.source,e))),dc(e),e}function Gz(t){if(!t.startsWith("http"))return t;const e=Qz(t);return HM(e)}function HM(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Qz(t){return`try { importScripts('${t}'); } catch (error) { console.error(error); throw error; -}`}function jR(t,e=!0,i){const s=i||new Set;if(t){if(w2(t))s.add(t);else if(w2(t.buffer))s.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const n in t)jR(t[n],e,s)}}return i===void 0?Array.from(s):[]}function w2(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const Jv=()=>{};class ew{constructor(e){J(this,"name");J(this,"source");J(this,"url");J(this,"terminated",!1);J(this,"worker");J(this,"onMessage");J(this,"onError");J(this,"_loadableURL","");const{name:i,source:s,url:n}=e;nc(s||n),this.name=i,this.source=s,this.url=n,this.onMessage=Jv,this.onError=a=>console.log(a),this.worker=gu?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&gu||typeof Kv<"u"&&!gu}destroy(){this.onMessage=Jv,this.onError=Jv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,i){i=i||jR(e),this.worker.postMessage(e,i)}_getErrorFromErrorEvent(e){let i="Failed to load ";return i+=`worker ${this.name} from ${this.url}. `,e.message&&(i+=`${e.message} in `),e.lineno&&(i+=`:${e.lineno}:${e.colno}`),new Error(i)}_createBrowserWorker(){this._loadableURL=H4({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=i=>{i.data?this.onMessage(i.data):this.onError(new Error("No data received"))},e.onerror=i=>{this.onError(this._getErrorFromErrorEvent(i)),this.terminated=!0},e.onmessageerror=i=>console.error(i),e}_createNodeWorker(){let e;if(this.url){const s=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Kv(s,{eval:!1})}else if(this.source)e=new Kv(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",i=>{this.onMessage(i)}),e.on("error",i=>{this.onError(i)}),e.on("exit",i=>{}),e}}class Z4{constructor(e){J(this,"name","unnamed");J(this,"source");J(this,"url");J(this,"maxConcurrency",1);J(this,"maxMobileConcurrency",1);J(this,"onDebug",()=>{});J(this,"reuseWorkers",!0);J(this,"props",{});J(this,"jobQueue",[]);J(this,"idleQueue",[]);J(this,"count",0);J(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return ew.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,i=(n,a,u)=>n.done(u),s=(n,a)=>n.error(a)){const n=new Promise(a=>(this.jobQueue.push({name:e,onMessage:i,onError:s,onStart:a}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const i=this.jobQueue.shift();if(i){this.onDebug({message:"Starting job",name:i.name,workerThread:e,backlog:this.jobQueue.length});const s=new W4(i.name,e);e.onMessage=n=>i.onMessage(s,n.type,n.payload),e.onError=n=>i.onError(s,n),i.onStart(s);try{await s.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!gu||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}},Vl=class Vl{constructor(e){J(this,"props");J(this,"workerPools",new Map);this.props={...K4},this.setProps(e),this.workerPools=new Map}static isSupported(){return ew.isSupported()}static getWorkerFarm(e={}){return Vl._workerFarm=Vl._workerFarm||new Vl({}),Vl._workerFarm.setProps(e),Vl._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const i of this.workerPools.values())i.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:i,source:s,url:n}=e;let a=this.workerPools.get(i);return a||(a=new Z4({name:i,source:s,url:n}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(i,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};J(Vl,"_workerFarm");let ry=Vl;function Y4(t,e={}){const i=e[t.id]||{},s=gu?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let n=i.workerUrl;if(!n&&t.id==="compression"&&(n=e.workerUrl),e._workerType==="test"&&(gu?n=`modules/${t.module}/dist/${s}`:n=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!n){let a=t.version;a==="latest"&&(a=U4);const u=a?`@${a}`:"";n=`https://unpkg.com/@loaders.gl/${t.module}${u}/dist/${s}`}return nc(n),n}function J4(t,e=j4){nc(t,"no worker provided");const i=t.version;return!(!e||!i)}function G4(t,e){return!ry.isSupported()||!gu&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function Q4(t,e,i,s,n){const a=t.id,u=Y4(t,i),_=ry.getWorkerFarm(i).getWorkerPool({name:a,url:u});i=JSON.parse(JSON.stringify(i)),s=JSON.parse(JSON.stringify(s||{}));const w=await _.startJob("process-on-worker",ez.bind(null,n));return w.postMessage("process",{input:e,options:i,context:s}),await(await w.result).result}async function ez(t,e,i,s){switch(i){case"done":e.done(s);break;case"error":e.error(new Error(s.error));break;case"process":const{id:n,input:a,options:u}=s;try{const c=await t(a,u);e.postMessage("done",{id:n,result:c})}catch(c){const _=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:n,error:_})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function tz(t,e,i){if(i=i||t.byteLength,t.byteLengtha instanceof ArrayBuffer?new Uint8Array(a):a),i=e.reduce((a,u)=>a+u.byteLength,0),s=new Uint8Array(i);let n=0;for(const a of e)s.set(a,n),n+=a.byteLength;return s.buffer}async function nz(t){const e=[];for await(const i of t)e.push(i);return iz(...e)}function T2(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class S2{constructor(e,i){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=i,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=T2(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(T2()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class S0{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,i="count"){return this._getOrCreate({name:e,type:i})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const i of Object.values(this.stats))e(i)}getTable(){const e={};return this.forEach(i=>{e[i.name]={time:i.time||0,count:i.count||0,average:i.getAverageTime()||0,hz:i.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(i=>this._getOrCreate(i))}_getOrCreate(e){const{name:i,type:s}=e;let n=this.stats[i];return n||(e instanceof S2?n=e:n=new S2(i,s),this.stats[i]=n),n}}let rz="";const E2={};function oz(t){for(const e in E2)if(t.startsWith(e)){const i=E2[e];t=t.replace(e,i)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${rz}${t}`),t}function az(t){return t&&typeof t=="object"&&t.isBuffer}function $R(t){if(az(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function WR(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function lz(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const cz=t=>typeof t=="boolean",Up=t=>typeof t=="function",Pm=t=>t!==null&&typeof t=="object",A2=t=>Pm(t)&&t.constructor==={}.constructor,uz=t=>!!t&&typeof t[Symbol.iterator]=="function",hz=t=>t&&typeof t[Symbol.asyncIterator]=="function",Ru=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Mu=t=>typeof Blob<"u"&&t instanceof Blob,dz=t=>t&&typeof t=="object"&&t.isBuffer,fz=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||Pm(t)&&Up(t.tee)&&Up(t.cancel)&&Up(t.getReader),pz=t=>Pm(t)&&Up(t.read)&&Up(t.pipe)&&cz(t.readable),HR=t=>fz(t)||pz(t);class mz extends Error{constructor(i,s){super(i);J(this,"reason");J(this,"url");J(this,"response");this.reason=s.reason,this.url=s.url,this.response=s.response}}const gz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,_z=/^([-\w.]+\/[-\w.+]+)/;function I2(t,e){return t.toLowerCase()===e.toLowerCase()}function yz(t){const e=_z.exec(t);return e?e[1]:t}function C2(t){const e=gz.exec(t);return e?e[1]:""}const qR=/\?.*/;function bz(t){const e=t.match(qR);return e&&e[0]}function D1(t){return t.replace(qR,"")}function vz(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function E0(t){return Ru(t)?t.url:Mu(t)?t.name||"":typeof t=="string"?t:""}function F1(t){if(Ru(t)){const e=t,i=e.headers.get("content-type")||"",s=D1(e.url);return yz(i)||C2(s)}return Mu(t)?t.type||"":typeof t=="string"?C2(t):""}function xz(t){return Ru(t)?t.headers["content-length"]||-1:Mu(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function XR(t){if(Ru(t))return t;const e={},i=xz(t);i>=0&&(e["content-length"]=String(i));const s=E0(t),n=F1(t);n&&(e["content-type"]=n);const a=await Sz(t);a&&(e["x-first-bytes"]=a),typeof t=="string"&&(t=new TextEncoder().encode(t));const u=new Response(t,{headers:e});return Object.defineProperty(u,"url",{value:s}),u}async function wz(t){if(!t.ok)throw await Tz(t)}async function Tz(t){const e=vz(t.url);let i=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;i=i.length>100?`${i.slice(0,100)}...`:i;const s={reason:t.statusText,url:t.url,response:t};try{const n=t.headers.get("Content-Type");s.reason=n!=null&&n.includes("application/json")?await t.json():t.text()}catch{}return new mz(i,s)}async function Sz(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const i=t.slice(0,5);return await new Promise(s=>{const n=new FileReader;n.onload=a=>{var u;return s((u=a==null?void 0:a.target)==null?void 0:u.result)},n.readAsDataURL(i)})}if(t instanceof ArrayBuffer){const i=t.slice(0,5);return`data:base64,${Ez(i)}`}return null}function Ez(t){let e="";const i=new Uint8Array(t);for(let s=0;s{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class Rz{constructor(){J(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const ZR={fetch:null,mimeType:void 0,nothrow:!1,log:new Rz,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:k1,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Mz={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function KR(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function YR(){const t=KR();return t.globalOptions=t.globalOptions||{...ZR},t.globalOptions}function kz(t,e,i,s){return i=i||[],i=Array.isArray(i)?i:[i],Oz(t,i),Fz(e,t,s)}function Oz(t,e){M2(t,null,ZR,Mz,e);for(const i of e){const s=t&&t[i.id]||{},n=i.options&&i.options[i.id]||{},a=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};M2(s,i.id,n,a,e)}}function M2(t,e,i,s,n){const a=e||"Top level",u=e?`${e}.`:"";for(const c in t){const _=!e&&Pm(t[c]),w=c==="baseUri"&&!e,S=c==="workerUrl"&&e;if(!(c in i)&&!w&&!S){if(c in s)R2.warn(`${a} loader option '${u}${c}' no longer supported, use '${s[c]}'`)();else if(!_){const C=Dz(c,n);R2.warn(`${a} loader option '${u}${c}' not recognized. ${C}`)()}}}}function Dz(t,e){const i=t.toLowerCase();let s="";for(const n of e)for(const a in n.options){if(t===a)return`Did you mean '${n.id}.${a}'?`;const u=a.toLowerCase();(i.startsWith(u)||u.startsWith(i))&&(s=s||`Did you mean '${n.id}.${a}'?`)}return s}function Fz(t,e,i){const n={...t.options||{}};return Nz(n,i),n.log===null&&(n.log=new Pz),k2(n,YR()),k2(n,e),n}function k2(t,e){for(const i in e)if(i in e){const s=e[i];A2(s)&&A2(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}function Nz(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function N1(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function B1(t){sy(t,"null loader"),sy(N1(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const JR=()=>{const t=KR();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function Bz(t){const e=JR();t=Array.isArray(t)?t:[t];for(const i of t){const s=B1(i);e.find(n=>s===n)||e.unshift(s)}}function Lz(){return JR()}const zz=new Cm({id:"loaders.gl"}),Uz=/\.([^.]+)$/;async function Vz(t,e=[],i,s){if(!GR(t))return null;let n=O2(t,e,{...i,nothrow:!0},s);if(n)return n;if(Mu(t)&&(t=await t.slice(0,10).arrayBuffer(),n=O2(t,e,i,s)),!n&&!(i!=null&&i.nothrow))throw new Error(QR(t));return n}function O2(t,e=[],i,s){if(!GR(t))return null;if(e&&!Array.isArray(e))return B1(e);let n=[];e&&(n=n.concat(e)),i!=null&&i.ignoreRegisteredLoaders||n.push(...Lz()),$z(n);const a=jz(t,n,i,s);if(!a&&!(i!=null&&i.nothrow))throw new Error(QR(t));return a}function jz(t,e,i,s){const n=E0(t),a=F1(t),u=D1(n)||(s==null?void 0:s.url);let c=null,_="";return i!=null&&i.mimeType&&(c=Gv(e,i==null?void 0:i.mimeType),_=`match forced by supplied MIME type ${i==null?void 0:i.mimeType}`),c=c||Wz(e,u),_=_||(c?`matched url ${u}`:""),c=c||Gv(e,a),_=_||(c?`matched MIME type ${a}`:""),c=c||qz(e,t),_=_||(c?`matched initial data ${eM(t)}`:""),i!=null&&i.fallbackMimeType&&(c=c||Gv(e,i==null?void 0:i.fallbackMimeType),_=_||(c?`matched fallback MIME type ${a}`:"")),_&&zz.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${_}.`),c}function GR(t){return!(t instanceof Response&&t.status===204)}function QR(t){const e=E0(t),i=F1(t);let s="No valid loader found (";s+=e?`${WR(e)}, `:"no url provided, ",s+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const n=t?eM(t):"";return s+=n?` first bytes: "${n}"`:"first bytes: not available",s+=")",s}function $z(t){for(const e of t)B1(e)}function Wz(t,e){const i=e&&Uz.exec(e),s=i&&i[1];return s?Hz(t,s):null}function Hz(t,e){e=e.toLowerCase();for(const i of t)for(const s of i.extensions)if(s.toLowerCase()===e)return i;return null}function Gv(t,e){var i;for(const s of t)if((i=s.mimeTypes)!=null&&i.some(n=>I2(e,n))||I2(e,`application/x.${s.id}`))return s;return null}function qz(t,e){if(!e)return null;for(const i of t)if(typeof e=="string"){if(Xz(e,i))return i}else if(ArrayBuffer.isView(e)){if(D2(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer&&D2(e,0,i))return i;return null}function Xz(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(s=>t.startsWith(s))}function D2(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(n=>Zz(t,e,i,n))}function Zz(t,e,i,s){if(s instanceof ArrayBuffer)return tz(s,t,s.byteLength);switch(typeof s){case"function":return s(t);case"string":const n=tw(t,e,s.length);return s===n;default:return!1}}function eM(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?tw(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?tw(t,0,e):""}function tw(t,e,i){if(t.byteLengthP2(n,s.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:P2}function o6(t,e,i){if(i)return i;const s={fetch:iM(e,t),...t};if(s.url){const n=D1(s.url);s.baseUrl=n,s.queryString=bz(s.url),s.filename=WR(n),s.baseUrl=lz(n)}return Array.isArray(s.loaders)||(s.loaders=null),s}function a6(t,e){if(t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const s=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...s]:s}return i&&i.length?i:void 0}async function oy(t,e,i,s){e&&!Array.isArray(e)&&!N1(e)&&(s=void 0,i=e,e=void 0),t=await t,i=i||{};const n=E0(t),u=a6(e,s),c=await Vz(t,u,i);return c?(i=kz(i,c,u,n),s=o6({url:n,_parse:oy,loaders:u},i,s||null),await l6(c,t,i,s)):null}async function l6(t,e,i,s){if(J4(t),i=z4(t.options,i),Ru(e)){const a=e,{ok:u,redirected:c,status:_,statusText:w,type:S,url:C}=a,P=Object.fromEntries(a.headers.entries());s.response={headers:P,ok:u,redirected:c,status:_,statusText:w,type:S,url:C}}e=await r6(e,t,i);const n=t;if(n.parseTextSync&&typeof e=="string")return n.parseTextSync(e,i,s);if(G4(t,i))return await Q4(t,e,i,s,oy);if(n.parseText&&typeof e=="string")return await n.parseText(e,i,s);if(n.parse)return await n.parse(e,i,s);throw nc(!n.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}async function iw(t,e,i,s){let n,a;!Array.isArray(e)&&!N1(e)?(n=[],a=e):(n=e,a=i);const u=iM(a);let c=t;return typeof t=="string"&&(c=await u(t)),Mu(t)&&(c=await u(t)),Array.isArray(n)?await oy(c,n,a):await oy(c,n,a)}const c6="4.2.1";var TP;const u6=(TP=globalThis.loaders)==null?void 0:TP.parseImageNode,sw=typeof Image<"u",nw=typeof ImageBitmap<"u",h6=!!u6,rw=k1?!0:h6;function d6(t){switch(t){case"auto":return nw||sw||rw;case"imagebitmap":return nw;case"image":return sw;case"data":return rw;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function f6(){if(nw)return"imagebitmap";if(sw)return"image";if(rw)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function p6(t){const e=g6(t);if(!e)throw new Error("Not an image");return e}function m6(t){switch(p6(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function g6(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const _6=/^data:image\/svg\+xml/,y6=/\.svg((\?|#).*)?$/;function L1(t){return t&&(_6.test(t)||y6.test(t))}function b6(t,e){if(L1(e)){let s=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(s=unescape(encodeURIComponent(s)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(s)}`}return sM(t,e)}function sM(t,e){if(L1(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function nM(t,e,i){const s=b6(t,i),n=self.URL||self.webkitURL,a=typeof s!="string"&&n.createObjectURL(s);try{return await v6(a||s,e)}finally{a&&n.revokeObjectURL(a)}}async function v6(t,e){const i=new Image;return i.src=t,e.image&&e.image.decode&&i.decode?(await i.decode(),i):await new Promise((s,n)=>{try{i.onload=()=>s(i),i.onerror=a=>{const u=a instanceof Error?a.message:"error";n(new Error(u))}}catch(a){n(a)}})}const x6={};let N2=!0;async function w6(t,e,i){let s;L1(i)?s=await nM(t,e,i):s=sM(t,i);const n=e&&e.imagebitmap;return await T6(s,n)}async function T6(t,e=null){if((S6(e)||!N2)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),N2=!1}return await createImageBitmap(t)}function S6(t){for(const e in t||x6)return!1;return!0}function E6(t){return!P6(t,"ftyp",4)||!(t[8]&96)?null:A6(t)}function A6(t){switch(I6(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function I6(t,e,i){return String.fromCharCode(...t.slice(e,i))}function C6(t){return[...t].map(e=>e.charCodeAt(0))}function P6(t,e,i=0){const s=C6(e);for(let n=0;n=24&&e.getUint32(0,ia)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ia),height:e.getUint32(20,ia)}:null}function k6(t){const e=Rm(t);return e.byteLength>=10&&e.getUint32(0,ia)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Vp),height:e.getUint16(8,Vp)}:null}function O6(t){const e=Rm(t);return e.byteLength>=14&&e.getUint16(0,ia)===16973&&e.getUint32(2,Vp)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Vp),height:e.getUint32(22,Vp)}:null}function D6(t){const e=Rm(t);if(!(e.byteLength>=3&&e.getUint16(0,ia)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:s,sofMarkers:n}=F6();let a=2;for(;a+9!!rM(new DataView(t))],options:V6},Xi=new Cm({id:"deck"});let ow={};function $6(t){ow=t}function tr(t,e,i,s){Xi.level>0&&ow[t]&&ow[t].call(null,e,i,s)}function W6(t){const e=t[0],i=t[t.length-1];return e==="{"&&i==="}"||e==="["&&i==="]"}const H6={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:W6,parseTextSync:JSON.parse};function q6(){const t="9.0.27",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(Xi.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:Xi,_registerLoggers:$6},Bz([H6,[j6,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const X6=q6();function lu(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const Qv={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Z6(t){const e={};for(const[i,s]of Object.entries(t))e[i]=Y6(s);return e}function K6(t,e,i){const s={};for(const[n,a]of Object.entries(e))t&&n in t&&!a.private?(a.validate&&lu(a.validate(t[n],a),`${i}: invalid ${n}`),s[n]=t[n]):s[n]=a.value;return s}function Y6(t){let e=B2(t);if(e!=="object")return{value:t,...Qv[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...Qv[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=B2(t.value),{...t,...Qv[e],type:e}):{type:"object",value:null};throw new Error("props")}function B2(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const J6=`#ifdef MODULE_LOGDEPTH +}`}function WM(t,e=!0,i){const s=i||new Set;if(t){if(T2(t))s.add(t);else if(T2(t.buffer))s.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const n in t)WM(t[n],e,s)}}return i===void 0?Array.from(s):[]}function T2(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const rx=()=>{};class cw{constructor(e){K(this,"name");K(this,"source");K(this,"url");K(this,"terminated",!1);K(this,"worker");K(this,"onMessage");K(this,"onError");K(this,"_loadableURL","");const{name:i,source:s,url:n}=e;dc(s||n),this.name=i,this.source=s,this.url=n,this.onMessage=rx,this.onError=a=>console.log(a),this.worker=Au?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Au||typeof sx<"u"&&!Au}destroy(){this.onMessage=rx,this.onError=rx,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,i){i=i||WM(e),this.worker.postMessage(e,i)}_getErrorFromErrorEvent(e){let i="Failed to load ";return i+=`worker ${this.name} from ${this.url}. `,e.message&&(i+=`${e.message} in `),e.lineno&&(i+=`:${e.lineno}:${e.colno}`),new Error(i)}_createBrowserWorker(){this._loadableURL=Jz({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=i=>{i.data?this.onMessage(i.data):this.onError(new Error("No data received"))},e.onerror=i=>{this.onError(this._getErrorFromErrorEvent(i)),this.terminated=!0},e.onmessageerror=i=>console.error(i),e}_createNodeWorker(){let e;if(this.url){const s=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new sx(s,{eval:!1})}else if(this.source)e=new sx(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",i=>{this.onMessage(i)}),e.on("error",i=>{this.onError(i)}),e.on("exit",i=>{}),e}}class e4{constructor(e){K(this,"name","unnamed");K(this,"source");K(this,"url");K(this,"maxConcurrency",1);K(this,"maxMobileConcurrency",1);K(this,"onDebug",()=>{});K(this,"reuseWorkers",!0);K(this,"props",{});K(this,"jobQueue",[]);K(this,"idleQueue",[]);K(this,"count",0);K(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return cw.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,i=(n,a,u)=>n.done(u),s=(n,a)=>n.error(a)){const n=new Promise(a=>(this.jobQueue.push({name:e,onMessage:i,onError:s,onStart:a}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const i=this.jobQueue.shift();if(i){this.onDebug({message:"Starting job",name:i.name,workerThread:e,backlog:this.jobQueue.length});const s=new Kz(i.name,e);e.onMessage=n=>i.onMessage(s,n.type,n.payload),e.onError=n=>i.onError(s,n),i.onStart(s);try{await s.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Au||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}},ec=class ec{constructor(e){K(this,"props");K(this,"workerPools",new Map);this.props={...t4},this.setProps(e),this.workerPools=new Map}static isSupported(){return cw.isSupported()}static getWorkerFarm(e={}){return ec._workerFarm=ec._workerFarm||new ec({}),ec._workerFarm.setProps(e),ec._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const i of this.workerPools.values())i.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:i,source:s,url:n}=e;let a=this.workerPools.get(i);return a||(a=new e4({name:i,source:s,url:n}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(i,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};K(ec,"_workerFarm");let hy=ec;function i4(t,e={}){const i=e[t.id]||{},s=Au?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let n=i.workerUrl;if(!n&&t.id==="compression"&&(n=e.workerUrl),e._workerType==="test"&&(Au?n=`modules/${t.module}/dist/${s}`:n=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!n){let a=t.version;a==="latest"&&(a=qz);const u=a?`@${a}`:"";n=`https://unpkg.com/@loaders.gl/${t.module}${u}/dist/${s}`}return dc(n),n}function s4(t,e=Zz){dc(t,"no worker provided");const i=t.version;return!(!e||!i)}function n4(t,e){return!hy.isSupported()||!Au&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function r4(t,e,i,s,n){const a=t.id,u=i4(t,i),_=hy.getWorkerFarm(i).getWorkerPool({name:a,url:u});i=JSON.parse(JSON.stringify(i)),s=JSON.parse(JSON.stringify(s||{}));const w=await _.startJob("process-on-worker",o4.bind(null,n));return w.postMessage("process",{input:e,options:i,context:s}),await(await w.result).result}async function o4(t,e,i,s){switch(i){case"done":e.done(s);break;case"error":e.error(new Error(s.error));break;case"process":const{id:n,input:a,options:u}=s;try{const c=await t(a,u);e.postMessage("done",{id:n,result:c})}catch(c){const _=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:n,error:_})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function a4(t,e,i){if(i=i||t.byteLength,t.byteLengtha instanceof ArrayBuffer?new Uint8Array(a):a),i=e.reduce((a,u)=>a+u.byteLength,0),s=new Uint8Array(i);let n=0;for(const a of e)s.set(a,n),n+=a.byteLength;return s.buffer}async function u4(t){const e=[];for await(const i of t)e.push(i);return l4(...e)}function S2(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class E2{constructor(e,i){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=i,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=S2(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(S2()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class x0{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,i="count"){return this._getOrCreate({name:e,type:i})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const i of Object.values(this.stats))e(i)}getTable(){const e={};return this.forEach(i=>{e[i.name]={time:i.time||0,count:i.count||0,average:i.getAverageTime()||0,hz:i.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(i=>this._getOrCreate(i))}_getOrCreate(e){const{name:i,type:s}=e;let n=this.stats[i];return n||(e instanceof E2?n=e:n=new E2(i,s),this.stats[i]=n),n}}let h4="";const A2={};function f4(t){for(const e in A2)if(t.startsWith(e)){const i=A2[e];t=t.replace(e,i)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${h4}${t}`),t}function d4(t){return t&&typeof t=="object"&&t.isBuffer}function qM(t){if(d4(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function XM(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function p4(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const g4=t=>typeof t=="boolean",Zp=t=>typeof t=="function",zg=t=>t!==null&&typeof t=="object",I2=t=>zg(t)&&t.constructor==={}.constructor,m4=t=>!!t&&typeof t[Symbol.iterator]=="function",_4=t=>t&&typeof t[Symbol.asyncIterator]=="function",Vu=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,ju=t=>typeof Blob<"u"&&t instanceof Blob,y4=t=>t&&typeof t=="object"&&t.isBuffer,b4=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||zg(t)&&Zp(t.tee)&&Zp(t.cancel)&&Zp(t.getReader),v4=t=>zg(t)&&Zp(t.read)&&Zp(t.pipe)&&g4(t.readable),ZM=t=>b4(t)||v4(t);class x4 extends Error{constructor(i,s){super(i);K(this,"reason");K(this,"url");K(this,"response");this.reason=s.reason,this.url=s.url,this.response=s.response}}const w4=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,T4=/^([-\w.]+\/[-\w.+]+)/;function C2(t,e){return t.toLowerCase()===e.toLowerCase()}function S4(t){const e=T4.exec(t);return e?e[1]:t}function P2(t){const e=w4.exec(t);return e?e[1]:""}const YM=/\?.*/;function E4(t){const e=t.match(YM);return e&&e[0]}function D1(t){return t.replace(YM,"")}function A4(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function w0(t){return Vu(t)?t.url:ju(t)?t.name||"":typeof t=="string"?t:""}function F1(t){if(Vu(t)){const e=t,i=e.headers.get("content-type")||"",s=D1(e.url);return S4(i)||P2(s)}return ju(t)?t.type||"":typeof t=="string"?P2(t):""}function I4(t){return Vu(t)?t.headers["content-length"]||-1:ju(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function KM(t){if(Vu(t))return t;const e={},i=I4(t);i>=0&&(e["content-length"]=String(i));const s=w0(t),n=F1(t);n&&(e["content-type"]=n);const a=await M4(t);a&&(e["x-first-bytes"]=a),typeof t=="string"&&(t=new TextEncoder().encode(t));const u=new Response(t,{headers:e});return Object.defineProperty(u,"url",{value:s}),u}async function C4(t){if(!t.ok)throw await P4(t)}async function P4(t){const e=A4(t.url);let i=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;i=i.length>100?`${i.slice(0,100)}...`:i;const s={reason:t.statusText,url:t.url,response:t};try{const n=t.headers.get("Content-Type");s.reason=!t.bodyUsed&&(n!=null&&n.includes("application/json"))?await t.json():await t.text()}catch{}return new x4(i,s)}async function M4(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const i=t.slice(0,5);return await new Promise(s=>{const n=new FileReader;n.onload=a=>{var u;return s((u=a==null?void 0:a.target)==null?void 0:u.result)},n.readAsDataURL(i)})}if(t instanceof ArrayBuffer){const i=t.slice(0,5);return`data:base64,${R4(i)}`}return null}function R4(t){let e="";const i=new Uint8Array(t);for(let s=0;s{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class N4{constructor(){K(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const JM={fetch:null,mimeType:void 0,nothrow:!1,log:new N4,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:k1,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},B4={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function GM(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function QM(){const t=GM();return t.globalOptions=t.globalOptions||{...JM},t.globalOptions}function L4(t,e,i,s){return i=i||[],i=Array.isArray(i)?i:[i],z4(t,i),V4(e,t,s)}function z4(t,e){k2(t,null,JM,B4,e);for(const i of e){const s=t&&t[i.id]||{},n=i.options&&i.options[i.id]||{},a=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};k2(s,i.id,n,a,e)}}function k2(t,e,i,s,n){const a=e||"Top level",u=e?`${e}.`:"";for(const c in t){const _=!e&&zg(t[c]),w=c==="baseUri"&&!e,S=c==="workerUrl"&&e;if(!(c in i)&&!w&&!S){if(c in s)R2.warn(`${a} loader option '${u}${c}' no longer supported, use '${s[c]}'`)();else if(!_){const A=U4(c,n);R2.warn(`${a} loader option '${u}${c}' not recognized. ${A}`)()}}}}function U4(t,e){const i=t.toLowerCase();let s="";for(const n of e)for(const a in n.options){if(t===a)return`Did you mean '${n.id}.${a}'?`;const u=a.toLowerCase();(i.startsWith(u)||u.startsWith(i))&&(s=s||`Did you mean '${n.id}.${a}'?`)}return s}function V4(t,e,i){const n={...t.options||{}};return j4(n,i),n.log===null&&(n.log=new F4),O2(n,QM()),O2(n,e),n}function O2(t,e){for(const i in e)if(i in e){const s=e[i];I2(s)&&I2(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}function j4(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function N1(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function B1(t){cy(t,"null loader"),cy(N1(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const eR=()=>{const t=GM();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function $4(t){const e=eR();t=Array.isArray(t)?t:[t];for(const i of t){const s=B1(i);e.find(n=>s===n)||e.unshift(s)}}function H4(){return eR()}const W4=/\.([^.]+)$/;async function q4(t,e=[],i,s){if(!tR(t))return null;let n=D2(t,e,{...i,nothrow:!0},s);if(n)return n;if(ju(t)&&(t=await t.slice(0,10).arrayBuffer(),n=D2(t,e,i,s)),!n&&!(i!=null&&i.nothrow))throw new Error(iR(t));return n}function D2(t,e=[],i,s){if(!tR(t))return null;if(e&&!Array.isArray(e))return B1(e);let n=[];e&&(n=n.concat(e)),i!=null&&i.ignoreRegisteredLoaders||n.push(...H4()),Z4(n);const a=X4(t,n,i,s);if(!a&&!(i!=null&&i.nothrow))throw new Error(iR(t));return a}function X4(t,e,i,s){const n=w0(t),a=F1(t),u=D1(n)||(s==null?void 0:s.url);let c=null,_="";return i!=null&&i.mimeType&&(c=ox(e,i==null?void 0:i.mimeType),_=`match forced by supplied MIME type ${i==null?void 0:i.mimeType}`),c=c||Y4(e,u),_=_||(c?`matched url ${u}`:""),c=c||ox(e,a),_=_||(c?`matched MIME type ${a}`:""),c=c||J4(e,t),_=_||(c?`matched initial data ${sR(t)}`:""),i!=null&&i.fallbackMimeType&&(c=c||ox(e,i==null?void 0:i.fallbackMimeType),_=_||(c?`matched fallback MIME type ${a}`:"")),_&&Hz.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${_}.`),c}function tR(t){return!(t instanceof Response&&t.status===204)}function iR(t){const e=w0(t),i=F1(t);let s="No valid loader found (";s+=e?`${XM(e)}, `:"no url provided, ",s+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const n=t?sR(t):"";return s+=n?` first bytes: "${n}"`:"first bytes: not available",s+=")",s}function Z4(t){for(const e of t)B1(e)}function Y4(t,e){const i=e&&W4.exec(e),s=i&&i[1];return s?K4(t,s):null}function K4(t,e){e=e.toLowerCase();for(const i of t)for(const s of i.extensions)if(s.toLowerCase()===e)return i;return null}function ox(t,e){var i;for(const s of t)if((i=s.mimeTypes)!=null&&i.some(n=>C2(e,n))||C2(e,`application/x.${s.id}`))return s;return null}function J4(t,e){if(!e)return null;for(const i of t)if(typeof e=="string"){if(G4(e,i))return i}else if(ArrayBuffer.isView(e)){if(F2(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer&&F2(e,0,i))return i;return null}function G4(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(s=>t.startsWith(s))}function F2(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(n=>Q4(t,e,i,n))}function Q4(t,e,i,s){if(s instanceof ArrayBuffer)return a4(s,t,s.byteLength);switch(typeof s){case"function":return s(t);case"string":const n=uw(t,e,s.length);return s===n;default:return!1}}function sR(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?uw(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?uw(t,0,e):""}function uw(t,e,i){if(t.byteLengthM2(n,s.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:M2}function h6(t,e,i){if(i)return i;const s={fetch:rR(e,t),...t};if(s.url){const n=D1(s.url);s.baseUrl=n,s.queryString=E4(s.url),s.filename=XM(n),s.baseUrl=p4(n)}return Array.isArray(s.loaders)||(s.loaders=null),s}function f6(t,e){if(t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const s=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...s]:s}return i&&i.length?i:void 0}async function fy(t,e,i,s){e&&!Array.isArray(e)&&!N1(e)&&(s=void 0,i=e,e=void 0),t=await t,i=i||{};const n=w0(t),u=f6(e,s),c=await q4(t,u,i);return c?(i=L4(i,c,u,n),s=h6({url:n,_parse:fy,loaders:u},i,s||null),await d6(c,t,i,s)):null}async function d6(t,e,i,s){if(s4(t),i=Wz(t.options,i),Vu(e)){const a=e,{ok:u,redirected:c,status:_,statusText:w,type:S,url:A}=a,P=Object.fromEntries(a.headers.entries());s.response={headers:P,ok:u,redirected:c,status:_,statusText:w,type:S,url:A}}e=await u6(e,t,i);const n=t;if(n.parseTextSync&&typeof e=="string")return n.parseTextSync(e,i,s);if(n4(t,i))return await r4(t,e,i,s,fy);if(n.parseText&&typeof e=="string")return await n.parseText(e,i,s);if(n.parse)return await n.parse(e,i,s);throw dc(!n.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}async function hw(t,e,i,s){let n,a;!Array.isArray(e)&&!N1(e)?(n=[],a=e):(n=e,a=i);const u=rR(a);let c=t;return typeof t=="string"&&(c=await u(t)),ju(t)&&(c=await u(t)),Array.isArray(n)?await fy(c,n,a):await fy(c,n,a)}const p6="4.3.1";var xP;const g6=(xP=globalThis.loaders)==null?void 0:xP.parseImageNode,fw=typeof Image<"u",dw=typeof ImageBitmap<"u",m6=!!g6,pw=k1?!0:m6;function _6(t){switch(t){case"auto":return dw||fw||pw;case"imagebitmap":return dw;case"image":return fw;case"data":return pw;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function y6(){if(dw)return"imagebitmap";if(fw)return"image";if(pw)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function b6(t){const e=x6(t);if(!e)throw new Error("Not an image");return e}function v6(t){switch(b6(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function x6(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const w6=/^data:image\/svg\+xml/,T6=/\.svg((\?|#).*)?$/;function L1(t){return t&&(w6.test(t)||T6.test(t))}function S6(t,e){if(L1(e)){let s=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(s=unescape(encodeURIComponent(s)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(s)}`}return oR(t,e)}function oR(t,e){if(L1(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function aR(t,e,i){const s=S6(t,i),n=self.URL||self.webkitURL,a=typeof s!="string"&&n.createObjectURL(s);try{return await E6(a||s,e)}finally{a&&n.revokeObjectURL(a)}}async function E6(t,e){const i=new Image;return i.src=t,e.image&&e.image.decode&&i.decode?(await i.decode(),i):await new Promise((s,n)=>{try{i.onload=()=>s(i),i.onerror=a=>{const u=a instanceof Error?a.message:"error";n(new Error(u))}}catch(a){n(a)}})}const A6={};let B2=!0;async function I6(t,e,i){let s;L1(i)?s=await aR(t,e,i):s=oR(t,i);const n=e&&e.imagebitmap;return await C6(s,n)}async function C6(t,e=null){if((P6(e)||!B2)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),B2=!1}return await createImageBitmap(t)}function P6(t){for(const e in t||A6)return!1;return!0}function M6(t){return!D6(t,"ftyp",4)||!(t[8]&96)?null:R6(t)}function R6(t){switch(k6(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function k6(t,e,i){return String.fromCharCode(...t.slice(e,i))}function O6(t){return[...t].map(e=>e.charCodeAt(0))}function D6(t,e,i=0){const s=O6(e);for(let n=0;n=24&&e.getUint32(0,oa)===2303741511?{mimeType:"image/png",width:e.getUint32(16,oa),height:e.getUint32(20,oa)}:null}function B6(t){const e=Ug(t);return e.byteLength>=10&&e.getUint32(0,oa)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Yp),height:e.getUint16(8,Yp)}:null}function L6(t){const e=Ug(t);return e.byteLength>=14&&e.getUint16(0,oa)===16973&&e.getUint32(2,Yp)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Yp),height:e.getUint32(22,Yp)}:null}function z6(t){const e=Ug(t);if(!(e.byteLength>=3&&e.getUint16(0,oa)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:s,sofMarkers:n}=U6();let a=2;for(;a+9!!lR(new DataView(t))],options:q6},qi=new Lg({id:"deck"});let gw={};function Z6(t){gw=t}function nr(t,e,i,s){qi.level>0&&gw[t]&&gw[t].call(null,e,i,s)}function Y6(t){const e=t[0],i=t[t.length-1];return e==="{"&&i==="}"||e==="["&&i==="]"}const K6={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:Y6,parseTextSync:JSON.parse};function J6(){const t="9.0.34",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(qi.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:qi,_registerLoggers:Z6},$4([K6,[X6,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const G6=J6();function yu(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const ax={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Q6(t){const e={};for(const[i,s]of Object.entries(t))e[i]=tU(s);return e}function eU(t,e,i){const s={};for(const[n,a]of Object.entries(e))t&&n in t&&!a.private?(a.validate&&yu(a.validate(t[n],a),`${i}: invalid ${n}`),s[n]=t[n]):s[n]=a.value;return s}function tU(t){let e=L2(t);if(e!=="object")return{value:t,...ax[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...ax[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=L2(t.value),{...t,...ax[e],type:e}):{type:"object",value:null};throw new Error("props")}function L2(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const iU=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif -`,G6=`#ifdef MODULE_MATERIAL +`,sU=`#ifdef MODULE_MATERIAL gl_FragColor = material_filterColor(gl_FragColor); #endif #ifdef MODULE_LIGHTING @@ -38,14 +38,14 @@ gl_FragColor = picking_filterPickingColor(gl_FragColor); #ifdef MODULE_LOGDEPTH logdepth_setFragDepth(); #endif -`,Q6={vertex:J6,fragment:G6},L2=/void\s+main\s*\([^)]*\)\s*\{\n?/,z2=/}\n?[^{}]*$/,ex=[],B_="__LUMA_INJECT_DECLARATIONS__";function eU(t){const e={vertex:{},fragment:{}};for(const i in t){let s=t[i];const n=tU(i);typeof s=="string"&&(s={order:0,injection:s}),e[n][i]=s}return e}function tU(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function ay(t,e,i,s=!1){const n=e==="vertex";for(const a in i){const u=i[a];u.sort((_,w)=>_.order-w.order),ex.length=u.length;for(let _=0,w=u.length;__.order-w.order),lx.length=u.length;for(let _=0,w=u.length;__+c));break;case"vs:#main-end":n&&(t=t.replace(z2,_=>c+_));break;case"fs:#decl":n||(t=t.replace(B_,c));break;case"fs:#main-start":n||(t=t.replace(L2,_=>_+c));break;case"fs:#main-end":n||(t=t.replace(z2,_=>c+_));break;default:t=t.replace(a,_=>_+c)}}return t=t.replace(B_,""),s&&(t=t.replace(/\}\s*$/,a=>a+Q6[e])),t}let iU=1;class cu{constructor(e){J(this,"name");J(this,"vs");J(this,"fs");J(this,"getModuleUniforms");J(this,"dependencies");J(this,"deprecations");J(this,"defines");J(this,"injections");J(this,"uniforms",{});J(this,"uniformTypes",{});const{name:i,vs:s,fs:n,dependencies:a=[],uniformTypes:u={},uniformPropTypes:c={},getUniforms:_,deprecations:w=[],defines:S={},inject:C={}}=e;lu(typeof i=="string"),this.name=i,this.vs=s,this.fs=n,this.getModuleUniforms=_,this.dependencies=cu.instantiateModules(a),this.deprecations=this._parseDeprecationDefinitions(w),this.defines=S,this.injections=eU(C),this.uniformTypes=u,c&&(this.uniforms=Z6(c))}static instantiateModules(e){return e.map(i=>{if(i instanceof cu)return i;lu(typeof i!="string",`Shader module use by name is deprecated. Import shader module '${JSON.stringify(i)}' and use it directly.`),i.name||(console.warn("shader module has no name"),i.name=`shader-module-${iU++}`);const s=new cu(i);return s.dependencies=cu.instantiateModules(i.dependencies||[]),s})}getModuleSource(e){let i;switch(e){case"vertex":i=this.vs||"";break;case"fragment":i=this.fs||"";break;default:lu(!1)}const s=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return`// ----- MODULE ${this.name} --------------- +`;switch(a){case"vs:#decl":n&&(t=t.replace($_,c));break;case"vs:#main-start":n&&(t=t.replace(z2,_=>_+c));break;case"vs:#main-end":n&&(t=t.replace(U2,_=>c+_));break;case"fs:#decl":n||(t=t.replace($_,c));break;case"fs:#main-start":n||(t=t.replace(z2,_=>_+c));break;case"fs:#main-end":n||(t=t.replace(U2,_=>c+_));break;default:t=t.replace(a,_=>_+c)}}return t=t.replace($_,""),s&&(t=t.replace(/\}\s*$/,a=>a+nU[e])),t}let aU=1;class bu{constructor(e){K(this,"name");K(this,"vs");K(this,"fs");K(this,"getModuleUniforms");K(this,"dependencies");K(this,"deprecations");K(this,"defines");K(this,"injections");K(this,"uniforms",{});K(this,"uniformTypes",{});const{name:i,vs:s,fs:n,dependencies:a=[],uniformTypes:u={},uniformPropTypes:c={},getUniforms:_,deprecations:w=[],defines:S={},inject:A={}}=e;yu(typeof i=="string"),this.name=i,this.vs=s,this.fs=n,this.getModuleUniforms=_,this.dependencies=bu.instantiateModules(a),this.deprecations=this._parseDeprecationDefinitions(w),this.defines=S,this.injections=rU(A),this.uniformTypes=u,c&&(this.uniforms=Q6(c))}static instantiateModules(e){return e.map(i=>{if(i instanceof bu)return i;yu(typeof i!="string",`Shader module use by name is deprecated. Import shader module '${JSON.stringify(i)}' and use it directly.`),i.name||(console.warn("shader module has no name"),i.name=`shader-module-${aU++}`);const s=new bu(i);return s.dependencies=bu.instantiateModules(i.dependencies||[]),s})}getModuleSource(e){let i;switch(e){case"vertex":i=this.vs||"";break;case"fragment":i=this.fs||"";break;default:yu(!1)}const s=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return`// ----- MODULE ${this.name} --------------- #define MODULE_${s} ${i} -`}getUniforms(e,i){return this.getModuleUniforms?this.getModuleUniforms(e,i):K6(e,this.uniforms,this.name)}getDefines(){return this.defines}checkDeprecations(e,i){this.deprecations.forEach(s=>{var n;(n=s.regex)!=null&&n.test(e)&&(s.deprecated?i.deprecated(s.old,s.new)():i.removed(s.old,s.new)())})}_parseDeprecationDefinitions(e){return e.forEach(i=>{switch(i.type){case"function":i.regex=new RegExp(`\\b${i.old}\\(`);break;default:i.regex=new RegExp(`${i.type} ${i.old};`)}}),e}_defaultGetUniforms(e={}){const i={},s=this.uniforms;for(const n in s){const a=s[n];n in e&&!a.private?(a.validate&&lu(a.validate(e[n],a),`${this.name}: invalid ${n}`),i[n]=e[n]):i[n]=a.value}return i}}function U2(t){if(t.source&&t.platformInfo.type==="webgpu")return{...t,vs:void 0,fs:void 0};if(!t.vs)throw new Error("no vertex shader");const e=V2(t.platformInfo,t.vs);let i;return t.fs&&(i=V2(t.platformInfo,t.fs)),{...t,vs:e,fs:i}}function V2(t,e){if(typeof e=="string")return e;switch(t.type){case"webgpu":if(e!=null&&e.wgsl)return e.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(e!=null&&e.glsl)return e.glsl;throw new Error("WebGL does not support WGSL shaders")}}function A0(t){const e=cu.instantiateModules(t);return sU(e)}function sU(t){const e={},i={};return oM({modules:t,level:0,moduleMap:e,moduleDepth:i}),Object.keys(i).sort((s,n)=>i[n]-i[s]).map(s=>e[s])}function oM(t){const{modules:e,level:i,moduleMap:s,moduleDepth:n}=t;if(i>=5)throw new Error("Possible loop in shader dependency graph");for(const a of e)s[a.name]=a,(n[a.name]===void 0||n[a.name]{var n;(n=s.regex)!=null&&n.test(e)&&(s.deprecated?i.deprecated(s.old,s.new)():i.removed(s.old,s.new)())})}_parseDeprecationDefinitions(e){return e.forEach(i=>{switch(i.type){case"function":i.regex=new RegExp(`\\b${i.old}\\(`);break;default:i.regex=new RegExp(`${i.type} ${i.old};`)}}),e}_defaultGetUniforms(e={}){const i={},s=this.uniforms;for(const n in s){const a=s[n];n in e&&!a.private?(a.validate&&yu(a.validate(e[n],a),`${this.name}: invalid ${n}`),i[n]=e[n]):i[n]=a.value}return i}}function V2(t){if(t.source&&t.platformInfo.type==="webgpu")return{...t,vs:void 0,fs:void 0};if(!t.vs)throw new Error("no vertex shader");const e=j2(t.platformInfo,t.vs);let i;return t.fs&&(i=j2(t.platformInfo,t.fs)),{...t,vs:e,fs:i}}function j2(t,e){if(typeof e=="string")return e;switch(t.type){case"webgpu":if(e!=null&&e.wgsl)return e.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(e!=null&&e.glsl)return e.glsl;throw new Error("WebGL does not support WGSL shaders")}}function T0(t){const e=bu.instantiateModules(t);return lU(e)}function lU(t){const e={},i={};return cR({modules:t,level:0,moduleMap:e,moduleDepth:i}),Object.keys(i).sort((s,n)=>i[n]-i[s]).map(s=>e[s])}function cR(t){const{modules:e,level:i,moduleMap:s,moduleDepth:n}=t;if(i>=5)throw new Error("Possible loop in shader dependency graph");for(const a of e)s[a.name]=a,(n[a.name]===void 0||n[a.name]u.order-c.order);for(const u of a)i+=` ${u.injection} `}n.footer&&(i+=` ${n.footer}`),i+=`} -`}return i}function cM(t){const e={vertex:{},fragment:{}};for(const i of t){let s,n;typeof i!="string"?(s=i,n=s.hook):(s={},n=i),n=n.trim();const[a,u]=n.split(":"),c=n.replace(/\(.+/,""),_=Object.assign(s,{signature:u});switch(a){case"vs":e.vertex[c]=_;break;case"fs":e.fragment[c]=_;break;default:throw new Error(a)}}return e}function lU(t,e){return{name:cU(t,e),language:"glsl",version:uU(t)}}function cU(t,e="unnamed"){const s=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return s?s[1]:e}function uU(t){let e=100;const i=t.match(/[^\s]+/g);if(i&&i.length>=2&&i[0]==="#version"){const s=parseInt(i[1],10);Number.isFinite(s)&&(e=s)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const uM=` +`}return i}function fR(t){const e={vertex:{},fragment:{}};for(const i of t){let s,n;typeof i!="string"?(s=i,n=s.hook):(s={},n=i),n=n.trim();const[a,u]=n.split(":"),c=n.replace(/\(.+/,""),_=Object.assign(s,{signature:u});switch(a){case"vs":e.vertex[c]=_;break;case"fs":e.fragment[c]=_;break;default:throw new Error(a)}}return e}function dU(t,e){return{name:pU(t,e),language:"glsl",version:gU(t)}}function pU(t,e="unnamed"){const s=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return s?s[1]:e}function gU(t){let e=100;const i=t.match(/[^\s]+/g);if(i&&i.length>=2&&i[0]==="#version"){const s=parseInt(i[1],10);Number.isFinite(s)&&(e=s)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const dR=` -${B_} -`,hU=`precision highp float; -`;function dU(t){const e=A0(t.modules||[]);return{source:lw(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:z1(e)}}function fU(t){const e=A0(t.modules||[]);return{vs:lw(t.platformInfo,{...t,source:t.vs,stage:"vertex",modules:e}),fs:lw(t.platformInfo,{...t,source:t.fs,stage:"fragment",modules:e}),getUniforms:z1(e)}}function pU(t){const{vs:e,fs:i}=t,s=A0(t.modules||[]);return{vs:$2(t.platformInfo,{...t,source:e,stage:"vertex",modules:s}),fs:$2(t.platformInfo,{...t,source:i,stage:"fragment",modules:s}),getUniforms:z1(s)}}function lw(t,e){const{source:i,stage:s,modules:n,hookFunctions:a=[],inject:u={},log:c}=e;lu(typeof i=="string","shader source must be a string");const _=i;let w="";const S=cM(a),C={},P={},D={};for(const L in u){const H=typeof u[L]=="string"?{injection:u[L],order:0}:u[L],te=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(te){const G=te[2],se=te[3];G?se==="decl"?P[L]=[H]:D[L]=[H]:C[L]=[H]}else D[L]=[H]}const j=t.type!=="webgpu"?n:[];for(const L of j){c&&L.checkDeprecations(_,c);const H=L.getModuleSource(s,"wgsl");w+=H;const te=L.injections[s];for(const G in te){const se=/^(v|f)s:#([\w-]+)$/.exec(G);if(se){const Se=se[2]==="decl"?P:D;Se[G]=Se[G]||[],Se[G].push(te[G])}else C[G]=C[G]||[],C[G].push(te[G])}}return w+=uM,w=ay(w,s,P),w+=lM(S[s],C),w+=_,w=ay(w,s,D),w}function $2(t,e){const{id:i,source:s,stage:n,language:a="glsl",modules:u,defines:c={},hookFunctions:_=[],inject:w={},prologue:S=!0,log:C}=e;lu(typeof s=="string","shader source must be a string");const P=a==="glsl"?lU(s).version:-1,D=t.shaderLanguageVersion,j=P===100?"#version 100":"#version 300 es",H=s.split(` +${$_} +`,mU=`precision highp float; +`;function _U(t){const e=T0(t.modules||[]);return{source:_w(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:z1(e)}}function yU(t){const e=T0(t.modules||[]);return{vs:_w(t.platformInfo,{...t,source:t.vs,stage:"vertex",modules:e}),fs:_w(t.platformInfo,{...t,source:t.fs,stage:"fragment",modules:e}),getUniforms:z1(e)}}function bU(t){const{vs:e,fs:i}=t,s=T0(t.modules||[]);return{vs:H2(t.platformInfo,{...t,source:e,stage:"vertex",modules:s}),fs:H2(t.platformInfo,{...t,source:i,stage:"fragment",modules:s}),getUniforms:z1(s)}}function _w(t,e){const{source:i,stage:s,modules:n,hookFunctions:a=[],inject:u={},log:c}=e;yu(typeof i=="string","shader source must be a string");const _=i;let w="";const S=fR(a),A={},P={},D={};for(const L in u){const W=typeof u[L]=="string"?{injection:u[L],order:0}:u[L],ee=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(ee){const G=ee[2],se=ee[3];G?se==="decl"?P[L]=[W]:D[L]=[W]:A[L]=[W]}else D[L]=[W]}const U=t.type!=="webgpu"?n:[];for(const L of U){c&&L.checkDeprecations(_,c);const W=L.getModuleSource(s,"wgsl");w+=W;const ee=L.injections[s];for(const G in ee){const se=/^(v|f)s:#([\w-]+)$/.exec(G);if(se){const Se=se[2]==="decl"?P:D;Se[G]=Se[G]||[],Se[G].push(ee[G])}else A[G]=A[G]||[],A[G].push(ee[G])}}return w+=dR,w=dy(w,s,P),w+=hR(S[s],A),w+=_,w=dy(w,s,D),w}function H2(t,e){const{id:i,source:s,stage:n,language:a="glsl",modules:u,defines:c={},hookFunctions:_=[],inject:w={},prologue:S=!0,log:A}=e;yu(typeof s=="string","shader source must be a string");const P=a==="glsl"?dU(s).version:-1,D=t.shaderLanguageVersion,U=P===100?"#version 100":"#version 300 es",W=s.split(` `).slice(1).join(` -`),te={};u.forEach(De=>{Object.assign(te,De.getDefines())}),Object.assign(te,c);let G="";switch(a){case"wgsl":break;case"glsl":G=S?`${j} +`),ee={};u.forEach(Fe=>{Object.assign(ee,Fe.getDefines())}),Object.assign(ee,c);let G="";switch(a){case"wgsl":break;case"glsl":G=S?`${U} // ----- PROLOGUE ------------------------- -${mU({id:i,source:s,stage:n})} +${vU({id:i,source:s,stage:n})} ${`#define SHADER_TYPE_${n.toUpperCase()}`} -${nU(t)} -${n==="fragment"?hU:""} +${cU(t)} +${n==="fragment"?mU:""} // ----- APPLICATION DEFINES ------------------------- -${gU(te)} +${xU(ee)} -`:`${j} -`;break}const se=cM(_),ve={},Se={},ge={};for(const De in w){const Fe=typeof w[De]=="string"?{injection:w[De],order:0}:w[De],Be=/^(v|f)s:(#)?([\w-]+)$/.exec(De);if(Be){const Qe=Be[2],He=Be[3];Qe?He==="decl"?Se[De]=[Fe]:ge[De]=[Fe]:ve[De]=[Fe]}else ge[De]=[Fe]}for(const De of u){C&&De.checkDeprecations(H,C);const Fe=De.getModuleSource(n);G+=Fe;const Be=De.injections[n];for(const Qe in Be){const He=/^(v|f)s:#([\w-]+)$/.exec(Qe);if(He){const dt=He[2]==="decl"?Se:ge;dt[Qe]=dt[Qe]||[],dt[Qe].push(Be[Qe])}else ve[Qe]=ve[Qe]||[],ve[Qe].push(Be[Qe])}}return G+="// ----- MAIN SHADER SOURCE -------------------------",G+=uM,G=ay(G,n,Se),G+=lM(se[n],ve),G+=H,G=ay(G,n,ge),a==="glsl"&&P!==D&&(G=rU(G,n)),G.trim()}function z1(t){return function(i){const s={};for(const n of t){const a=n.getUniforms(i,s);Object.assign(s,a)}return s}}function mU(t){const{id:e,source:i,stage:s}=t;return e&&i.indexOf("SHADER_NAME")===-1?` +`:`${U} +`;break}const se=fR(_),fe={},Se={},Te={};for(const Fe in w){const Ne=typeof w[Fe]=="string"?{injection:w[Fe],order:0}:w[Fe],Oe=/^(v|f)s:(#)?([\w-]+)$/.exec(Fe);if(Oe){const Je=Oe[2],Xe=Oe[3];Je?Xe==="decl"?Se[Fe]=[Ne]:Te[Fe]=[Ne]:fe[Fe]=[Ne]}else Te[Fe]=[Ne]}for(const Fe of u){A&&Fe.checkDeprecations(W,A);const Ne=Fe.getModuleSource(n);G+=Ne;const Oe=Fe.injections[n];for(const Je in Oe){const Xe=/^(v|f)s:#([\w-]+)$/.exec(Je);if(Xe){const ht=Xe[2]==="decl"?Se:Te;ht[Je]=ht[Je]||[],ht[Je].push(Oe[Je])}else fe[Je]=fe[Je]||[],fe[Je].push(Oe[Je])}}return G+="// ----- MAIN SHADER SOURCE -------------------------",G+=dR,G=dy(G,n,Se),G+=hR(se[n],fe),G+=W,G=dy(G,n,Te),a==="glsl"&&P!==D&&(G=uU(G,n)),G.trim()}function z1(t){return function(i){const s={};for(const n of t){const a=n.getUniforms(i,s);Object.assign(s,a)}return s}}function vU(t){const{id:e,source:i,stage:s}=t;return e&&i.indexOf("SHADER_NAME")===-1?` #define SHADER_NAME ${e}_${s} -`:""}function gU(t={}){let e="";for(const i in t){const s=t[i];(s||Number.isFinite(s))&&(e+=`#define ${i.toUpperCase()} ${t[i]} -`)}return e}const ou=class ou{constructor(){J(this,"_hookFunctions",[]);J(this,"_defaultModules",[])}static getDefaultShaderAssembler(){return ou.defaultShaderAssembler=ou.defaultShaderAssembler||new ou,ou.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(i=>i.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const i=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(s=>s.name!==i)}addShaderHook(e,i){i&&(e=Object.assign(i,{hook:e})),this._hookFunctions.push(e)}assembleShader(e){const i=this._getModuleList(e.modules),s=this._hookFunctions,n=U2(e);return{...dU({platformInfo:e.platformInfo,...n,modules:i,hookFunctions:s}),modules:i}}assembleShaderPair(e){const i=U2(e),s=this._getModuleList(e.modules),n=this._hookFunctions,{platformInfo:a}=e;return{...e.platformInfo.shaderLanguage==="wgsl"?fU({platformInfo:a,...i,modules:s,hookFunctions:n}):pU({platformInfo:a,...i,modules:s,hookFunctions:n}),modules:s}}_getModuleList(e=[]){const i=new Array(this._defaultModules.length+e.length),s={};let n=0;for(let a=0,u=this._defaultModules.length;ai.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const i=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(s=>s.name!==i)}addShaderHook(e,i){i&&(e=Object.assign(i,{hook:e})),this._hookFunctions.push(e)}assembleShader(e){const i=this._getModuleList(e.modules),s=this._hookFunctions,n=V2(e);return{..._U({platformInfo:e.platformInfo,...n,modules:i,hookFunctions:s}),modules:i}}assembleShaderPair(e){const i=V2(e),s=this._getModuleList(e.modules),n=this._hookFunctions,{platformInfo:a}=e;return{...e.platformInfo.shaderLanguage==="wgsl"?yU({platformInfo:a,...i,modules:s,hookFunctions:n}):bU({platformInfo:a,...i,modules:s,hookFunctions:n}),modules:s}}_getModuleList(e=[]){const i=new Array(this._defaultModules.length+e.length),s={};let n=0;for(let a=0,u=this._defaultModules.length;at.startsWith(e))}function dM(t){const e=RU.exec(t);if(e){const[,i,s,n,a,u]=e;if(i){const c=`${n}${s}`,_=hM(c);return{format:i,components:i.length,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl",..._}}}return OU(t)}const kU={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2uint-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function OU(t){var i;const e=kU[t];if(!e)throw new Error(`Unknown format ${t}`);return{format:e.format||"",components:e.components||((i=e.format)==null?void 0:i.length)||1,byteLength:e.bpp||1,srgb:!1,unsized:!1}}class DU{}class FU{constructor(e=[],i){J(this,"features");J(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=i||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures[e]&&this.features.has(e)}}const Zp=class Zp{constructor(e){J(this,"id");J(this,"props");J(this,"userData",{});J(this,"statsManager",U1);J(this,"_lumaData",{});J(this,"timestamp",0);this.props={...Zp.defaultProps,...e},this.id=this.props.id||ku(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}isTextureFormatCompressed(e){return MU(e)}loseDevice(){return!1}getCanvasContext(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext}createTexture(e){return(e instanceof Promise||typeof e=="string")&&(e={data:e}),this._createTexture(e)}createCommandEncoder(e={}){throw new Error("not implemented")}readPixelsToArrayWebGL(e,i){throw new Error("not implemented")}readPixelsToBufferWebGL(e,i){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,i){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}_getBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const i={...e};return(e.usage||0)&Ns.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?i.indexType="uint32":e.data instanceof Uint16Array?i.indexType="uint16":lt.warn("indices buffer content must be of integer type")()),i}};J(Zp,"defaultProps",{id:null,canvas:null,container:null,manageState:!0,width:800,height:600,requestMaxLimits:!0,debug:!!lt.get("debug"),spector:!!(lt.get("spector")||lt.get("spectorjs")),break:[],initalizeFeatures:!0,disabledFeatures:{"compilation-status-async-webgl":!0},gl:null,onError:e=>lt.error(e.message)}),J(Zp,"VERSION",SU);let _d=Zp;function ns(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const gp=new Map,ed=class ed{static registerDevices(e){for(const i of e)ns(i.type&&i.isSupported&&i.create),gp.set(i.type,i)}static getAvailableDevices(){return Array.from(gp).map(e=>e.type)}static getSupportedDevices(){return Array.from(gp).filter(e=>e.isSupported()).map(e=>e.type)}static setDefaultDeviceProps(e){Object.assign(_d.defaultProps,e)}static async attachDevice(e){const i=H2(e.devices)||gp;if(e.handle instanceof WebGL2RenderingContext){const s=i.get("webgl");if(s)return await s.attach(e.handle)}if(e.handle===null){const s=i.get("unknown");if(s)return await s.attach(null)}throw new Error("Failed to attach device. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static async createDevice(e={}){var s,n;e={...ed.defaultProps,...e},e.gl&&(e.type="webgl");const i=H2(e.devices)||gp;switch(e.type){case"webgpu":let a=i.get("webgpu");if(a)return await a.create(e);break;case"webgl":let u=i.get("webgl");if(u)return await u.create(e);break;case"unknown":const c=i.get("unknown");if(c)return await c.create(e);break;case"best-available":if(a=i.get("webgpu"),(s=a==null?void 0:a.isSupported)!=null&&s.call(a))return await a.create(e);if(u=i.get("webgl"),(n=u==null?void 0:u.isSupported)!=null&&n.call(u))return await u.create(e);break}throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static enforceWebGL2(e=!0){const i=HTMLCanvasElement.prototype;if(!e&&i.originalGetContext){i.getContext=i.originalGetContext,i.originalGetContext=void 0;return}i.originalGetContext=i.getContext,i.getContext=function(s,n){return s==="webgl"||s==="experimental-webgl"?this.originalGetContext("webgl2",n):this.originalGetContext(s,n)}}};J(ed,"defaultProps",{..._d.defaultProps,type:"best-available",devices:void 0}),J(ed,"stats",U1),J(ed,"log",lt);let ld=ed;function H2(t){if(!t||(t==null?void 0:t.length)===0)return null;const e=new Map;for(const i of t)e.set(i.type,i);return e}const NU=pc()&&typeof document<"u",I0=()=>NU&&document.readyState==="complete",BU={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"};class V1{constructor(e){J(this,"id");J(this,"props");J(this,"canvas");J(this,"htmlCanvas");J(this,"offscreenCanvas");J(this,"type");J(this,"width",1);J(this,"height",1);J(this,"resizeObserver");J(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...BU,...e},e=this.props,!pc()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=UU(e.canvas):this.canvas=e.canvas;else{const i=VU(e),s=zU((e==null?void 0:e.container)||null);s.insertBefore(i,s.firstChild),this.canvas=i,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(i=>{for(const s of i)s.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}static get isPageLoaded(){return I0()}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),i=this.canvas;return i.parentElement?[i.clientWidth*e,i.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,i]=this.getPixelSize();return e/i}cssToDeviceRatio(){try{const[e]=this.getDrawingBufferSize(),{clientWidth:i}=this._canvasSizeInfo;return i?e/i:1}catch{return 1}}cssToDevicePixels(e,i=!0){const s=this.cssToDeviceRatio(),[n,a]=this.getDrawingBufferSize();return jU(e,s,n,a,i)}setDevicePixelRatio(e,i={}){if(!this.htmlCanvas)return;let s="width"in i?i.width:this.htmlCanvas.clientWidth,n="height"in i?i.height:this.htmlCanvas.clientHeight;(!s||!n)&&(lt.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,s=this.htmlCanvas.width||1,n=this.htmlCanvas.height||1);const a=this._canvasSizeInfo;if(a.clientWidth!==s||a.clientHeight!==n||a.devicePixelRatio!==e){let u=e;const c=Math.floor(s*u),_=Math.floor(n*u);this.htmlCanvas.width=c,this.htmlCanvas.height=_;const[w,S]=this.getDrawingBufferSize();(w!==c||S!==_)&&(u=Math.min(w/s,S/n),this.htmlCanvas.width=Math.floor(s*u),this.htmlCanvas.height=Math.floor(n*u),lt.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=s,this._canvasSizeInfo.clientHeight=n,this._canvasSizeInfo.devicePixelRatio=e}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var i;((i=this.htmlCanvas)==null?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}}J(V1,"pageLoaded",LU());function LU(){return I0()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}function zU(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e&&!I0())throw new Error(`Accessing '${t}' before page was loaded`);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function UU(t){const e=document.getElementById(t);if(!e&&!I0())throw new Error(`Accessing '${t}' before page was loaded`);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function VU(t){const{width:e,height:i}=t,s=document.createElement("canvas");return s.id="lumagl-auto-created-canvas",s.width=e||1,s.height=i||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(i)?`${i}px`:"100%",s}function jU(t,e,i,s,n){const a=t,u=q2(a[0],e,i);let c=X2(a[1],e,s,n),_=q2(a[0]+1,e,i);const w=_===i-1?_:_-1;_=X2(a[1]+1,e,s,n);let S;return n?(_=_===0?_:_+1,S=c,c=_):S=_===s-1?_:_-1,{x:u,y:c,width:Math.max(w-u+1,1),height:Math.max(S-c+1,1)}}function q2(t,e,i){return Math.min(Math.round(t*e),i-1)}function X2(t,e,i,s){return s?Math.max(0,i-1-Math.round(t*e)):Math.min(Math.round(t*e),i-1)}const Ha=class Ha extends Zi{constructor(i,s,n=Ha.defaultProps){super(i,s,n);J(this,"dimension");J(this,"format");J(this,"width");J(this,"height");J(this,"depth");J(this,"updateTimestamp");this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.updateTimestamp=i.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}};J(Ha,"defaultProps",{...Zi.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0,sampler:{},view:void 0}),J(Ha,"COPY_SRC",1),J(Ha,"COPY_DST",2),J(Ha,"TEXTURE_BINDING",4),J(Ha,"STORAGE_BINDING",8),J(Ha,"RENDER_ATTACHMENT",16);let ao=Ha;const Vy=class Vy extends Zi{get[Symbol.toStringTag](){return"TextureView"}constructor(e,i){super(e,i,Vy.defaultProps)}};J(Vy,"defaultProps",{...Zi.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let uy=Vy;function $U(t,e,i){let s="";const n=e.split(/\r?\n/),a=t.slice().sort((u,c)=>u.lineNum-c.lineNum);switch((i==null?void 0:i.showSourceCode)||"no"){case"all":let u=0;for(let c=1;c<=n.length;c++)for(s+=fM(n[c-1],c,i);a.length>u&&a[u].lineNum===c;){const _=a[u++];s+=Z2(_,n,_.lineNum,{...i,inlineSource:!1})}return s;case"issues":case"no":for(const c of t)s+=Z2(c,n,c.lineNum,{inlineSource:(i==null?void 0:i.showSourceCode)!=="no"});return s}}function Z2(t,e,i,s){if(s!=null&&s.inlineSource){const n=WU(e,i),a=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^ +}`}function EU(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error(`invalid channels: ${t}`)}}function AU(t,e){switch(e){case 1:return`vec4(${t}, 0.0, 0.0, 1.0)`;case 2:return`vec4(${t}, 0.0, 1.0)`;case 3:return`vec4(${t}, 1.0)`;case 4:return t;default:throw new Error(`invalid channels: ${e}`)}}const at=new Lg({id:"luma.gl"});class IU{constructor(){K(this,"stats",new Map)}getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new x0({id:e})),this.stats.get(e)}}const U1=new IU;function CU(){const t="9.0.27",e="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${t}`);return globalThis.luma||(Tc()&&at.log(1,`${t} - ${e}`)(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:at,stats:U1}),t}const PU=CU();function MU(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)?t:null}function fg(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number"?t:null:MU(t)}const cx={};function $u(t="id"){cx[t]=cx[t]||1;const e=cx[t]++;return`${t}-${e}`}function gy(t){let e=!0;for(const i in t){e=!1;break}return e}var Wx;let Xi=(Wx=class{constructor(e,i,s){K(this,"id");K(this,"props");K(this,"userData",{});K(this,"_device");K(this,"destroyed",!1);K(this,"allocatedBytes",0);K(this,"_attachedResources",new Set);if(!e)throw new Error("no device");this._device=e,this.props=RU(i,s);const n=this.props.id!=="undefined"?this.props.id:$u(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}toString(){return`${this[Symbol.toStringTag]||this.constructor.name}(${this.id})`}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(const e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){const e=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];e.get(`${i}s Active`).decrementCount()}trackAllocatedMemory(e,i=this[Symbol.toStringTag]){const s=this._device.statsManager.getStats("Resource Counts");s.get("GPU Memory").addCount(e),s.get(`${i} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){const i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){const e=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${i}s Created`).incrementCount(),e.get(`${i}s Active`).incrementCount()}},K(Wx,"defaultProps",{id:"undefined",handle:void 0,userData:void 0}),Wx);function RU(t,e){const i={...e};for(const s in t)t[s]!==void 0&&(i[s]=t[s]);return i}var Vs;let Os=(Vs=class extends Xi{constructor(i,s){const n={...s};(s.usage||0)&Vs.INDEX&&!s.indexType&&(s.data instanceof Uint32Array?n.indexType="uint32":s.data instanceof Uint16Array&&(n.indexType="uint16"));super(i,n,Vs.defaultProps);K(this,"usage");K(this,"indexType");K(this,"updateTimestamp");K(this,"debugData",new ArrayBuffer(0));this.usage=s.usage||0,this.indexType=n.indexType,this.updateTimestamp=i.incrementTimestamp()}get[Symbol.toStringTag](){return"Buffer"}readSyncWebGL(i,s){throw new Error("not implemented")}_setDebugData(i,s,n){const a=ArrayBuffer.isView(i)?i.buffer:i,u=Math.min(i?i.byteLength:n,Vs.DEBUG_DATA_MAX_LENGTH);i===null?this.debugData=new ArrayBuffer(u):s===0&&n===i.byteLength?this.debugData=a.slice(0,u):this.debugData=a.slice(s,s+u)}},K(Vs,"defaultProps",{...Xi.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),K(Vs,"MAP_READ",1),K(Vs,"MAP_WRITE",2),K(Vs,"COPY_SRC",4),K(Vs,"COPY_DST",8),K(Vs,"INDEX",16),K(Vs,"VERTEX",32),K(Vs,"UNIFORM",64),K(Vs,"STORAGE",128),K(Vs,"INDIRECT",256),K(Vs,"QUERY_RESOLVE",512),K(Vs,"DEBUG_DATA_MAX_LENGTH",32),Vs);function pR(t){const e=W2[t],i=kU(e),s=t.includes("norm"),n=!s&&!t.startsWith("float"),a=t.startsWith("s");return{dataType:W2[t],byteLength:i,integer:n,signed:a,normalized:s}}function kU(t){return OU[t]}const W2={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},OU={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4},DU=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],FU=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function NU(t){return DU.some(e=>t.startsWith(e))}function gR(t){const e=FU.exec(t);if(e){const[,i,s,n,a,u]=e;if(i){const c=`${n}${s}`,_=pR(c);return{format:i,components:i.length,srgb:a==="-srgb",unsized:u==="-unsized",webgl:u==="-webgl",..._}}}return LU(t)}const BU={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2uint-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function LU(t){var i;const e=BU[t];if(!e)throw new Error(`Unknown format ${t}`);return{format:e.format||"",components:e.components||((i=e.format)==null?void 0:i.length)||1,byteLength:e.bpp||1,srgb:!1,unsized:!1}}class zU{}class UU{constructor(e=[],i){K(this,"features");K(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=i||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures[e]&&this.features.has(e)}}const ig=class ig{constructor(e){K(this,"id");K(this,"props");K(this,"userData",{});K(this,"statsManager",U1);K(this,"_lumaData",{});K(this,"timestamp",0);this.props={...ig.defaultProps,...e},this.id=this.props.id||$u(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}isTextureFormatCompressed(e){return NU(e)}loseDevice(){return!1}getCanvasContext(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext}createTexture(e){return(e instanceof Promise||typeof e=="string")&&(e={data:e}),this._createTexture(e)}createCommandEncoder(e={}){throw new Error("not implemented")}readPixelsToArrayWebGL(e,i){throw new Error("not implemented")}readPixelsToBufferWebGL(e,i){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,i){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}_getBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const i={...e};return(e.usage||0)&Os.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?i.indexType="uint32":e.data instanceof Uint16Array?i.indexType="uint16":at.warn("indices buffer content must be of integer type")()),i}};K(ig,"defaultProps",{id:null,canvas:null,container:null,manageState:!0,width:800,height:600,requestMaxLimits:!0,debug:!!at.get("debug"),spector:!!(at.get("spector")||at.get("spectorjs")),break:[],initalizeFeatures:!0,disabledFeatures:{"compilation-status-async-webgl":!0},gl:null,onError:e=>at.error(e.message)}),K(ig,"VERSION",PU);let Nf=ig;function is(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const Ep=new Map,bf=class bf{static registerDevices(e){for(const i of e)is(i.type&&i.isSupported&&i.create),Ep.set(i.type,i)}static getAvailableDevices(){return Array.from(Ep).map(e=>e.type)}static getSupportedDevices(){return Array.from(Ep).filter(e=>e.isSupported()).map(e=>e.type)}static setDefaultDeviceProps(e){Object.assign(Nf.defaultProps,e)}static async attachDevice(e){const i=q2(e.devices)||Ep;if(e.handle instanceof WebGL2RenderingContext){const s=i.get("webgl");if(s)return await s.attach(e.handle)}if(e.handle===null){const s=i.get("unknown");if(s)return await s.attach(null)}throw new Error("Failed to attach device. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static async createDevice(e={}){var a,u;e={...bf.defaultProps,...e},e.gl&&(e.type="webgl");const i=q2(e.devices)||Ep;let s,n;switch(e.type){case"webgpu":if(s=i.get("webgpu"),s)return await s.create(e);break;case"webgl":if(n=i.get("webgl"),n)return await n.create(e);break;case"unknown":const c=i.get("unknown");if(c)return await c.create(e);break;case"best-available":if(s=i.get("webgpu"),(a=s==null?void 0:s.isSupported)!=null&&a.call(s))return await s.create(e);if(n=i.get("webgl"),(u=n==null?void 0:n.isSupported)!=null&&u.call(n))return await n.create(e);break}throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.")}static enforceWebGL2(e=!0){const i=HTMLCanvasElement.prototype;if(!e&&i.originalGetContext){i.getContext=i.originalGetContext,i.originalGetContext=void 0;return}i.originalGetContext=i.getContext,i.getContext=function(s,n){return s==="webgl"||s==="experimental-webgl"?this.originalGetContext("webgl2",n):this.originalGetContext(s,n)}}};K(bf,"defaultProps",{...Nf.defaultProps,type:"best-available",devices:void 0}),K(bf,"stats",U1),K(bf,"log",at);let Cf=bf;function q2(t){if(!t||(t==null?void 0:t.length)===0)return null;const e=new Map;for(const i of t)e.set(i.type,i);return e}const VU=Tc()&&typeof document<"u",S0=()=>VU&&document.readyState==="complete",jU={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"};class V1{constructor(e){K(this,"id");K(this,"props");K(this,"canvas");K(this,"htmlCanvas");K(this,"offscreenCanvas");K(this,"type");K(this,"width",1);K(this,"height",1);K(this,"resizeObserver");K(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...jU,...e},e=this.props,!Tc()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=WU(e.canvas):this.canvas=e.canvas;else{const i=qU(e),s=HU((e==null?void 0:e.container)||null);s.insertBefore(i,s.firstChild),this.canvas=i,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(i=>{for(const s of i)s.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}static get isPageLoaded(){return S0()}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),i=this.canvas;return i.parentElement?[i.clientWidth*e,i.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,i]=this.getPixelSize();return e/i}cssToDeviceRatio(){try{const[e]=this.getDrawingBufferSize(),{clientWidth:i}=this._canvasSizeInfo;return i?e/i:1}catch{return 1}}cssToDevicePixels(e,i=!0){const s=this.cssToDeviceRatio(),[n,a]=this.getDrawingBufferSize();return XU(e,s,n,a,i)}setDevicePixelRatio(e,i={}){if(!this.htmlCanvas)return;let s="width"in i?i.width:this.htmlCanvas.clientWidth,n="height"in i?i.height:this.htmlCanvas.clientHeight;(!s||!n)&&(at.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,s=this.htmlCanvas.width||1,n=this.htmlCanvas.height||1);const a=this._canvasSizeInfo;if(a.clientWidth!==s||a.clientHeight!==n||a.devicePixelRatio!==e){let u=e;const c=Math.floor(s*u),_=Math.floor(n*u);this.htmlCanvas.width=c,this.htmlCanvas.height=_;const[w,S]=this.getDrawingBufferSize();(w!==c||S!==_)&&(u=Math.min(w/s,S/n),this.htmlCanvas.width=Math.floor(s*u),this.htmlCanvas.height=Math.floor(n*u),at.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=s,this._canvasSizeInfo.clientHeight=n,this._canvasSizeInfo.devicePixelRatio=e}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var i;((i=this.htmlCanvas)==null?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}}K(V1,"pageLoaded",$U());function $U(){return S0()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}function HU(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e&&!S0())throw new Error(`Accessing '${t}' before page was loaded`);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function WU(t){const e=document.getElementById(t);if(!e&&!S0())throw new Error(`Accessing '${t}' before page was loaded`);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function qU(t){const{width:e,height:i}=t,s=document.createElement("canvas");return s.id="lumagl-auto-created-canvas",s.width=e||1,s.height=i||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(i)?`${i}px`:"100%",s}function XU(t,e,i,s,n){const a=t,u=X2(a[0],e,i);let c=Z2(a[1],e,s,n),_=X2(a[0]+1,e,i);const w=_===i-1?_:_-1;_=Z2(a[1]+1,e,s,n);let S;return n?(_=_===0?_:_+1,S=c,c=_):S=_===s-1?_:_-1,{x:u,y:c,width:Math.max(w-u+1,1),height:Math.max(S-c+1,1)}}function X2(t,e,i){return Math.min(Math.round(t*e),i-1)}function Z2(t,e,i,s){return s?Math.max(0,i-1-Math.round(t*e)):Math.min(Math.round(t*e),i-1)}const Za=class Za extends Xi{constructor(i,s,n=Za.defaultProps){super(i,s,n);K(this,"dimension");K(this,"format");K(this,"width");K(this,"height");K(this,"depth");K(this,"updateTimestamp");this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.updateTimestamp=i.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}};K(Za,"defaultProps",{...Xi.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0,sampler:{},view:void 0}),K(Za,"COPY_SRC",1),K(Za,"COPY_DST",2),K(Za,"TEXTURE_BINDING",4),K(Za,"STORAGE_BINDING",8),K(Za,"RENDER_ATTACHMENT",16);let po=Za;const Wy=class Wy extends Xi{get[Symbol.toStringTag](){return"TextureView"}constructor(e,i){super(e,i,Wy.defaultProps)}};K(Wy,"defaultProps",{...Xi.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let my=Wy;function ZU(t,e,i){let s="";const n=e.split(/\r?\n/),a=t.slice().sort((u,c)=>u.lineNum-c.lineNum);switch((i==null?void 0:i.showSourceCode)||"no"){case"all":let u=0;for(let c=1;c<=n.length;c++)for(s+=mR(n[c-1],c,i);a.length>u&&a[u].lineNum===c;){const _=a[u++];s+=Y2(_,n,_.lineNum,{...i,inlineSource:!1})}return s;case"issues":case"no":for(const c of t)s+=Y2(c,n,c.lineNum,{inlineSource:(i==null?void 0:i.showSourceCode)!=="no"});return s}}function Y2(t,e,i,s){if(s!=null&&s.inlineSource){const n=YU(e,i),a=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^ `:"";return` ${n}${a}${t.type.toUpperCase()}: ${t.message} -`}return s!=null&&s.html?`
${t.type.toUpperCase()}: ${t.message}
`:`${t.type.toUpperCase()}: ${t.message}`}function WU(t,e,i){let s="";for(let n=e-2;n<=e;n++){const a=t[n-1];a!==void 0&&(s+=fM(a,e,i))}return s}function fM(t,e,i){const s=i!=null&&i.html?qU(t):t;return`${HU(String(e),4)}: ${s}${i!=null&&i.html?"
":` -`}`}function HU(t,e){let i="";for(let s=t.length;s",">").replaceAll('"',""").replaceAll("'","'")}function pM(t,e){return{name:XU(t,e),language:"glsl",version:ZU(t)}}function XU(t,e="unnamed"){const s=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return s?s[1]:e}function ZU(t){let e=100;const i=t.match(/[^\s]+/g);if(i&&i.length>=2&&i[0]==="#version"){const s=parseInt(i[1],10);Number.isFinite(s)&&(e=s)}return e}const jy=class jy extends Zi{constructor(i,s){super(i,{id:KU(s),...s},jy.defaultProps);J(this,"stage");J(this,"source");J(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(i=this.props.debug){switch(i){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const s=await this.getCompilationInfo();this.props.debug==="warnings"&&(s==null?void 0:s.length)===0||this._displayShaderLog(s)}_displayShaderLog(i){var w;if(typeof document>"u"||!(document!=null&&document.createElement))return;const s=pM(this.source).name,n=`${this.stage} ${s}`;let a=$U(i,this.source,{showSourceCode:"all",html:!0});const u=this.getTranslatedSource();u&&(a+=`

Translated Source



${u}
`);const c=document.createElement("Button");c.innerHTML=` +`}return s!=null&&s.html?`
${t.type.toUpperCase()}: ${t.message}
`:`${t.type.toUpperCase()}: ${t.message}`}function YU(t,e,i){let s="";for(let n=e-2;n<=e;n++){const a=t[n-1];a!==void 0&&(s+=mR(a,e,i))}return s}function mR(t,e,i){const s=i!=null&&i.html?JU(t):t;return`${KU(String(e),4)}: ${s}${i!=null&&i.html?"
":` +`}`}function KU(t,e){let i="";for(let s=t.length;s",">").replaceAll('"',""").replaceAll("'","'")}function _R(t,e){return{name:GU(t,e),language:"glsl",version:QU(t)}}function GU(t,e="unnamed"){const s=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return s?s[1]:e}function QU(t){let e=100;const i=t.match(/[^\s]+/g);if(i&&i.length>=2&&i[0]==="#version"){const s=parseInt(i[1],10);Number.isFinite(s)&&(e=s)}return e}const qy=class qy extends Xi{constructor(i,s){super(i,{id:e5(s),...s},qy.defaultProps);K(this,"stage");K(this,"source");K(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(i=this.props.debug){switch(i){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const s=await this.getCompilationInfo();this.props.debug==="warnings"&&(s==null?void 0:s.length)===0||this._displayShaderLog(s)}_displayShaderLog(i){var w;if(typeof document>"u"||!(document!=null&&document.createElement))return;const s=_R(this.source).name,n=`${this.stage} ${s}`;let a=ZU(i,this.source,{showSourceCode:"all",html:!0});const u=this.getTranslatedSource();u&&(a+=`

Translated Source



${u}
`);const c=document.createElement("Button");c.innerHTML=`

Shader Compilation Error in ${n}



 ${a}
-
`,c.style.top="10px",c.style.left="10px",c.style.position="absolute",c.style.zIndex="9999",c.style.width="100%",c.style.textAlign="left",document.body.appendChild(c);const _=document.getElementsByClassName("luma-compiler-log-error");(w=_[0])!=null&&w.scrollIntoView&&_[0].scrollIntoView(),c.onclick=()=>{const S=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(S)}}};J(jy,"defaultProps",{...Zi.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});let hy=jy;function KU(t){return pM(t.source).name||t.id||ku(`unnamed ${t.stage}-shader`)}const $y=class $y extends Zi{get[Symbol.toStringTag](){return"Sampler"}constructor(e,i){super(e,i,$y.defaultProps)}};J($y,"defaultProps",{...Zi.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let dy=$y;const Wy=class Wy extends Zi{constructor(i,s={}){super(i,s,Wy.defaultProps);J(this,"width");J(this,"height");J(this,"colorAttachments",[]);J(this,"depthStencilAttachment",null);this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}resize(i){let s=!i;if(i){const[n,a]=Array.isArray(i)?i:[i.width,i.height];s=s||a!==this.height||n!==this.width,this.width=n,this.height=a}s&&(lt.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(s=>{if(typeof s=="string"){const n=this.createColorTexture(s);return this.attachResource(n),n.view}return s instanceof ao?s.view:s});const i=this.props.depthStencilAttachment;if(i)if(typeof i=="string"){const s=this.createDepthStencilTexture(i);this.attachResource(s),this.depthStencilAttachment=s.view}else i instanceof ao?this.depthStencilAttachment=i.view:this.depthStencilAttachment=i}createColorTexture(i){return this.device.createTexture({id:"color-attachment",usage:ao.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})}createDepthStencilTexture(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:ao.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})}resizeAttachments(i,s){for(let n=0;n":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},QU={f32:4,f16:2,i32:4,u32:4};function mM(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[i,s]=t.split("x"),n=i,a=s?parseInt(s):1,u=hM(n),c={type:n,components:a,byteLength:u.byteLength*a,integer:u.integer,signed:u.signed,normalized:u.normalized};return e&&(c.webglOnly=!0),c}function gM(t,e){const i={};for(const s of t.attributes)i[s.name]=t5(t,e,s.name);return i}function e5(t,e,i=16){const s=gM(t,e),n=new Array(i).fill(null);for(const a of Object.values(s))n[a.location]=a;return n}function t5(t,e,i){const s=i5(t,i),n=s5(e,i);if(!s)return null;const a=YU(s.type),u=(n==null?void 0:n.vertexFormat)||a.defaultVertexFormat,c=mM(u);return{attributeName:(n==null?void 0:n.attributeName)||s.name,bufferName:(n==null?void 0:n.bufferName)||s.name,location:s.location,shaderType:s.type,shaderDataType:a.dataType,shaderComponents:a.components,vertexFormat:u,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:a.integer,stepMode:(n==null?void 0:n.stepMode)||s.stepMode,byteOffset:(n==null?void 0:n.byteOffset)||0,byteStride:(n==null?void 0:n.byteStride)||0}}function i5(t,e){const i=t.attributes.find(s=>s.name===e);return i||lt.warn(`shader layout attribute "${e}" not present in shader`),i||null}function s5(t,e){n5(t);let i=r5(t,e);return i||(i=o5(t,e),i)?i:(lt.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function n5(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&<.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function r5(t,e){for(const i of t)if(i.format&&i.name===e)return{attributeName:i.name,bufferName:e,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0};return null}function o5(t,e){var i;for(const s of t){let n=s.byteStride;if(typeof s.byteStride!="number")for(const u of s.attributes||[]){const c=mM(u.format);n+=c.byteLength}const a=(i=s.attributes)==null?void 0:i.find(u=>u.attribute===e);if(a)return{attributeName:a.attribute,bufferName:s.name,stepMode:s.stepMode,vertexFormat:a.format,byteOffset:a.byteOffset,byteStride:n}}return null}function a5(t,e){const i={...t,attributes:t.attributes.map(s=>({...s}))};for(const s of(e==null?void 0:e.attributes)||[]){const n=i.attributes.find(a=>a.name===s.name);n?(n.type=s.type||n.type,n.stepMode=s.stepMode||n.stepMode):lt.warn(`shader layout attribute ${s.name} not present in shader`)}return i}const Yy=class Yy extends Zi{constructor(i,s){super(i,s,Yy.defaultProps);J(this,"maxVertexAttributes");J(this,"attributeInfos");J(this,"indexBuffer",null);J(this,"attributes");this.maxVertexAttributes=i.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=e5(s.renderPipeline.shaderLayout,s.renderPipeline.bufferLayout,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(i,s){throw new Error("constant attributes not supported")}};J(Yy,"defaultProps",{...Zi.defaultProps,renderPipeline:null});let dw=Yy;const Jy=class Jy extends Zi{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,i){super(e,i,Jy.defaultProps)}};J(Jy,"defaultProps",{...Zi.defaultProps,layout:void 0,buffers:{}});let fw=Jy;const Gy=class Gy extends Zi{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,i){super(e,i,Gy.defaultProps)}};J(Gy,"defaultProps",{...Zi.defaultProps,type:void 0,count:void 0});let pw=Gy;const l5={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16}};function c5(t){const e=l5[t];return ns(t),e}function u5(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let h_;function _M(t){return(!h_||h_.byteLengtha.type==="uniform"&&a.name===(e==null?void 0:e.name));if(!s)throw new Error(e==null?void 0:e.name);const n=s;for(const a of n.uniforms||[])this.bindingLayout[a.name]=a}}setUniforms(e){for(const[i,s]of Object.entries(e))this._setUniform(i,s),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${i}=${s}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,i){p5(this.uniforms[e],i)||(this.uniforms[e]=m5(i),this.modifiedUniforms[e]=!0,this.modified=!0)}}class _5{constructor(e){J(this,"uniformBlocks",new Map);J(this,"uniformBufferLayouts",new Map);J(this,"uniformBuffers",new Map);for(const[i,s]of Object.entries(e)){const n=i,a=new f5(s.uniformTypes||{});this.uniformBufferLayouts.set(n,a);const u=new g5({name:i});u.setUniforms(s.defaultUniforms||{}),this.uniformBlocks.set(n,u)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(const[i,s]of Object.entries(e))this.uniformBlocks.get(i).setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e).byteLength}getUniformBufferData(e){const i=this.uniformBlocks.get(e).getAllUniforms();return this.uniformBufferLayouts.get(e).getData(i)}createUniformBuffer(e,i,s){s&&this.setUniforms(s);const n=this.getUniformBufferByteLength(i),a=e.createBuffer({usage:Ns.UNIFORM|Ns.COPY_DST,byteLength:n}),u=this.getUniformBufferData(i);return a.write(u),a}getManagedUniformBuffer(e,i){if(!this.uniformBuffers.get(i)){const s=this.getUniformBufferByteLength(i),n=e.createBuffer({usage:Ns.UNIFORM|Ns.COPY_DST,byteLength:s});this.uniformBuffers.set(i,n)}return this.uniformBuffers.get(i)}updateUniformBuffers(){let e=!1;for(const i of this.uniformBlocks.keys()){const s=this.updateUniformBuffer(i);e||(e=s)}return e&<.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){const i=this.uniformBlocks.get(e),s=this.uniformBuffers.get(e);let n=!1;if(s&&i.needsRedraw){n||(n=i.needsRedraw);const a=this.getUniformBufferData(e);this.uniformBuffers.get(e).write(a);const c=this.uniformBlocks.get(e).getAllUniforms();lt.log(4,`Writing to uniform buffer ${String(e)}`,a,c)()}return n}}function yM(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function bM(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function y5(t,e,i){if(!e||e>4)throw new Error(`size ${e}`);const s=e;let n=yM(t);if(n==="uint8"||n==="sint8"){if(s===1||s===3)throw new Error(`size: ${e}`);return i&&(n=n.replace("int","norm")),`${n}x${s}`}if(n==="uint16"||n==="sint16"){if(s===1||s===3)throw new Error(`size: ${e}`);return i&&(n=n.replace("int","norm")),`${n}x${s}`}return s===1?n:`${n}x${s}`}function b5(t){return im(t)!==null||typeof t=="number"||typeof t=="boolean"}function j1(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(i=>{const s=t[i];b5(s)?e.uniforms[i]=s:e.bindings[i]=s}),e}function v5(t,e,i){const{removedProps:s={},deprecatedProps:n={},replacedProps:a={}}=i;for(const c in s)if(c in e){const w=s[c]?`${t}.${s[c]}`:"N/A";lt.removed(`${t}.${c}`,w)()}for(const c in n)if(c in e){const _=n[c];lt.deprecated(`${t}.${c}`,`${t}.${_}`)()}let u=null;for(const[c,_]of Object.entries(a))c in e&&(lt.deprecated(`${t}.${c}`,`${t}.${_}`)(),u=u||Object.assign({},e),u[_]=e[c],delete u[c]);return u||e}let x5="";async function w5(t,e){return await new Promise((i,s)=>{try{const n=new Image;n.onload=()=>i(n),n.onerror=()=>s(new Error(`Could not load image ${t}.`)),n.crossOrigin=(e==null?void 0:e.crossOrigin)||"anonymous",n.src=t.startsWith("http")?t:x5+t}catch(n){s(n)}})}async function vM(t,e){const i=document.getElementsByTagName("head")[0];if(!i)throw new Error("loadScript");const s=document.createElement("script");return s.setAttribute("type","text/javascript"),s.setAttribute("src",t),new Promise((n,a)=>{s.onload=n,s.onerror=u=>a(new Error(`Unable to load script '${t}': ${u}`)),i.appendChild(s)})}function mw(t,e,i){if(t===e)return!0;if(!i||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let s=0;s":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class CM extends sl{constructor(){super()}}class X5 extends CM{constructor(e,i){super(),this.selector=e,this.body=i}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class Z5 extends CM{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class K5 extends sl{constructor(e,i,s){super(),this.name=e,this.type=i,this.attributes=s}get astNodeType(){return"argument"}}class Y5 extends sl{constructor(e,i){super(),this.condition=e,this.body=i}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class J5 extends sl{constructor(e,i,s){super(),this.name=e,this.type=i,this.attributes=s}get astNodeType(){return"member"}}let G5=class extends sl{constructor(e,i){super(),this.name=e,this.value=i}get astNodeType(){return"attribute"}};var Me,Ae;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(Ae||(Ae={}));class Ie{constructor(e,i,s){this.name=e,this.type=i,this.rule=s}toString(){return this.name}}class ie{}Me=ie;ie.none=new Ie("",Ae.reserved,"");ie.eof=new Ie("EOF",Ae.token,"");ie.reserved={asm:new Ie("asm",Ae.reserved,"asm"),bf16:new Ie("bf16",Ae.reserved,"bf16"),do:new Ie("do",Ae.reserved,"do"),enum:new Ie("enum",Ae.reserved,"enum"),f16:new Ie("f16",Ae.reserved,"f16"),f64:new Ie("f64",Ae.reserved,"f64"),handle:new Ie("handle",Ae.reserved,"handle"),i8:new Ie("i8",Ae.reserved,"i8"),i16:new Ie("i16",Ae.reserved,"i16"),i64:new Ie("i64",Ae.reserved,"i64"),mat:new Ie("mat",Ae.reserved,"mat"),premerge:new Ie("premerge",Ae.reserved,"premerge"),regardless:new Ie("regardless",Ae.reserved,"regardless"),typedef:new Ie("typedef",Ae.reserved,"typedef"),u8:new Ie("u8",Ae.reserved,"u8"),u16:new Ie("u16",Ae.reserved,"u16"),u64:new Ie("u64",Ae.reserved,"u64"),unless:new Ie("unless",Ae.reserved,"unless"),using:new Ie("using",Ae.reserved,"using"),vec:new Ie("vec",Ae.reserved,"vec"),void:new Ie("void",Ae.reserved,"void")};ie.keywords={array:new Ie("array",Ae.keyword,"array"),atomic:new Ie("atomic",Ae.keyword,"atomic"),bool:new Ie("bool",Ae.keyword,"bool"),f32:new Ie("f32",Ae.keyword,"f32"),i32:new Ie("i32",Ae.keyword,"i32"),mat2x2:new Ie("mat2x2",Ae.keyword,"mat2x2"),mat2x3:new Ie("mat2x3",Ae.keyword,"mat2x3"),mat2x4:new Ie("mat2x4",Ae.keyword,"mat2x4"),mat3x2:new Ie("mat3x2",Ae.keyword,"mat3x2"),mat3x3:new Ie("mat3x3",Ae.keyword,"mat3x3"),mat3x4:new Ie("mat3x4",Ae.keyword,"mat3x4"),mat4x2:new Ie("mat4x2",Ae.keyword,"mat4x2"),mat4x3:new Ie("mat4x3",Ae.keyword,"mat4x3"),mat4x4:new Ie("mat4x4",Ae.keyword,"mat4x4"),ptr:new Ie("ptr",Ae.keyword,"ptr"),sampler:new Ie("sampler",Ae.keyword,"sampler"),sampler_comparison:new Ie("sampler_comparison",Ae.keyword,"sampler_comparison"),struct:new Ie("struct",Ae.keyword,"struct"),texture_1d:new Ie("texture_1d",Ae.keyword,"texture_1d"),texture_2d:new Ie("texture_2d",Ae.keyword,"texture_2d"),texture_2d_array:new Ie("texture_2d_array",Ae.keyword,"texture_2d_array"),texture_3d:new Ie("texture_3d",Ae.keyword,"texture_3d"),texture_cube:new Ie("texture_cube",Ae.keyword,"texture_cube"),texture_cube_array:new Ie("texture_cube_array",Ae.keyword,"texture_cube_array"),texture_multisampled_2d:new Ie("texture_multisampled_2d",Ae.keyword,"texture_multisampled_2d"),texture_storage_1d:new Ie("texture_storage_1d",Ae.keyword,"texture_storage_1d"),texture_storage_2d:new Ie("texture_storage_2d",Ae.keyword,"texture_storage_2d"),texture_storage_2d_array:new Ie("texture_storage_2d_array",Ae.keyword,"texture_storage_2d_array"),texture_storage_3d:new Ie("texture_storage_3d",Ae.keyword,"texture_storage_3d"),texture_depth_2d:new Ie("texture_depth_2d",Ae.keyword,"texture_depth_2d"),texture_depth_2d_array:new Ie("texture_depth_2d_array",Ae.keyword,"texture_depth_2d_array"),texture_depth_cube:new Ie("texture_depth_cube",Ae.keyword,"texture_depth_cube"),texture_depth_cube_array:new Ie("texture_depth_cube_array",Ae.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new Ie("texture_depth_multisampled_2d",Ae.keyword,"texture_depth_multisampled_2d"),texture_external:new Ie("texture_external",Ae.keyword,"texture_external"),u32:new Ie("u32",Ae.keyword,"u32"),vec2:new Ie("vec2",Ae.keyword,"vec2"),vec3:new Ie("vec3",Ae.keyword,"vec3"),vec4:new Ie("vec4",Ae.keyword,"vec4"),bitcast:new Ie("bitcast",Ae.keyword,"bitcast"),block:new Ie("block",Ae.keyword,"block"),break:new Ie("break",Ae.keyword,"break"),case:new Ie("case",Ae.keyword,"case"),continue:new Ie("continue",Ae.keyword,"continue"),continuing:new Ie("continuing",Ae.keyword,"continuing"),default:new Ie("default",Ae.keyword,"default"),diagnostic:new Ie("diagnostic",Ae.keyword,"diagnostic"),discard:new Ie("discard",Ae.keyword,"discard"),else:new Ie("else",Ae.keyword,"else"),enable:new Ie("enable",Ae.keyword,"enable"),fallthrough:new Ie("fallthrough",Ae.keyword,"fallthrough"),false:new Ie("false",Ae.keyword,"false"),fn:new Ie("fn",Ae.keyword,"fn"),for:new Ie("for",Ae.keyword,"for"),function:new Ie("function",Ae.keyword,"function"),if:new Ie("if",Ae.keyword,"if"),let:new Ie("let",Ae.keyword,"let"),const:new Ie("const",Ae.keyword,"const"),loop:new Ie("loop",Ae.keyword,"loop"),while:new Ie("while",Ae.keyword,"while"),private:new Ie("private",Ae.keyword,"private"),read:new Ie("read",Ae.keyword,"read"),read_write:new Ie("read_write",Ae.keyword,"read_write"),return:new Ie("return",Ae.keyword,"return"),requires:new Ie("requires",Ae.keyword,"requires"),storage:new Ie("storage",Ae.keyword,"storage"),switch:new Ie("switch",Ae.keyword,"switch"),true:new Ie("true",Ae.keyword,"true"),alias:new Ie("alias",Ae.keyword,"alias"),type:new Ie("type",Ae.keyword,"type"),uniform:new Ie("uniform",Ae.keyword,"uniform"),var:new Ie("var",Ae.keyword,"var"),override:new Ie("override",Ae.keyword,"override"),workgroup:new Ie("workgroup",Ae.keyword,"workgroup"),write:new Ie("write",Ae.keyword,"write"),r8unorm:new Ie("r8unorm",Ae.keyword,"r8unorm"),r8snorm:new Ie("r8snorm",Ae.keyword,"r8snorm"),r8uint:new Ie("r8uint",Ae.keyword,"r8uint"),r8sint:new Ie("r8sint",Ae.keyword,"r8sint"),r16uint:new Ie("r16uint",Ae.keyword,"r16uint"),r16sint:new Ie("r16sint",Ae.keyword,"r16sint"),r16float:new Ie("r16float",Ae.keyword,"r16float"),rg8unorm:new Ie("rg8unorm",Ae.keyword,"rg8unorm"),rg8snorm:new Ie("rg8snorm",Ae.keyword,"rg8snorm"),rg8uint:new Ie("rg8uint",Ae.keyword,"rg8uint"),rg8sint:new Ie("rg8sint",Ae.keyword,"rg8sint"),r32uint:new Ie("r32uint",Ae.keyword,"r32uint"),r32sint:new Ie("r32sint",Ae.keyword,"r32sint"),r32float:new Ie("r32float",Ae.keyword,"r32float"),rg16uint:new Ie("rg16uint",Ae.keyword,"rg16uint"),rg16sint:new Ie("rg16sint",Ae.keyword,"rg16sint"),rg16float:new Ie("rg16float",Ae.keyword,"rg16float"),rgba8unorm:new Ie("rgba8unorm",Ae.keyword,"rgba8unorm"),rgba8unorm_srgb:new Ie("rgba8unorm_srgb",Ae.keyword,"rgba8unorm_srgb"),rgba8snorm:new Ie("rgba8snorm",Ae.keyword,"rgba8snorm"),rgba8uint:new Ie("rgba8uint",Ae.keyword,"rgba8uint"),rgba8sint:new Ie("rgba8sint",Ae.keyword,"rgba8sint"),bgra8unorm:new Ie("bgra8unorm",Ae.keyword,"bgra8unorm"),bgra8unorm_srgb:new Ie("bgra8unorm_srgb",Ae.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new Ie("rgb10a2unorm",Ae.keyword,"rgb10a2unorm"),rg11b10float:new Ie("rg11b10float",Ae.keyword,"rg11b10float"),rg32uint:new Ie("rg32uint",Ae.keyword,"rg32uint"),rg32sint:new Ie("rg32sint",Ae.keyword,"rg32sint"),rg32float:new Ie("rg32float",Ae.keyword,"rg32float"),rgba16uint:new Ie("rgba16uint",Ae.keyword,"rgba16uint"),rgba16sint:new Ie("rgba16sint",Ae.keyword,"rgba16sint"),rgba16float:new Ie("rgba16float",Ae.keyword,"rgba16float"),rgba32uint:new Ie("rgba32uint",Ae.keyword,"rgba32uint"),rgba32sint:new Ie("rgba32sint",Ae.keyword,"rgba32sint"),rgba32float:new Ie("rgba32float",Ae.keyword,"rgba32float"),static_assert:new Ie("static_assert",Ae.keyword,"static_assert")};ie.tokens={decimal_float_literal:new Ie("decimal_float_literal",Ae.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new Ie("hex_float_literal",Ae.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new Ie("int_literal",Ae.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new Ie("uint_literal",Ae.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new Ie("ident",Ae.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new Ie("and",Ae.token,"&"),and_and:new Ie("and_and",Ae.token,"&&"),arrow:new Ie("arrow ",Ae.token,"->"),attr:new Ie("attr",Ae.token,"@"),forward_slash:new Ie("forward_slash",Ae.token,"/"),bang:new Ie("bang",Ae.token,"!"),bracket_left:new Ie("bracket_left",Ae.token,"["),bracket_right:new Ie("bracket_right",Ae.token,"]"),brace_left:new Ie("brace_left",Ae.token,"{"),brace_right:new Ie("brace_right",Ae.token,"}"),colon:new Ie("colon",Ae.token,":"),comma:new Ie("comma",Ae.token,","),equal:new Ie("equal",Ae.token,"="),equal_equal:new Ie("equal_equal",Ae.token,"=="),not_equal:new Ie("not_equal",Ae.token,"!="),greater_than:new Ie("greater_than",Ae.token,">"),greater_than_equal:new Ie("greater_than_equal",Ae.token,">="),shift_right:new Ie("shift_right",Ae.token,">>"),less_than:new Ie("less_than",Ae.token,"<"),less_than_equal:new Ie("less_than_equal",Ae.token,"<="),shift_left:new Ie("shift_left",Ae.token,"<<"),modulo:new Ie("modulo",Ae.token,"%"),minus:new Ie("minus",Ae.token,"-"),minus_minus:new Ie("minus_minus",Ae.token,"--"),period:new Ie("period",Ae.token,"."),plus:new Ie("plus",Ae.token,"+"),plus_plus:new Ie("plus_plus",Ae.token,"++"),or:new Ie("or",Ae.token,"|"),or_or:new Ie("or_or",Ae.token,"||"),paren_left:new Ie("paren_left",Ae.token,"("),paren_right:new Ie("paren_right",Ae.token,")"),semicolon:new Ie("semicolon",Ae.token,";"),star:new Ie("star",Ae.token,"*"),tilde:new Ie("tilde",Ae.token,"~"),underscore:new Ie("underscore",Ae.token,"_"),xor:new Ie("xor",Ae.token,"^"),plus_equal:new Ie("plus_equal",Ae.token,"+="),minus_equal:new Ie("minus_equal",Ae.token,"-="),times_equal:new Ie("times_equal",Ae.token,"*="),division_equal:new Ie("division_equal",Ae.token,"/="),modulo_equal:new Ie("modulo_equal",Ae.token,"%="),and_equal:new Ie("and_equal",Ae.token,"&="),or_equal:new Ie("or_equal",Ae.token,"|="),xor_equal:new Ie("xor_equal",Ae.token,"^="),shift_right_equal:new Ie("shift_right_equal",Ae.token,">>="),shift_left_equal:new Ie("shift_left_equal",Ae.token,"<<=")};ie.simpleTokens={"@":Me.tokens.attr,"{":Me.tokens.brace_left,"}":Me.tokens.brace_right,":":Me.tokens.colon,",":Me.tokens.comma,"(":Me.tokens.paren_left,")":Me.tokens.paren_right,";":Me.tokens.semicolon};ie.literalTokens={"&":Me.tokens.and,"&&":Me.tokens.and_and,"->":Me.tokens.arrow,"/":Me.tokens.forward_slash,"!":Me.tokens.bang,"[":Me.tokens.bracket_left,"]":Me.tokens.bracket_right,"=":Me.tokens.equal,"==":Me.tokens.equal_equal,"!=":Me.tokens.not_equal,">":Me.tokens.greater_than,">=":Me.tokens.greater_than_equal,">>":Me.tokens.shift_right,"<":Me.tokens.less_than,"<=":Me.tokens.less_than_equal,"<<":Me.tokens.shift_left,"%":Me.tokens.modulo,"-":Me.tokens.minus,"--":Me.tokens.minus_minus,".":Me.tokens.period,"+":Me.tokens.plus,"++":Me.tokens.plus_plus,"|":Me.tokens.or,"||":Me.tokens.or_or,"*":Me.tokens.star,"~":Me.tokens.tilde,_:Me.tokens.underscore,"^":Me.tokens.xor,"+=":Me.tokens.plus_equal,"-=":Me.tokens.minus_equal,"*=":Me.tokens.times_equal,"/=":Me.tokens.division_equal,"%=":Me.tokens.modulo_equal,"&=":Me.tokens.and_equal,"|=":Me.tokens.or_equal,"^=":Me.tokens.xor_equal,">>=":Me.tokens.shift_right_equal,"<<=":Me.tokens.shift_left_equal};ie.regexTokens={decimal_float_literal:Me.tokens.decimal_float_literal,hex_float_literal:Me.tokens.hex_float_literal,int_literal:Me.tokens.int_literal,uint_literal:Me.tokens.uint_literal,ident:Me.tokens.ident};ie.storage_class=[Me.keywords.function,Me.keywords.private,Me.keywords.workgroup,Me.keywords.uniform,Me.keywords.storage];ie.access_mode=[Me.keywords.read,Me.keywords.write,Me.keywords.read_write];ie.sampler_type=[Me.keywords.sampler,Me.keywords.sampler_comparison];ie.sampled_texture_type=[Me.keywords.texture_1d,Me.keywords.texture_2d,Me.keywords.texture_2d_array,Me.keywords.texture_3d,Me.keywords.texture_cube,Me.keywords.texture_cube_array];ie.multisampled_texture_type=[Me.keywords.texture_multisampled_2d];ie.storage_texture_type=[Me.keywords.texture_storage_1d,Me.keywords.texture_storage_2d,Me.keywords.texture_storage_2d_array,Me.keywords.texture_storage_3d];ie.depth_texture_type=[Me.keywords.texture_depth_2d,Me.keywords.texture_depth_2d_array,Me.keywords.texture_depth_cube,Me.keywords.texture_depth_cube_array,Me.keywords.texture_depth_multisampled_2d];ie.texture_external_type=[Me.keywords.texture_external];ie.any_texture_type=[...Me.sampled_texture_type,...Me.multisampled_texture_type,...Me.storage_texture_type,...Me.depth_texture_type,...Me.texture_external_type];ie.texel_format=[Me.keywords.r8unorm,Me.keywords.r8snorm,Me.keywords.r8uint,Me.keywords.r8sint,Me.keywords.r16uint,Me.keywords.r16sint,Me.keywords.r16float,Me.keywords.rg8unorm,Me.keywords.rg8snorm,Me.keywords.rg8uint,Me.keywords.rg8sint,Me.keywords.r32uint,Me.keywords.r32sint,Me.keywords.r32float,Me.keywords.rg16uint,Me.keywords.rg16sint,Me.keywords.rg16float,Me.keywords.rgba8unorm,Me.keywords.rgba8unorm_srgb,Me.keywords.rgba8snorm,Me.keywords.rgba8uint,Me.keywords.rgba8sint,Me.keywords.bgra8unorm,Me.keywords.bgra8unorm_srgb,Me.keywords.rgb10a2unorm,Me.keywords.rg11b10float,Me.keywords.rg32uint,Me.keywords.rg32sint,Me.keywords.rg32float,Me.keywords.rgba16uint,Me.keywords.rgba16sint,Me.keywords.rgba16float,Me.keywords.rgba32uint,Me.keywords.rgba32sint,Me.keywords.rgba32float];ie.const_literal=[Me.tokens.int_literal,Me.tokens.uint_literal,Me.tokens.decimal_float_literal,Me.tokens.hex_float_literal,Me.keywords.true,Me.keywords.false];ie.literal_or_ident=[Me.tokens.ident,Me.tokens.int_literal,Me.tokens.uint_literal,Me.tokens.decimal_float_literal,Me.tokens.hex_float_literal];ie.element_count_expression=[Me.tokens.int_literal,Me.tokens.uint_literal,Me.tokens.ident];ie.template_types=[Me.keywords.vec2,Me.keywords.vec3,Me.keywords.vec4,Me.keywords.mat2x2,Me.keywords.mat2x3,Me.keywords.mat2x4,Me.keywords.mat3x2,Me.keywords.mat3x3,Me.keywords.mat3x4,Me.keywords.mat4x2,Me.keywords.mat4x3,Me.keywords.mat4x4,Me.keywords.atomic,Me.keywords.bitcast,...Me.any_texture_type];ie.attribute_name=[Me.tokens.ident,Me.keywords.block,Me.keywords.diagnostic];ie.assignment_operators=[Me.tokens.equal,Me.tokens.plus_equal,Me.tokens.minus_equal,Me.tokens.times_equal,Me.tokens.division_equal,Me.tokens.modulo_equal,Me.tokens.and_equal,Me.tokens.or_equal,Me.tokens.xor_equal,Me.tokens.shift_right_equal,Me.tokens.shift_left_equal];ie.increment_operators=[Me.tokens.plus_plus,Me.tokens.minus_minus];class tI{constructor(e,i,s){this.type=e,this.lexeme=i,this.line=s}toString(){return this.lexeme}isTemplateType(){return ie.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==ie.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class Q5{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new tI(ie.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==` +`,c.style.top="10px",c.style.left="10px",c.style.position="absolute",c.style.zIndex="9999",c.style.width="100%",c.style.textAlign="left",document.body.appendChild(c);const _=document.getElementsByClassName("luma-compiler-log-error");(w=_[0])!=null&&w.scrollIntoView&&_[0].scrollIntoView(),c.onclick=()=>{const S=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(S)}}};K(qy,"defaultProps",{...Xi.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});let _y=qy;function e5(t){return _R(t.source).name||t.id||$u(`unnamed ${t.stage}-shader`)}const Xy=class Xy extends Xi{get[Symbol.toStringTag](){return"Sampler"}constructor(e,i){super(e,i,Xy.defaultProps)}};K(Xy,"defaultProps",{...Xi.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let yy=Xy;const Zy=class Zy extends Xi{constructor(i,s={}){super(i,s,Zy.defaultProps);K(this,"width");K(this,"height");K(this,"colorAttachments",[]);K(this,"depthStencilAttachment",null);this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}resize(i){let s=!i;if(i){const[n,a]=Array.isArray(i)?i:[i.width,i.height];s=s||a!==this.height||n!==this.width,this.width=n,this.height=a}s&&(at.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(s=>{if(typeof s=="string"){const n=this.createColorTexture(s);return this.attachResource(n),n.view}return s instanceof po?s.view:s});const i=this.props.depthStencilAttachment;if(i)if(typeof i=="string"){const s=this.createDepthStencilTexture(i);this.attachResource(s),this.depthStencilAttachment=s.view}else i instanceof po?this.depthStencilAttachment=i.view:this.depthStencilAttachment=i}createColorTexture(i){return this.device.createTexture({id:"color-attachment",usage:po.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})}createDepthStencilTexture(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:po.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})}resizeAttachments(i,s){for(let n=0;n":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},n5={f32:4,f16:2,i32:4,u32:4};function yR(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[i,s]=t.split("x"),n=i,a=s?parseInt(s):1,u=pR(n),c={type:n,components:a,byteLength:u.byteLength*a,integer:u.integer,signed:u.signed,normalized:u.normalized};return e&&(c.webglOnly=!0),c}function bR(t,e){const i={};for(const s of t.attributes)i[s.name]=o5(t,e,s.name);return i}function r5(t,e,i=16){const s=bR(t,e),n=new Array(i).fill(null);for(const a of Object.values(s))n[a.location]=a;return n}function o5(t,e,i){const s=a5(t,i),n=l5(e,i);if(!s)return null;const a=t5(s.type),u=(n==null?void 0:n.vertexFormat)||a.defaultVertexFormat,c=yR(u);return{attributeName:(n==null?void 0:n.attributeName)||s.name,bufferName:(n==null?void 0:n.bufferName)||s.name,location:s.location,shaderType:s.type,shaderDataType:a.dataType,shaderComponents:a.components,vertexFormat:u,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:a.integer,stepMode:(n==null?void 0:n.stepMode)||s.stepMode,byteOffset:(n==null?void 0:n.byteOffset)||0,byteStride:(n==null?void 0:n.byteStride)||0}}function a5(t,e){const i=t.attributes.find(s=>s.name===e);return i||at.warn(`shader layout attribute "${e}" not present in shader`),i||null}function l5(t,e){c5(t);let i=u5(t,e);return i||(i=h5(t,e),i)?i:(at.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function c5(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&at.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function u5(t,e){for(const i of t)if(i.format&&i.name===e)return{attributeName:i.name,bufferName:e,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0};return null}function h5(t,e){var i;for(const s of t){let n=s.byteStride;if(typeof s.byteStride!="number")for(const u of s.attributes||[]){const c=yR(u.format);n+=c.byteLength}const a=(i=s.attributes)==null?void 0:i.find(u=>u.attribute===e);if(a)return{attributeName:a.attribute,bufferName:s.name,stepMode:s.stepMode,vertexFormat:a.format,byteOffset:a.byteOffset,byteStride:n}}return null}function f5(t,e){const i={...t,attributes:t.attributes.map(s=>({...s}))};for(const s of(e==null?void 0:e.attributes)||[]){const n=i.attributes.find(a=>a.name===s.name);n?(n.type=s.type||n.type,n.stepMode=s.stepMode||n.stepMode):at.warn(`shader layout attribute ${s.name} not present in shader`)}return i}const e0=class e0 extends Xi{constructor(i,s){super(i,s,e0.defaultProps);K(this,"maxVertexAttributes");K(this,"attributeInfos");K(this,"indexBuffer",null);K(this,"attributes");this.maxVertexAttributes=i.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=r5(s.renderPipeline.shaderLayout,s.renderPipeline.bufferLayout,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(i,s){throw new Error("constant attributes not supported")}};K(e0,"defaultProps",{...Xi.defaultProps,renderPipeline:null});let xw=e0;const t0=class t0 extends Xi{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,i){super(e,i,t0.defaultProps)}};K(t0,"defaultProps",{...Xi.defaultProps,layout:void 0,buffers:{}});let ww=t0;const i0=class i0 extends Xi{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,i){super(e,i,i0.defaultProps)}};K(i0,"defaultProps",{...Xi.defaultProps,type:void 0,count:void 0});let Tw=i0;const d5={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16}};function p5(t){const e=d5[t];return is(t),e}function g5(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let g_;function vR(t){return(!g_||g_.byteLengtha.type==="uniform"&&a.name===(e==null?void 0:e.name));if(!s)throw new Error(e==null?void 0:e.name);const n=s;for(const a of n.uniforms||[])this.bindingLayout[a.name]=a}}setUniforms(e){for(const[i,s]of Object.entries(e))this._setUniform(i,s),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${i}=${s}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,i){b5(this.uniforms[e],i)||(this.uniforms[e]=v5(i),this.modifiedUniforms[e]=!0,this.modified=!0)}}class w5{constructor(e){K(this,"uniformBlocks",new Map);K(this,"uniformBufferLayouts",new Map);K(this,"uniformBuffers",new Map);for(const[i,s]of Object.entries(e)){const n=i,a=new y5(s.uniformTypes||{});this.uniformBufferLayouts.set(n,a);const u=new x5({name:i});u.setUniforms(s.defaultUniforms||{}),this.uniformBlocks.set(n,u)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(const[i,s]of Object.entries(e))this.uniformBlocks.get(i).setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e).byteLength}getUniformBufferData(e){const i=this.uniformBlocks.get(e).getAllUniforms();return this.uniformBufferLayouts.get(e).getData(i)}createUniformBuffer(e,i,s){s&&this.setUniforms(s);const n=this.getUniformBufferByteLength(i),a=e.createBuffer({usage:Os.UNIFORM|Os.COPY_DST,byteLength:n}),u=this.getUniformBufferData(i);return a.write(u),a}getManagedUniformBuffer(e,i){if(!this.uniformBuffers.get(i)){const s=this.getUniformBufferByteLength(i),n=e.createBuffer({usage:Os.UNIFORM|Os.COPY_DST,byteLength:s});this.uniformBuffers.set(i,n)}return this.uniformBuffers.get(i)}updateUniformBuffers(){let e=!1;for(const i of this.uniformBlocks.keys()){const s=this.updateUniformBuffer(i);e||(e=s)}return e&&at.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){const i=this.uniformBlocks.get(e),s=this.uniformBuffers.get(e);let n=!1;if(s&&i.needsRedraw){n||(n=i.needsRedraw);const a=this.getUniformBufferData(e);this.uniformBuffers.get(e).write(a);const c=this.uniformBlocks.get(e).getAllUniforms();at.log(4,`Writing to uniform buffer ${String(e)}`,a,c)()}return n}}function xR(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function wR(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function T5(t,e,i){if(!e||e>4)throw new Error(`size ${e}`);const s=e;let n=xR(t);if(n==="uint8"&&i&&s===1)return"unorm8-webgl";if(n==="uint8"&&i&&s===3)return"unorm8x3-webgl";if(n==="uint8"||n==="sint8"){if(s===1||s===3)throw new Error(`size: ${e}`);return i&&(n=n.replace("int","norm")),`${n}x${s}`}if(n==="uint16"||n==="sint16"){if(s===1||s===3)throw new Error(`size: ${e}`);return i&&(n=n.replace("int","norm")),`${n}x${s}`}return s===1?n:`${n}x${s}`}function S5(t){return fg(t)!==null||typeof t=="number"||typeof t=="boolean"}function j1(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(i=>{const s=t[i];S5(s)?e.uniforms[i]=s:e.bindings[i]=s}),e}function E5(t,e,i){const{removedProps:s={},deprecatedProps:n={},replacedProps:a={}}=i;for(const c in s)if(c in e){const w=s[c]?`${t}.${s[c]}`:"N/A";at.removed(`${t}.${c}`,w)()}for(const c in n)if(c in e){const _=n[c];at.deprecated(`${t}.${c}`,`${t}.${_}`)()}let u=null;for(const[c,_]of Object.entries(a))c in e&&(at.deprecated(`${t}.${c}`,`${t}.${_}`)(),u=u||Object.assign({},e),u[_]=e[c],delete u[c]);return u||e}let A5="";async function I5(t,e){return await new Promise((i,s)=>{try{const n=new Image;n.onload=()=>i(n),n.onerror=()=>s(new Error(`Could not load image ${t}.`)),n.crossOrigin=(e==null?void 0:e.crossOrigin)||"anonymous",n.src=t.startsWith("http")?t:A5+t}catch(n){s(n)}})}async function TR(t,e){const i=document.getElementsByTagName("head")[0];if(!i)throw new Error("loadScript");const s=document.createElement("script");return s.setAttribute("type","text/javascript"),s.setAttribute("src",t),new Promise((n,a)=>{s.onload=n,s.onerror=u=>a(new Error(`Unable to load script '${t}': ${u}`)),i.appendChild(s)})}function Sw(t,e,i){if(t===e)return!0;if(!i||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let s=0;s":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class RR extends al{constructor(){super()}}class G5 extends RR{constructor(e,i){super(),this.selector=e,this.body=i}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class Q5 extends RR{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class eV extends al{constructor(e,i,s){super(),this.name=e,this.type=i,this.attributes=s}get astNodeType(){return"argument"}}class tV extends al{constructor(e,i){super(),this.condition=e,this.body=i}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class iV extends al{constructor(e,i,s){super(),this.name=e,this.type=i,this.attributes=s}get astNodeType(){return"member"}}let sV=class extends al{constructor(e,i){super(),this.name=e,this.value=i}get astNodeType(){return"attribute"}};var ke,Ie;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(Ie||(Ie={}));class Ce{constructor(e,i,s){this.name=e,this.type=i,this.rule=s}toString(){return this.name}}class ie{}ke=ie;ie.none=new Ce("",Ie.reserved,"");ie.eof=new Ce("EOF",Ie.token,"");ie.reserved={asm:new Ce("asm",Ie.reserved,"asm"),bf16:new Ce("bf16",Ie.reserved,"bf16"),do:new Ce("do",Ie.reserved,"do"),enum:new Ce("enum",Ie.reserved,"enum"),f16:new Ce("f16",Ie.reserved,"f16"),f64:new Ce("f64",Ie.reserved,"f64"),handle:new Ce("handle",Ie.reserved,"handle"),i8:new Ce("i8",Ie.reserved,"i8"),i16:new Ce("i16",Ie.reserved,"i16"),i64:new Ce("i64",Ie.reserved,"i64"),mat:new Ce("mat",Ie.reserved,"mat"),premerge:new Ce("premerge",Ie.reserved,"premerge"),regardless:new Ce("regardless",Ie.reserved,"regardless"),typedef:new Ce("typedef",Ie.reserved,"typedef"),u8:new Ce("u8",Ie.reserved,"u8"),u16:new Ce("u16",Ie.reserved,"u16"),u64:new Ce("u64",Ie.reserved,"u64"),unless:new Ce("unless",Ie.reserved,"unless"),using:new Ce("using",Ie.reserved,"using"),vec:new Ce("vec",Ie.reserved,"vec"),void:new Ce("void",Ie.reserved,"void")};ie.keywords={array:new Ce("array",Ie.keyword,"array"),atomic:new Ce("atomic",Ie.keyword,"atomic"),bool:new Ce("bool",Ie.keyword,"bool"),f32:new Ce("f32",Ie.keyword,"f32"),i32:new Ce("i32",Ie.keyword,"i32"),mat2x2:new Ce("mat2x2",Ie.keyword,"mat2x2"),mat2x3:new Ce("mat2x3",Ie.keyword,"mat2x3"),mat2x4:new Ce("mat2x4",Ie.keyword,"mat2x4"),mat3x2:new Ce("mat3x2",Ie.keyword,"mat3x2"),mat3x3:new Ce("mat3x3",Ie.keyword,"mat3x3"),mat3x4:new Ce("mat3x4",Ie.keyword,"mat3x4"),mat4x2:new Ce("mat4x2",Ie.keyword,"mat4x2"),mat4x3:new Ce("mat4x3",Ie.keyword,"mat4x3"),mat4x4:new Ce("mat4x4",Ie.keyword,"mat4x4"),ptr:new Ce("ptr",Ie.keyword,"ptr"),sampler:new Ce("sampler",Ie.keyword,"sampler"),sampler_comparison:new Ce("sampler_comparison",Ie.keyword,"sampler_comparison"),struct:new Ce("struct",Ie.keyword,"struct"),texture_1d:new Ce("texture_1d",Ie.keyword,"texture_1d"),texture_2d:new Ce("texture_2d",Ie.keyword,"texture_2d"),texture_2d_array:new Ce("texture_2d_array",Ie.keyword,"texture_2d_array"),texture_3d:new Ce("texture_3d",Ie.keyword,"texture_3d"),texture_cube:new Ce("texture_cube",Ie.keyword,"texture_cube"),texture_cube_array:new Ce("texture_cube_array",Ie.keyword,"texture_cube_array"),texture_multisampled_2d:new Ce("texture_multisampled_2d",Ie.keyword,"texture_multisampled_2d"),texture_storage_1d:new Ce("texture_storage_1d",Ie.keyword,"texture_storage_1d"),texture_storage_2d:new Ce("texture_storage_2d",Ie.keyword,"texture_storage_2d"),texture_storage_2d_array:new Ce("texture_storage_2d_array",Ie.keyword,"texture_storage_2d_array"),texture_storage_3d:new Ce("texture_storage_3d",Ie.keyword,"texture_storage_3d"),texture_depth_2d:new Ce("texture_depth_2d",Ie.keyword,"texture_depth_2d"),texture_depth_2d_array:new Ce("texture_depth_2d_array",Ie.keyword,"texture_depth_2d_array"),texture_depth_cube:new Ce("texture_depth_cube",Ie.keyword,"texture_depth_cube"),texture_depth_cube_array:new Ce("texture_depth_cube_array",Ie.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new Ce("texture_depth_multisampled_2d",Ie.keyword,"texture_depth_multisampled_2d"),texture_external:new Ce("texture_external",Ie.keyword,"texture_external"),u32:new Ce("u32",Ie.keyword,"u32"),vec2:new Ce("vec2",Ie.keyword,"vec2"),vec3:new Ce("vec3",Ie.keyword,"vec3"),vec4:new Ce("vec4",Ie.keyword,"vec4"),bitcast:new Ce("bitcast",Ie.keyword,"bitcast"),block:new Ce("block",Ie.keyword,"block"),break:new Ce("break",Ie.keyword,"break"),case:new Ce("case",Ie.keyword,"case"),continue:new Ce("continue",Ie.keyword,"continue"),continuing:new Ce("continuing",Ie.keyword,"continuing"),default:new Ce("default",Ie.keyword,"default"),diagnostic:new Ce("diagnostic",Ie.keyword,"diagnostic"),discard:new Ce("discard",Ie.keyword,"discard"),else:new Ce("else",Ie.keyword,"else"),enable:new Ce("enable",Ie.keyword,"enable"),fallthrough:new Ce("fallthrough",Ie.keyword,"fallthrough"),false:new Ce("false",Ie.keyword,"false"),fn:new Ce("fn",Ie.keyword,"fn"),for:new Ce("for",Ie.keyword,"for"),function:new Ce("function",Ie.keyword,"function"),if:new Ce("if",Ie.keyword,"if"),let:new Ce("let",Ie.keyword,"let"),const:new Ce("const",Ie.keyword,"const"),loop:new Ce("loop",Ie.keyword,"loop"),while:new Ce("while",Ie.keyword,"while"),private:new Ce("private",Ie.keyword,"private"),read:new Ce("read",Ie.keyword,"read"),read_write:new Ce("read_write",Ie.keyword,"read_write"),return:new Ce("return",Ie.keyword,"return"),requires:new Ce("requires",Ie.keyword,"requires"),storage:new Ce("storage",Ie.keyword,"storage"),switch:new Ce("switch",Ie.keyword,"switch"),true:new Ce("true",Ie.keyword,"true"),alias:new Ce("alias",Ie.keyword,"alias"),type:new Ce("type",Ie.keyword,"type"),uniform:new Ce("uniform",Ie.keyword,"uniform"),var:new Ce("var",Ie.keyword,"var"),override:new Ce("override",Ie.keyword,"override"),workgroup:new Ce("workgroup",Ie.keyword,"workgroup"),write:new Ce("write",Ie.keyword,"write"),r8unorm:new Ce("r8unorm",Ie.keyword,"r8unorm"),r8snorm:new Ce("r8snorm",Ie.keyword,"r8snorm"),r8uint:new Ce("r8uint",Ie.keyword,"r8uint"),r8sint:new Ce("r8sint",Ie.keyword,"r8sint"),r16uint:new Ce("r16uint",Ie.keyword,"r16uint"),r16sint:new Ce("r16sint",Ie.keyword,"r16sint"),r16float:new Ce("r16float",Ie.keyword,"r16float"),rg8unorm:new Ce("rg8unorm",Ie.keyword,"rg8unorm"),rg8snorm:new Ce("rg8snorm",Ie.keyword,"rg8snorm"),rg8uint:new Ce("rg8uint",Ie.keyword,"rg8uint"),rg8sint:new Ce("rg8sint",Ie.keyword,"rg8sint"),r32uint:new Ce("r32uint",Ie.keyword,"r32uint"),r32sint:new Ce("r32sint",Ie.keyword,"r32sint"),r32float:new Ce("r32float",Ie.keyword,"r32float"),rg16uint:new Ce("rg16uint",Ie.keyword,"rg16uint"),rg16sint:new Ce("rg16sint",Ie.keyword,"rg16sint"),rg16float:new Ce("rg16float",Ie.keyword,"rg16float"),rgba8unorm:new Ce("rgba8unorm",Ie.keyword,"rgba8unorm"),rgba8unorm_srgb:new Ce("rgba8unorm_srgb",Ie.keyword,"rgba8unorm_srgb"),rgba8snorm:new Ce("rgba8snorm",Ie.keyword,"rgba8snorm"),rgba8uint:new Ce("rgba8uint",Ie.keyword,"rgba8uint"),rgba8sint:new Ce("rgba8sint",Ie.keyword,"rgba8sint"),bgra8unorm:new Ce("bgra8unorm",Ie.keyword,"bgra8unorm"),bgra8unorm_srgb:new Ce("bgra8unorm_srgb",Ie.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new Ce("rgb10a2unorm",Ie.keyword,"rgb10a2unorm"),rg11b10float:new Ce("rg11b10float",Ie.keyword,"rg11b10float"),rg32uint:new Ce("rg32uint",Ie.keyword,"rg32uint"),rg32sint:new Ce("rg32sint",Ie.keyword,"rg32sint"),rg32float:new Ce("rg32float",Ie.keyword,"rg32float"),rgba16uint:new Ce("rgba16uint",Ie.keyword,"rgba16uint"),rgba16sint:new Ce("rgba16sint",Ie.keyword,"rgba16sint"),rgba16float:new Ce("rgba16float",Ie.keyword,"rgba16float"),rgba32uint:new Ce("rgba32uint",Ie.keyword,"rgba32uint"),rgba32sint:new Ce("rgba32sint",Ie.keyword,"rgba32sint"),rgba32float:new Ce("rgba32float",Ie.keyword,"rgba32float"),static_assert:new Ce("static_assert",Ie.keyword,"static_assert")};ie.tokens={decimal_float_literal:new Ce("decimal_float_literal",Ie.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new Ce("hex_float_literal",Ie.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new Ce("int_literal",Ie.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new Ce("uint_literal",Ie.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new Ce("ident",Ie.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new Ce("and",Ie.token,"&"),and_and:new Ce("and_and",Ie.token,"&&"),arrow:new Ce("arrow ",Ie.token,"->"),attr:new Ce("attr",Ie.token,"@"),forward_slash:new Ce("forward_slash",Ie.token,"/"),bang:new Ce("bang",Ie.token,"!"),bracket_left:new Ce("bracket_left",Ie.token,"["),bracket_right:new Ce("bracket_right",Ie.token,"]"),brace_left:new Ce("brace_left",Ie.token,"{"),brace_right:new Ce("brace_right",Ie.token,"}"),colon:new Ce("colon",Ie.token,":"),comma:new Ce("comma",Ie.token,","),equal:new Ce("equal",Ie.token,"="),equal_equal:new Ce("equal_equal",Ie.token,"=="),not_equal:new Ce("not_equal",Ie.token,"!="),greater_than:new Ce("greater_than",Ie.token,">"),greater_than_equal:new Ce("greater_than_equal",Ie.token,">="),shift_right:new Ce("shift_right",Ie.token,">>"),less_than:new Ce("less_than",Ie.token,"<"),less_than_equal:new Ce("less_than_equal",Ie.token,"<="),shift_left:new Ce("shift_left",Ie.token,"<<"),modulo:new Ce("modulo",Ie.token,"%"),minus:new Ce("minus",Ie.token,"-"),minus_minus:new Ce("minus_minus",Ie.token,"--"),period:new Ce("period",Ie.token,"."),plus:new Ce("plus",Ie.token,"+"),plus_plus:new Ce("plus_plus",Ie.token,"++"),or:new Ce("or",Ie.token,"|"),or_or:new Ce("or_or",Ie.token,"||"),paren_left:new Ce("paren_left",Ie.token,"("),paren_right:new Ce("paren_right",Ie.token,")"),semicolon:new Ce("semicolon",Ie.token,";"),star:new Ce("star",Ie.token,"*"),tilde:new Ce("tilde",Ie.token,"~"),underscore:new Ce("underscore",Ie.token,"_"),xor:new Ce("xor",Ie.token,"^"),plus_equal:new Ce("plus_equal",Ie.token,"+="),minus_equal:new Ce("minus_equal",Ie.token,"-="),times_equal:new Ce("times_equal",Ie.token,"*="),division_equal:new Ce("division_equal",Ie.token,"/="),modulo_equal:new Ce("modulo_equal",Ie.token,"%="),and_equal:new Ce("and_equal",Ie.token,"&="),or_equal:new Ce("or_equal",Ie.token,"|="),xor_equal:new Ce("xor_equal",Ie.token,"^="),shift_right_equal:new Ce("shift_right_equal",Ie.token,">>="),shift_left_equal:new Ce("shift_left_equal",Ie.token,"<<=")};ie.simpleTokens={"@":ke.tokens.attr,"{":ke.tokens.brace_left,"}":ke.tokens.brace_right,":":ke.tokens.colon,",":ke.tokens.comma,"(":ke.tokens.paren_left,")":ke.tokens.paren_right,";":ke.tokens.semicolon};ie.literalTokens={"&":ke.tokens.and,"&&":ke.tokens.and_and,"->":ke.tokens.arrow,"/":ke.tokens.forward_slash,"!":ke.tokens.bang,"[":ke.tokens.bracket_left,"]":ke.tokens.bracket_right,"=":ke.tokens.equal,"==":ke.tokens.equal_equal,"!=":ke.tokens.not_equal,">":ke.tokens.greater_than,">=":ke.tokens.greater_than_equal,">>":ke.tokens.shift_right,"<":ke.tokens.less_than,"<=":ke.tokens.less_than_equal,"<<":ke.tokens.shift_left,"%":ke.tokens.modulo,"-":ke.tokens.minus,"--":ke.tokens.minus_minus,".":ke.tokens.period,"+":ke.tokens.plus,"++":ke.tokens.plus_plus,"|":ke.tokens.or,"||":ke.tokens.or_or,"*":ke.tokens.star,"~":ke.tokens.tilde,_:ke.tokens.underscore,"^":ke.tokens.xor,"+=":ke.tokens.plus_equal,"-=":ke.tokens.minus_equal,"*=":ke.tokens.times_equal,"/=":ke.tokens.division_equal,"%=":ke.tokens.modulo_equal,"&=":ke.tokens.and_equal,"|=":ke.tokens.or_equal,"^=":ke.tokens.xor_equal,">>=":ke.tokens.shift_right_equal,"<<=":ke.tokens.shift_left_equal};ie.regexTokens={decimal_float_literal:ke.tokens.decimal_float_literal,hex_float_literal:ke.tokens.hex_float_literal,int_literal:ke.tokens.int_literal,uint_literal:ke.tokens.uint_literal,ident:ke.tokens.ident};ie.storage_class=[ke.keywords.function,ke.keywords.private,ke.keywords.workgroup,ke.keywords.uniform,ke.keywords.storage];ie.access_mode=[ke.keywords.read,ke.keywords.write,ke.keywords.read_write];ie.sampler_type=[ke.keywords.sampler,ke.keywords.sampler_comparison];ie.sampled_texture_type=[ke.keywords.texture_1d,ke.keywords.texture_2d,ke.keywords.texture_2d_array,ke.keywords.texture_3d,ke.keywords.texture_cube,ke.keywords.texture_cube_array];ie.multisampled_texture_type=[ke.keywords.texture_multisampled_2d];ie.storage_texture_type=[ke.keywords.texture_storage_1d,ke.keywords.texture_storage_2d,ke.keywords.texture_storage_2d_array,ke.keywords.texture_storage_3d];ie.depth_texture_type=[ke.keywords.texture_depth_2d,ke.keywords.texture_depth_2d_array,ke.keywords.texture_depth_cube,ke.keywords.texture_depth_cube_array,ke.keywords.texture_depth_multisampled_2d];ie.texture_external_type=[ke.keywords.texture_external];ie.any_texture_type=[...ke.sampled_texture_type,...ke.multisampled_texture_type,...ke.storage_texture_type,...ke.depth_texture_type,...ke.texture_external_type];ie.texel_format=[ke.keywords.r8unorm,ke.keywords.r8snorm,ke.keywords.r8uint,ke.keywords.r8sint,ke.keywords.r16uint,ke.keywords.r16sint,ke.keywords.r16float,ke.keywords.rg8unorm,ke.keywords.rg8snorm,ke.keywords.rg8uint,ke.keywords.rg8sint,ke.keywords.r32uint,ke.keywords.r32sint,ke.keywords.r32float,ke.keywords.rg16uint,ke.keywords.rg16sint,ke.keywords.rg16float,ke.keywords.rgba8unorm,ke.keywords.rgba8unorm_srgb,ke.keywords.rgba8snorm,ke.keywords.rgba8uint,ke.keywords.rgba8sint,ke.keywords.bgra8unorm,ke.keywords.bgra8unorm_srgb,ke.keywords.rgb10a2unorm,ke.keywords.rg11b10float,ke.keywords.rg32uint,ke.keywords.rg32sint,ke.keywords.rg32float,ke.keywords.rgba16uint,ke.keywords.rgba16sint,ke.keywords.rgba16float,ke.keywords.rgba32uint,ke.keywords.rgba32sint,ke.keywords.rgba32float];ie.const_literal=[ke.tokens.int_literal,ke.tokens.uint_literal,ke.tokens.decimal_float_literal,ke.tokens.hex_float_literal,ke.keywords.true,ke.keywords.false];ie.literal_or_ident=[ke.tokens.ident,ke.tokens.int_literal,ke.tokens.uint_literal,ke.tokens.decimal_float_literal,ke.tokens.hex_float_literal];ie.element_count_expression=[ke.tokens.int_literal,ke.tokens.uint_literal,ke.tokens.ident];ie.template_types=[ke.keywords.vec2,ke.keywords.vec3,ke.keywords.vec4,ke.keywords.mat2x2,ke.keywords.mat2x3,ke.keywords.mat2x4,ke.keywords.mat3x2,ke.keywords.mat3x3,ke.keywords.mat3x4,ke.keywords.mat4x2,ke.keywords.mat4x3,ke.keywords.mat4x4,ke.keywords.atomic,ke.keywords.bitcast,...ke.any_texture_type];ie.attribute_name=[ke.tokens.ident,ke.keywords.block,ke.keywords.diagnostic];ie.assignment_operators=[ke.tokens.equal,ke.tokens.plus_equal,ke.tokens.minus_equal,ke.tokens.times_equal,ke.tokens.division_equal,ke.tokens.modulo_equal,ke.tokens.and_equal,ke.tokens.or_equal,ke.tokens.xor_equal,ke.tokens.shift_right_equal,ke.tokens.shift_left_equal];ie.increment_operators=[ke.tokens.plus_plus,ke.tokens.minus_minus];class tI{constructor(e,i,s){this.type=e,this.lexeme=i,this.line=s}toString(){return this.lexeme}isTemplateType(){return ie.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==ie.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class nV{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new tI(ie.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==` `)return this._line++,!0;if(this._isWhitespace(e))return!0;if(e=="/"){if(this._peekAhead()=="/"){for(;e!=` `;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}else if(this._peekAhead()=="*"){this._advance();let u=1;for(;u>0;){if(this._isAtEnd())return!0;if(e=this._advance(),e==` -`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),u--,u==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),u++)}return!0}}const i=ie.simpleTokens[e];if(i)return this._addToken(i),!0;let s=ie.none;const n=this._isAlpha(e),a=e==="_";if(this._isAlphaNumeric(e)){let u=this._peekAhead();for(;this._isAlphaNumeric(u);)e+=this._advance(),u=this._peekAhead()}if(n){const u=ie.keywords[e];if(u)return this._addToken(u),!0}if(n||a)return this._addToken(ie.tokens.ident),!0;for(;;){let u=this._findType(e);const c=this._peekAhead();if(e==">"&&(c==">"||c=="=")){let _=!1,w=this._tokens.length-1;for(let S=0;S<5&&w>=0&&ie.assignment_operators.indexOf(this._tokens[w].type)===-1;++S,--w)if(this._tokens[w].type===ie.tokens.less_than){w>0&&this._tokens[w-1].isArrayOrTemplateType()&&(_=!0);break}if(_)return this._addToken(u),!0}if(u===ie.none){let _=e,w=0;const S=2;for(let C=0;C=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let i=this._source[this._current];return e=e||0,e++,this._current+=e,i}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const i=this._source.substring(this._start,this._current);this._tokens.push(new tI(e,i,this._line))}}class eV{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new E5,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const i=[];for(;!this._isAtEnd();){const s=this._global_decl_or_directive();if(!s)break;i.push(s)}if(this._deferArrayCountEval.length>0){for(const s of this._deferArrayCountEval){const n=s.arrayType,a=s.countNode;if(a instanceof yw){const c=a.name,_=this._context.constants.get(c);if(_)try{const w=_.evaluate(this._context);n.count=w}catch{}}}this._deferArrayCountEval.length=0}return i}_initialize(e){if(e)if(typeof e=="string"){const i=new Q5(e);this._tokens=i.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,i){return{token:e,message:i,toString:function(){return`${i}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==ie.eof}_match(e){if(e instanceof Ie)return this._check(e)?(this._advance(),!0):!1;for(let i=0,s=e.length;i'.");const n=this._paren_expression();return new $5(s,n)}const e=this._type_decl(),i=this._argument_expression_list();return new W5(e,i)}_argument_expression_list(){if(!this._match(ie.tokens.paren_left))return null;const e=[];do{if(this._check(ie.tokens.paren_right))break;const i=this._short_circuit_or_expression();e.push(i)}while(this._match(ie.tokens.comma));return this._consume(ie.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(ie.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(ie.tokens.paren_right),new eI([e])}_paren_expression(){this._consume(ie.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(ie.tokens.paren_right,"Expected ')'."),new eI([e])}_struct_decl(){if(!this._match(ie.keywords.struct))return null;const e=this._currentLine,i=this._consume(ie.tokens.ident,"Expected name for struct.").toString();this._consume(ie.tokens.brace_left,"Expected '{' for struct body.");const s=[];for(;!this._check(ie.tokens.brace_right);){const u=this._attribute(),c=this._consume(ie.tokens.ident,"Expected variable name.").toString();this._consume(ie.tokens.colon,"Expected ':' for struct member type.");const _=this._attribute(),w=this._type_decl();w!=null&&(w.attributes=_),this._check(ie.tokens.brace_right)?this._match(ie.tokens.comma):this._consume(ie.tokens.comma,"Expected ',' for struct member."),s.push(new J5(c,w,u))}this._consume(ie.tokens.brace_right,"Expected '}' after struct body.");const n=this._currentLine,a=new tu(i,s,e,n);return this._context.structs.set(i,a),a}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(ie.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(ie.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(ie.keywords.const))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const a=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=a)}let s=null;if(this._match(ie.tokens.equal)){const a=this._short_circuit_or_expression();if(a instanceof $h)s=a;else if(a instanceof G2&&a.initializer instanceof $h)s=a.initializer;else try{const u=a.evaluate(this._context);s=new Q2(u)}catch{s=a}}const n=new Y2(e.toString(),i,"","",s);return this._context.constants.set(n.name,n),n}_global_let_decl(){if(!this._match(ie.keywords.let))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const n=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=n)}let s=null;return this._match(ie.tokens.equal)&&(s=this._const_expression()),new _w(e.toString(),i,"","",s)}_const_expression(){if(this._match(ie.const_literal))return new J2(this._previous().toString());const e=this._type_decl();this._consume(ie.tokens.paren_left,"Expected '('.");let i=[];for(;!this._check(ie.tokens.paren_right)&&(i.push(this._const_expression()),!!this._check(ie.tokens.comma));)this._advance();return this._consume(ie.tokens.paren_right,"Expected ')'."),new $h(e,i)}_variable_decl(){if(!this._match(ie.keywords.var))return null;let e="",i="";this._match(ie.tokens.less_than)&&(e=this._consume(ie.storage_class,"Expected storage_class.").toString(),this._match(ie.tokens.comma)&&(i=this._consume(ie.access_mode,"Expected access_mode.").toString()),this._consume(ie.tokens.greater_than,"Expected '>'."));const s=this._consume(ie.tokens.ident,"Expected variable name");let n=null;if(this._match(ie.tokens.colon)){const a=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=a)}return new nu(s.toString(),n,e,i,null)}_override_decl(){if(!this._match(ie.keywords.override))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const s=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=s)}return new xM(e.toString(),i,null)}_diagnostic(){this._consume(ie.tokens.paren_left,"Expected '('");const e=this._consume(ie.tokens.ident,"Expected severity control name.");this._consume(ie.tokens.comma,"Expected ','");const i=this._consume(ie.tokens.ident,"Expected diagnostic rule name.");return this._consume(ie.tokens.paren_right,"Expected ')'"),new L5(e.toString(),i.toString())}_enable_directive(){const e=this._consume(ie.tokens.ident,"identity expected.");return new N5(e.toString())}_requires_directive(){const e=[this._consume(ie.tokens.ident,"identity expected.").toString()];for(;this._match(ie.tokens.comma);){const i=this._consume(ie.tokens.ident,"identity expected.");e.push(i.toString())}return new B5(e)}_type_alias(){const e=this._consume(ie.tokens.ident,"identity expected.");this._consume(ie.tokens.equal,"Expected '=' for type alias.");let i=this._type_decl();if(i===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(i.name)&&(i=this._context.aliases.get(i.name).type);const s=new TM(e.toString(),i);return this._context.aliases.set(s.name,s),s}_type_decl(){if(this._check([ie.tokens.ident,...ie.texel_format,ie.keywords.bool,ie.keywords.f32,ie.keywords.i32,ie.keywords.u32])){const s=this._advance(),n=s.toString();return this._context.structs.has(n)?this._context.structs.get(n):this._context.aliases.has(n)?this._context.aliases.get(n).type:new Ou(s.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(ie.template_types)){let s=this._advance().toString(),n=null,a=null;return this._match(ie.tokens.less_than)&&(n=this._type_decl(),a=null,this._match(ie.tokens.comma)&&(a=this._consume(ie.access_mode,"Expected access_mode for pointer").toString()),this._consume(ie.tokens.greater_than,"Expected '>' for type.")),new SM(s,n,a)}if(this._match(ie.keywords.ptr)){let s=this._previous().toString();this._consume(ie.tokens.less_than,"Expected '<' for pointer.");const n=this._consume(ie.storage_class,"Expected storage_class for pointer");this._consume(ie.tokens.comma,"Expected ',' for pointer.");const a=this._type_decl();let u=null;return this._match(ie.tokens.comma)&&(u=this._consume(ie.access_mode,"Expected access_mode for pointer").toString()),this._consume(ie.tokens.greater_than,"Expected '>' for pointer."),new j5(s,n.toString(),a,u)}const i=this._attribute();if(this._match(ie.keywords.array)){let s=null,n=-1;const a=this._previous();let u=null;if(this._match(ie.tokens.less_than)){s=this._type_decl(),this._context.aliases.has(s.name)&&(s=this._context.aliases.get(s.name).type);let _="";if(this._match(ie.tokens.comma)){u=this._shift_expression();try{_=u.evaluate(this._context).toString(),u=null}catch{_="1"}}this._consume(ie.tokens.greater_than,"Expected '>' for array."),n=_?parseInt(_):0}const c=new EM(a.toString(),i,s,n);return u&&this._deferArrayCountEval.push({arrayType:c,countNode:u}),c}return null}_texture_sampler_types(){if(this._match(ie.sampler_type))return new Cp(this._previous().toString(),null,null);if(this._match(ie.depth_texture_type))return new Cp(this._previous().toString(),null,null);if(this._match(ie.sampled_texture_type)||this._match(ie.multisampled_texture_type)){const e=this._previous();this._consume(ie.tokens.less_than,"Expected '<' for sampler type.");const i=this._type_decl();return this._consume(ie.tokens.greater_than,"Expected '>' for sampler type."),new Cp(e.toString(),i,null)}if(this._match(ie.storage_texture_type)){const e=this._previous();this._consume(ie.tokens.less_than,"Expected '<' for sampler type.");const i=this._consume(ie.texel_format,"Invalid texel format.").toString();this._consume(ie.tokens.comma,"Expected ',' after texel format.");const s=this._consume(ie.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(ie.tokens.greater_than,"Expected '>' for sampler type."),new Cp(e.toString(),i,s)}return null}_attribute(){let e=[];for(;this._match(ie.tokens.attr);){const i=this._consume(ie.attribute_name,"Expected attribute name"),s=new G5(i.toString(),null);if(this._match(ie.tokens.paren_left)){if(s.value=this._consume(ie.literal_or_ident,"Expected attribute value").toString(),this._check(ie.tokens.comma)){this._advance();do{const n=this._consume(ie.literal_or_ident,"Expected attribute value").toString();s.value instanceof Array||(s.value=[s.value]),s.value.push(n)}while(this._match(ie.tokens.comma))}this._consume(ie.tokens.paren_right,"Expected ')'")}e.push(s)}return e.length==0?null:e}}class cd{constructor(e,i){this.name=e,this.attributes=i,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class iI{constructor(e,i,s){this.name=e,this.type=i,this.attributes=s,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class d_ extends cd{constructor(e,i){super(e,i),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class ix extends cd{constructor(e,i){super(e,i),this.count=0,this.stride=0}get isArray(){return!0}}class sI extends cd{constructor(e,i,s,n){super(e,s),this.format=i,this.access=n}get isTemplate(){return!0}}var Ll;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Ll||(Ll={}));class f_{constructor(e,i,s,n,a,u,c){this.name=e,this.type=i,this.group=s,this.binding=n,this.attributes=a,this.resourceType=u,this.access=c}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class tV{constructor(e,i){this.name=e,this.type=i}}class p_{constructor(e,i){this.align=e,this.size=i}}class iV{constructor(e,i,s,n){this.name=e,this.type=i,this.locationType=s,this.location=n,this.interpolation=null}}class nI{constructor(e,i,s,n){this.name=e,this.type=i,this.locationType=s,this.location=n}}class sV{constructor(e,i=null){this.stage=null,this.inputs=[],this.outputs=[],this.resources=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=i}}class nV{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class rV{constructor(e,i,s,n){this.name=e,this.type=i,this.attributes=s,this.id=n}}class oV{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Xa{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new nV,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const s=new eV().parse(e);for(const n of s)n instanceof gw&&this._functions.set(n.name,new oV(n));for(const n of s)if(n instanceof tu){const a=this._getTypeInfo(n,null);a instanceof d_&&this.structs.push(a)}for(const n of s){if(n instanceof TM){this.aliases.push(this._getAliasInfo(n));continue}if(n instanceof xM){const a=n,u=this._getAttributeNum(a.attributes,"id",0),c=a.type!=null?this._getTypeInfo(a.type,a.attributes):null;this.overrides.push(new rV(a.name,c,a.attributes,u));continue}if(this._isUniformVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=new f_(a.name,_,u,c,a.attributes,Ll.Uniform,a.access);this.uniforms.push(w);continue}if(this._isStorageVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=this._isStorageTexture(_),S=new f_(a.name,_,u,c,a.attributes,w?Ll.StorageTexture:Ll.Storage,a.access);this.storage.push(S);continue}if(this._isTextureVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=this._isStorageTexture(_),S=new f_(a.name,_,u,c,a.attributes,w?Ll.StorageTexture:Ll.Texture,a.access);w?this.storage.push(S):this.textures.push(S);continue}if(this._isSamplerVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=new f_(a.name,_,u,c,a.attributes,Ll.Sampler,a.access);this.samplers.push(w);continue}if(n instanceof gw){const a=this._getAttribute(n,"vertex"),u=this._getAttribute(n,"fragment"),c=this._getAttribute(n,"compute"),_=a||u||c,w=new sV(n.name,_==null?void 0:_.name);w.startLine=n.startLine,w.endLine=n.endLine,this.functions.push(w),this._functions.get(n.name).info=w,_&&(this._functions.get(n.name).inUse=!0,w.inUse=!0,w.resources=this._findResources(n,!!_),w.inputs=this._getInputs(n.args),w.outputs=this._getOutputs(n.returnType),this.entry[_.name].push(w));continue}}for(const n of this._functions.values())n.info&&(n.info.inUse=n.inUse,this._addCalls(n.node,n.info.calls));for(const n of this.uniforms)this._markStructsInUse(n.type);for(const n of this.storage)this._markStructsInUse(n.type)}_markStructsInUse(e){if(e.isStruct){e.inUse=!0;for(const i of e.members)this._markStructsInUse(i.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)this._markStructsInUse(e.format);else{const i=this._getAlias(e.name);i&&this._markStructsInUse(i)}}_addCalls(e,i){var s;for(const n of e.calls){const a=(s=this._functions.get(n.name))===null||s===void 0?void 0:s.info;a&&i.add(a)}}findResource(e,i){for(const s of this.uniforms)if(s.group==e&&s.binding==i)return s;for(const s of this.storage)if(s.group==e&&s.binding==i)return s;for(const s of this.textures)if(s.group==e&&s.binding==i)return s;for(const s of this.samplers)if(s.group==e&&s.binding==i)return s;return null}_findResource(e){for(const i of this.uniforms)if(i.name==e)return i;for(const i of this.storage)if(i.name==e)return i;for(const i of this.textures)if(i.name==e)return i;for(const i of this.samplers)if(i.name==e)return i;return null}_markStructsFromAST(e){const i=this._getTypeInfo(e,null);this._markStructsInUse(i)}_findResources(e,i){const s=[],n=this,a=[];return e.search(u=>{if(u instanceof my)a.push({});else if(u instanceof gy)a.pop();else if(u instanceof nu){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type),a.length>0&&(a[a.length-1][c.name]=c)}else if(u instanceof $h){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type)}else if(u instanceof _w){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type),a.length>0&&(a[a.length-1][c.name]=c)}else if(u instanceof yw){const c=u;if(a.length>0&&a[a.length-1][c.name])return;const _=n._findResource(c.name);_&&s.push(_)}else if(u instanceof AM){const c=u,_=n._functions.get(c.name);_&&(i&&(_.inUse=!0),e.calls.add(_.node),_.resources===null&&(_.resources=n._findResources(_.node,i)),s.push(..._.resources))}else if(u instanceof wM){const c=u,_=n._functions.get(c.name);_&&(i&&(_.inUse=!0),e.calls.add(_.node),_.resources===null&&(_.resources=n._findResources(_.node,i)),s.push(..._.resources))}}),[...new Map(s.map(u=>[u.name,u])).values()]}getBindGroups(){const e=[];function i(s,n){s>=e.length&&(e.length=s+1),e[s]===void 0&&(e[s]=[]),n>=e[s].length&&(e[s].length=n+1)}for(const s of this.uniforms){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.storage){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.textures){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.samplers){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}return e}_getOutputs(e,i=void 0){if(i===void 0&&(i=[]),e instanceof tu)this._getStructOutputs(e,i);else{const s=this._getOutputInfo(e);s!==null&&i.push(s)}return i}_getStructOutputs(e,i){for(const s of e.members)if(s.type instanceof tu)this._getStructOutputs(s.type,i);else{const n=this._getAttribute(s,"location")||this._getAttribute(s,"builtin");if(n!==null){const a=this._getTypeInfo(s.type,s.type.attributes),u=this._parseInt(n.value),c=new nI(s.name,a,n.name,u);i.push(c)}}}_getOutputInfo(e){const i=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(i!==null){const s=this._getTypeInfo(e,e.attributes),n=this._parseInt(i.value);return new nI("",s,i.name,n)}return null}_getInputs(e,i=void 0){i===void 0&&(i=[]);for(const s of e)if(s.type instanceof tu)this._getStructInputs(s.type,i);else{const n=this._getInputInfo(s);n!==null&&i.push(n)}return i}_getStructInputs(e,i){for(const s of e.members)if(s.type instanceof tu)this._getStructInputs(s.type,i);else{const n=this._getInputInfo(s);n!==null&&i.push(n)}}_getInputInfo(e){const i=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(i!==null){const s=this._getAttribute(e,"interpolation"),n=this._getTypeInfo(e.type,e.attributes),a=this._parseInt(i.value),u=new iV(e.name,n,i.name,a);return s!==null&&(u.interpolation=this._parseString(s.value)),u}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const i=parseInt(e);return isNaN(i)?e:i}_getAlias(e){for(const i of this.aliases)if(i.name==e)return i.type;return null}_getAliasInfo(e){return new tV(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,i){if(this._types.has(e))return this._types.get(e);if(e instanceof EM){const n=e,a=this._getTypeInfo(n.format,n.attributes),u=new ix(n.name,i);return u.format=a,u.count=n.count,this._types.set(e,u),this._updateTypeInfo(u),u}if(e instanceof tu){const n=e,a=new d_(n.name,i);a.startLine=n.startLine,a.endLine=n.endLine;for(const u of n.members){const c=this._getTypeInfo(u.type,u.attributes);a.members.push(new iI(u.name,c,u.attributes))}return this._types.set(e,a),this._updateTypeInfo(a),a}if(e instanceof Cp){const n=e,a=n.format instanceof Ou,u=n.format?a?this._getTypeInfo(n.format,null):new cd(n.format,null):null,c=new sI(n.name,u,i,n.access);return this._types.set(e,c),this._updateTypeInfo(c),c}if(e instanceof SM){const n=e,a=n.format?this._getTypeInfo(n.format,null):null,u=new sI(n.name,a,i,n.access);return this._types.set(e,u),this._updateTypeInfo(u),u}const s=new cd(e.name,i);return this._types.set(e,s),this._updateTypeInfo(s),s}_updateTypeInfo(e){var i,s;const n=this._getTypeSize(e);if(e.size=(i=n==null?void 0:n.size)!==null&&i!==void 0?i:0,e instanceof ix){const a=this._getTypeSize(e.format);e.stride=(s=a==null?void 0:a.size)!==null&&s!==void 0?s:0,this._updateTypeInfo(e.format)}e instanceof d_&&this._updateStructInfo(e)}_updateStructInfo(e){var i;let s=0,n=0,a=0,u=0;for(let c=0,_=e.members.length;c<_;++c){const w=e.members[c],S=this._getTypeSize(w);if(!S)continue;(i=this._getAlias(w.type.name))!==null&&i!==void 0||w.type;const C=S.align,P=S.size;s=this._roundUp(C,s+n),n=P,a=s,u=Math.max(u,C),w.offset=s,w.size=P,this._updateTypeInfo(w.type)}e.size=this._roundUp(u,a+n),e.align=u}_getTypeSize(e){var i;if(e==null)return null;const s=this._getAttributeNum(e.attributes,"size",0),n=this._getAttributeNum(e.attributes,"align",0);if(e instanceof iI&&(e=e.type),e instanceof cd){const a=this._getAlias(e.name);a!==null&&(e=a)}{const a=Xa._typeInfo[e.name];if(a!==void 0){const u=e.format==="f16"?2:1;return new p_(Math.max(n,a.align/u),Math.max(s,a.size/u))}}{const a=Xa._typeInfo[e.name.substring(0,e.name.length-1)];if(a){const u=e.name[e.name.length-1]==="h"?2:1;return new p_(Math.max(n,a.align/u),Math.max(s,a.size/u))}}if(e instanceof ix){let a=e,u=8,c=8;const _=this._getTypeSize(a.format);_!==null&&(c=_.size,u=_.align);const w=a.count,S=this._getAttributeNum((i=e==null?void 0:e.attributes)!==null&&i!==void 0?i:null,"stride",this._roundUp(u,c));return c=w*S,s&&(c=s),new p_(Math.max(n,u),Math.max(s,c))}if(e instanceof d_){let a=0,u=0,c=0,_=0,w=0;for(const S of e.members){const C=this._getTypeSize(S.type);C!==null&&(a=Math.max(C.align,a),c=this._roundUp(C.align,c+_),_=C.size,w=c)}return u=this._roundUp(a,w+_),new p_(Math.max(n,a),Math.max(s,u))}return null}_isUniformVar(e){return e instanceof nu&&e.storage=="uniform"}_isStorageVar(e){return e instanceof nu&&e.storage=="storage"}_isTextureVar(e){return e instanceof nu&&e.type!==null&&Xa._textureTypes.indexOf(e.type.name)!=-1}_isSamplerVar(e){return e instanceof nu&&e.type!==null&&Xa._samplerTypes.indexOf(e.type.name)!=-1}_getAttribute(e,i){const s=e;if(!s||!s.attributes)return null;const n=s.attributes;for(let a of n)if(a.name==i)return a;return null}_getAttributeNum(e,i,s){if(e===null)return s;for(let n of e)if(n.name==i){let a=n!==null&&n.value!==null?n.value:s;return a instanceof Array&&(a=a[0]),typeof a=="number"?a:typeof a=="string"?parseInt(a):s}return s}_roundUp(e,i){return Math.ceil(i/e)*e}}Xa._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}};Xa._textureTypes=ie.any_texture_type.map(t=>t.name);Xa._samplerTypes=ie.sampler_type.map(t=>t.name);function aV(t){var a;const e={attributes:[],bindings:[]};let i;try{i=lV(t)}catch(u){return lt.error(u.message)(),e}for(const u of i.uniforms){const c=[];for(const _ of((a=u.type)==null?void 0:a.members)||[])c.push({name:_.name,type:rI(_.type)});e.bindings.push({type:"uniform",name:u.name,location:u.binding,group:u.group,members:c})}const s=i.entry.vertex[0],n=(s==null?void 0:s.inputs.length)||0;for(let u=0;u`:t.name}function lV(t){try{return new Xa(t)}catch(e){if(e instanceof Error)throw e;let i="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(i+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(i+=e.token.line||""),new Error(i,{cause:e})}}const cV=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND +`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),u--,u==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),u++)}return!0}}const i=ie.simpleTokens[e];if(i)return this._addToken(i),!0;let s=ie.none;const n=this._isAlpha(e),a=e==="_";if(this._isAlphaNumeric(e)){let u=this._peekAhead();for(;this._isAlphaNumeric(u);)e+=this._advance(),u=this._peekAhead()}if(n){const u=ie.keywords[e];if(u)return this._addToken(u),!0}if(n||a)return this._addToken(ie.tokens.ident),!0;for(;;){let u=this._findType(e);const c=this._peekAhead();if(e=="-"&&this._tokens.length>0){if(c=="=")return this._current++,e+=c,this._addToken(ie.tokens.minus_equal),!0;if(c=="-")return this._current++,e+=c,this._addToken(ie.tokens.minus_minus),!0;const _=this._tokens.length-1;if((ie.literal_or_ident.indexOf(this._tokens[_].type)!=-1||this._tokens[_].type==ie.tokens.paren_right)&&c!=">")return this._addToken(u),!0}if(e==">"&&(c==">"||c=="=")){let _=!1,w=this._tokens.length-1;for(let S=0;S<5&&w>=0&&ie.assignment_operators.indexOf(this._tokens[w].type)===-1;++S,--w)if(this._tokens[w].type===ie.tokens.less_than){w>0&&this._tokens[w-1].isArrayOrTemplateType()&&(_=!0);break}if(_)return this._addToken(u),!0}if(u===ie.none){let _=e,w=0;const S=2;for(let A=0;A=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let i=this._source[this._current];return e=e||0,e++,this._current+=e,i}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const i=this._source.substring(this._start,this._current);this._tokens.push(new tI(e,i,this._line))}}class rV{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new M5,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const i=[];for(;!this._isAtEnd();){const s=this._global_decl_or_directive();if(!s)break;i.push(s)}if(this._deferArrayCountEval.length>0){for(const s of this._deferArrayCountEval){const n=s.arrayType,a=s.countNode;if(a instanceof Iw){const c=a.name,_=this._context.constants.get(c);if(_)try{const w=_.evaluate(this._context);n.count=w}catch{}}}this._deferArrayCountEval.length=0}return i}_initialize(e){if(e)if(typeof e=="string"){const i=new nV(e);this._tokens=i.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,i){return{token:e,message:i,toString:function(){return`${i}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==ie.eof}_match(e){if(e instanceof Ce)return this._check(e)?(this._advance(),!0):!1;for(let i=0,s=e.length;i'.");const n=this._paren_expression();return new Y5(s,n)}const e=this._type_decl(),i=this._argument_expression_list();return new lf(e,i)}_argument_expression_list(){if(!this._match(ie.tokens.paren_left))return null;const e=[];do{if(this._check(ie.tokens.paren_right))break;const i=this._short_circuit_or_expression();e.push(i)}while(this._match(ie.tokens.comma));return this._consume(ie.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(ie.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(ie.tokens.paren_right),new eI([e])}_paren_expression(){this._consume(ie.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(ie.tokens.paren_right,"Expected ')'."),new eI([e])}_struct_decl(){if(!this._match(ie.keywords.struct))return null;const e=this._currentLine,i=this._consume(ie.tokens.ident,"Expected name for struct.").toString();this._consume(ie.tokens.brace_left,"Expected '{' for struct body.");const s=[];for(;!this._check(ie.tokens.brace_right);){const u=this._attribute(),c=this._consume(ie.tokens.ident,"Expected variable name.").toString();this._consume(ie.tokens.colon,"Expected ':' for struct member type.");const _=this._attribute(),w=this._type_decl();w!=null&&(w.attributes=_),this._check(ie.tokens.brace_right)?this._match(ie.tokens.comma):this._consume(ie.tokens.comma,"Expected ',' for struct member."),s.push(new iV(c,w,u))}this._consume(ie.tokens.brace_right,"Expected '}' after struct body.");const n=this._currentLine,a=new fu(i,s,e,n);return this._context.structs.set(i,a),a}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(ie.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(ie.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(ie.keywords.const))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const a=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=a)}let s=null;if(this._match(ie.tokens.equal)){const a=this._short_circuit_or_expression();if(a instanceof lf)s=a;else if(a instanceof G2&&a.initializer instanceof lf)s=a.initializer;else try{const u=a.evaluate(this._context);s=new Q2(u)}catch{s=a}}const n=new J2(e.toString(),i,"","",s);return this._context.constants.set(n.name,n),n}_global_let_decl(){if(!this._match(ie.keywords.let))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const n=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=n)}let s=null;return this._match(ie.tokens.equal)&&(s=this._const_expression()),new Aw(e.toString(),i,"","",s)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(ie.keywords.var))return null;let e="",i="";this._match(ie.tokens.less_than)&&(e=this._consume(ie.storage_class,"Expected storage_class.").toString(),this._match(ie.tokens.comma)&&(i=this._consume(ie.access_mode,"Expected access_mode.").toString()),this._consume(ie.tokens.greater_than,"Expected '>'."));const s=this._consume(ie.tokens.ident,"Expected variable name");let n=null;if(this._match(ie.tokens.colon)){const a=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=a)}return new pu(s.toString(),n,e,i,null)}_override_decl(){if(!this._match(ie.keywords.override))return null;const e=this._consume(ie.tokens.ident,"Expected variable name");let i=null;if(this._match(ie.tokens.colon)){const s=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=s)}return new SR(e.toString(),i,null)}_diagnostic(){this._consume(ie.tokens.paren_left,"Expected '('");const e=this._consume(ie.tokens.ident,"Expected severity control name.");this._consume(ie.tokens.comma,"Expected ','");const i=this._consume(ie.tokens.ident,"Expected diagnostic rule name.");return this._consume(ie.tokens.paren_right,"Expected ')'"),new $5(e.toString(),i.toString())}_enable_directive(){const e=this._consume(ie.tokens.ident,"identity expected.");return new V5(e.toString())}_requires_directive(){const e=[this._consume(ie.tokens.ident,"identity expected.").toString()];for(;this._match(ie.tokens.comma);){const i=this._consume(ie.tokens.ident,"identity expected.");e.push(i.toString())}return new j5(e)}_type_alias(){const e=this._consume(ie.tokens.ident,"identity expected.");this._consume(ie.tokens.equal,"Expected '=' for type alias.");let i=this._type_decl();if(i===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(i.name)&&(i=this._context.aliases.get(i.name).type);const s=new AR(e.toString(),i);return this._context.aliases.set(s.name,s),s}_type_decl(){if(this._check([ie.tokens.ident,...ie.texel_format,ie.keywords.bool,ie.keywords.f32,ie.keywords.i32,ie.keywords.u32])){const s=this._advance(),n=s.toString();return this._context.structs.has(n)?this._context.structs.get(n):this._context.aliases.has(n)?this._context.aliases.get(n).type:new Hu(s.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(ie.template_types)){let s=this._advance().toString(),n=null,a=null;return this._match(ie.tokens.less_than)&&(n=this._type_decl(),a=null,this._match(ie.tokens.comma)&&(a=this._consume(ie.access_mode,"Expected access_mode for pointer").toString()),this._consume(ie.tokens.greater_than,"Expected '>' for type.")),new IR(s,n,a)}if(this._match(ie.keywords.ptr)){let s=this._previous().toString();this._consume(ie.tokens.less_than,"Expected '<' for pointer.");const n=this._consume(ie.storage_class,"Expected storage_class for pointer");this._consume(ie.tokens.comma,"Expected ',' for pointer.");const a=this._type_decl();let u=null;return this._match(ie.tokens.comma)&&(u=this._consume(ie.access_mode,"Expected access_mode for pointer").toString()),this._consume(ie.tokens.greater_than,"Expected '>' for pointer."),new X5(s,n.toString(),a,u)}const i=this._attribute();if(this._match(ie.keywords.array)){let s=null,n=-1;const a=this._previous();let u=null;if(this._match(ie.tokens.less_than)){s=this._type_decl(),this._context.aliases.has(s.name)&&(s=this._context.aliases.get(s.name).type);let _="";if(this._match(ie.tokens.comma)){u=this._shift_expression();try{_=u.evaluate(this._context).toString(),u=null}catch{_="1"}}this._consume(ie.tokens.greater_than,"Expected '>' for array."),n=_?parseInt(_):0}const c=new CR(a.toString(),i,s,n);return u&&this._deferArrayCountEval.push({arrayType:c,countNode:u}),c}return null}_texture_sampler_types(){if(this._match(ie.sampler_type))return new Bp(this._previous().toString(),null,null);if(this._match(ie.depth_texture_type))return new Bp(this._previous().toString(),null,null);if(this._match(ie.sampled_texture_type)||this._match(ie.multisampled_texture_type)){const e=this._previous();this._consume(ie.tokens.less_than,"Expected '<' for sampler type.");const i=this._type_decl();return this._consume(ie.tokens.greater_than,"Expected '>' for sampler type."),new Bp(e.toString(),i,null)}if(this._match(ie.storage_texture_type)){const e=this._previous();this._consume(ie.tokens.less_than,"Expected '<' for sampler type.");const i=this._consume(ie.texel_format,"Invalid texel format.").toString();this._consume(ie.tokens.comma,"Expected ',' after texel format.");const s=this._consume(ie.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(ie.tokens.greater_than,"Expected '>' for sampler type."),new Bp(e.toString(),i,s)}return null}_attribute(){let e=[];for(;this._match(ie.tokens.attr);){const i=this._consume(ie.attribute_name,"Expected attribute name"),s=new sV(i.toString(),null);if(this._match(ie.tokens.paren_left)){if(s.value=this._consume(ie.literal_or_ident,"Expected attribute value").toString(),this._check(ie.tokens.comma)){this._advance();do{const n=this._consume(ie.literal_or_ident,"Expected attribute value").toString();s.value instanceof Array||(s.value=[s.value]),s.value.push(n)}while(this._match(ie.tokens.comma))}this._consume(ie.tokens.paren_right,"Expected ')'")}e.push(s)}return e.length==0?null:e}}class Pf{constructor(e,i){this.name=e,this.attributes=i,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class iI{constructor(e,i,s){this.name=e,this.type=i,this.attributes=s,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class m_ extends Pf{constructor(e,i){super(e,i),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class ux extends Pf{constructor(e,i){super(e,i),this.count=0,this.stride=0}get isArray(){return!0}}class sI extends Pf{constructor(e,i,s,n){super(e,s),this.format=i,this.access=n}get isTemplate(){return!0}}var Jl;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Jl||(Jl={}));class __{constructor(e,i,s,n,a,u,c){this.name=e,this.type=i,this.group=s,this.binding=n,this.attributes=a,this.resourceType=u,this.access=c}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class oV{constructor(e,i){this.name=e,this.type=i}}class y_{constructor(e,i){this.align=e,this.size=i}}class aV{constructor(e,i,s,n){this.name=e,this.type=i,this.locationType=s,this.location=n,this.interpolation=null}}class nI{constructor(e,i,s,n){this.name=e,this.type=i,this.locationType=s,this.location=n}}class lV{constructor(e,i,s,n){this.name=e,this.type=i,this.attributes=s,this.id=n}}class cV{constructor(e,i=null){this.stage=null,this.inputs=[],this.outputs=[],this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=i}}class uV{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class hV{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Ja{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new uV,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const s=new rV().parse(e);for(const n of s)n instanceof Ew&&this._functions.set(n.name,new hV(n));for(const n of s)if(n instanceof fu){const a=this._getTypeInfo(n,null);a instanceof m_&&this.structs.push(a)}for(const n of s){if(n instanceof AR){this.aliases.push(this._getAliasInfo(n));continue}if(n instanceof SR){const a=n,u=this._getAttributeNum(a.attributes,"id",0),c=a.type!=null?this._getTypeInfo(a.type,a.attributes):null;this.overrides.push(new lV(a.name,c,a.attributes,u));continue}if(this._isUniformVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=new __(a.name,_,u,c,a.attributes,Jl.Uniform,a.access);this.uniforms.push(w);continue}if(this._isStorageVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=this._isStorageTexture(_),S=new __(a.name,_,u,c,a.attributes,w?Jl.StorageTexture:Jl.Storage,a.access);this.storage.push(S);continue}if(this._isTextureVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=this._isStorageTexture(_),S=new __(a.name,_,u,c,a.attributes,w?Jl.StorageTexture:Jl.Texture,a.access);w?this.storage.push(S):this.textures.push(S);continue}if(this._isSamplerVar(n)){const a=n,u=this._getAttributeNum(a.attributes,"group",0),c=this._getAttributeNum(a.attributes,"binding",0),_=this._getTypeInfo(a.type,a.attributes),w=new __(a.name,_,u,c,a.attributes,Jl.Sampler,a.access);this.samplers.push(w);continue}if(n instanceof Ew){const a=this._getAttribute(n,"vertex"),u=this._getAttribute(n,"fragment"),c=this._getAttribute(n,"compute"),_=a||u||c,w=new cV(n.name,_==null?void 0:_.name);w.startLine=n.startLine,w.endLine=n.endLine,this.functions.push(w),this._functions.get(n.name).info=w,_&&(this._functions.get(n.name).inUse=!0,w.inUse=!0,w.resources=this._findResources(n,!!_),w.inputs=this._getInputs(n.args),w.outputs=this._getOutputs(n.returnType),this.entry[_.name].push(w));continue}}for(const n of this._functions.values())n.info&&(n.info.inUse=n.inUse,this._addCalls(n.node,n.info.calls));for(const n of this._functions.values())n.node.search(a=>{var u;if(a.astNodeType==="varExpr"){const c=a;for(const _ of this.overrides)c.name==_.name&&((u=n.info)===null||u===void 0||u.overrides.push(_))}});for(const n of this.uniforms)this._markStructsInUse(n.type);for(const n of this.storage)this._markStructsInUse(n.type)}_markStructsInUse(e){if(e)if(e.isStruct){if(e.inUse=!0,e.members)for(const i of e.members)this._markStructsInUse(i.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)e.format&&this._markStructsInUse(e.format);else{const i=this._getAlias(e.name);i&&this._markStructsInUse(i)}}_addCalls(e,i){var s;for(const n of e.calls){const a=(s=this._functions.get(n.name))===null||s===void 0?void 0:s.info;a&&i.add(a)}}findResource(e,i){for(const s of this.uniforms)if(s.group==e&&s.binding==i)return s;for(const s of this.storage)if(s.group==e&&s.binding==i)return s;for(const s of this.textures)if(s.group==e&&s.binding==i)return s;for(const s of this.samplers)if(s.group==e&&s.binding==i)return s;return null}_findResource(e){for(const i of this.uniforms)if(i.name==e)return i;for(const i of this.storage)if(i.name==e)return i;for(const i of this.textures)if(i.name==e)return i;for(const i of this.samplers)if(i.name==e)return i;return null}_markStructsFromAST(e){const i=this._getTypeInfo(e,null);this._markStructsInUse(i)}_findResources(e,i){const s=[],n=this,a=[];return e.search(u=>{if(u instanceof xy)a.push({});else if(u instanceof wy)a.pop();else if(u instanceof pu){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type),a.length>0&&(a[a.length-1][c.name]=c)}else if(u instanceof lf){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type)}else if(u instanceof Aw){const c=u;i&&c.type!==null&&this._markStructsFromAST(c.type),a.length>0&&(a[a.length-1][c.name]=c)}else if(u instanceof Iw){const c=u;if(a.length>0&&a[a.length-1][c.name])return;const _=n._findResource(c.name);_&&s.push(_)}else if(u instanceof PR){const c=u,_=n._functions.get(c.name);_&&(i&&(_.inUse=!0),e.calls.add(_.node),_.resources===null&&(_.resources=n._findResources(_.node,i)),s.push(..._.resources))}else if(u instanceof ER){const c=u,_=n._functions.get(c.name);_&&(i&&(_.inUse=!0),e.calls.add(_.node),_.resources===null&&(_.resources=n._findResources(_.node,i)),s.push(..._.resources))}}),[...new Map(s.map(u=>[u.name,u])).values()]}getBindGroups(){const e=[];function i(s,n){s>=e.length&&(e.length=s+1),e[s]===void 0&&(e[s]=[]),n>=e[s].length&&(e[s].length=n+1)}for(const s of this.uniforms){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.storage){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.textures){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}for(const s of this.samplers){i(s.group,s.binding);const n=e[s.group];n[s.binding]=s}return e}_getOutputs(e,i=void 0){if(i===void 0&&(i=[]),e instanceof fu)this._getStructOutputs(e,i);else{const s=this._getOutputInfo(e);s!==null&&i.push(s)}return i}_getStructOutputs(e,i){for(const s of e.members)if(s.type instanceof fu)this._getStructOutputs(s.type,i);else{const n=this._getAttribute(s,"location")||this._getAttribute(s,"builtin");if(n!==null){const a=this._getTypeInfo(s.type,s.type.attributes),u=this._parseInt(n.value),c=new nI(s.name,a,n.name,u);i.push(c)}}}_getOutputInfo(e){const i=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(i!==null){const s=this._getTypeInfo(e,e.attributes),n=this._parseInt(i.value);return new nI("",s,i.name,n)}return null}_getInputs(e,i=void 0){i===void 0&&(i=[]);for(const s of e)if(s.type instanceof fu)this._getStructInputs(s.type,i);else{const n=this._getInputInfo(s);n!==null&&i.push(n)}return i}_getStructInputs(e,i){for(const s of e.members)if(s.type instanceof fu)this._getStructInputs(s.type,i);else{const n=this._getInputInfo(s);n!==null&&i.push(n)}}_getInputInfo(e){const i=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(i!==null){const s=this._getAttribute(e,"interpolation"),n=this._getTypeInfo(e.type,e.attributes),a=this._parseInt(i.value),u=new aV(e.name,n,i.name,a);return s!==null&&(u.interpolation=this._parseString(s.value)),u}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const i=parseInt(e);return isNaN(i)?e:i}_getAlias(e){for(const i of this.aliases)if(i.name==e)return i.type;return null}_getAliasInfo(e){return new oV(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,i){if(this._types.has(e))return this._types.get(e);if(e instanceof CR){const n=e,a=n.format?this._getTypeInfo(n.format,n.attributes):null,u=new ux(n.name,i);return u.format=a,u.count=n.count,this._types.set(e,u),this._updateTypeInfo(u),u}if(e instanceof fu){const n=e,a=new m_(n.name,i);a.startLine=n.startLine,a.endLine=n.endLine;for(const u of n.members){const c=this._getTypeInfo(u.type,u.attributes);a.members.push(new iI(u.name,c,u.attributes))}return this._types.set(e,a),this._updateTypeInfo(a),a}if(e instanceof Bp){const n=e,a=n.format instanceof Hu,u=n.format?a?this._getTypeInfo(n.format,null):new Pf(n.format,null):null,c=new sI(n.name,u,i,n.access);return this._types.set(e,c),this._updateTypeInfo(c),c}if(e instanceof IR){const n=e,a=n.format?this._getTypeInfo(n.format,null):null,u=new sI(n.name,a,i,n.access);return this._types.set(e,u),this._updateTypeInfo(u),u}const s=new Pf(e.name,i);return this._types.set(e,s),this._updateTypeInfo(s),s}_updateTypeInfo(e){var i,s;const n=this._getTypeSize(e);if(e.size=(i=n==null?void 0:n.size)!==null&&i!==void 0?i:0,e instanceof ux&&e.format){const a=this._getTypeSize(e.format);e.stride=(s=a==null?void 0:a.size)!==null&&s!==void 0?s:0,this._updateTypeInfo(e.format)}e instanceof m_&&this._updateStructInfo(e)}_updateStructInfo(e){var i;let s=0,n=0,a=0,u=0;for(let c=0,_=e.members.length;c<_;++c){const w=e.members[c],S=this._getTypeSize(w);if(!S)continue;(i=this._getAlias(w.type.name))!==null&&i!==void 0||w.type;const A=S.align,P=S.size;s=this._roundUp(A,s+n),n=P,a=s,u=Math.max(u,A),w.offset=s,w.size=P,this._updateTypeInfo(w.type)}e.size=this._roundUp(u,a+n),e.align=u}_getTypeSize(e){var i,s;if(e==null)return null;const n=this._getAttributeNum(e.attributes,"size",0),a=this._getAttributeNum(e.attributes,"align",0);if(e instanceof iI&&(e=e.type),e instanceof Pf){const u=this._getAlias(e.name);u!==null&&(e=u)}{const u=Ja._typeInfo[e.name];if(u!==void 0){const c=((i=e.format)===null||i===void 0?void 0:i.name)==="f16"?2:1;return new y_(Math.max(a,u.align/c),Math.max(n,u.size/c))}}{const u=Ja._typeInfo[e.name.substring(0,e.name.length-1)];if(u){const c=e.name[e.name.length-1]==="h"?2:1;return new y_(Math.max(a,u.align/c),Math.max(n,u.size/c))}}if(e instanceof ux){let u=e,c=8,_=8;const w=this._getTypeSize(u.format);w!==null&&(_=w.size,c=w.align);const S=u.count,A=this._getAttributeNum((s=e==null?void 0:e.attributes)!==null&&s!==void 0?s:null,"stride",this._roundUp(c,_));return _=S*A,n&&(_=n),new y_(Math.max(a,c),Math.max(n,_))}if(e instanceof m_){let u=0,c=0,_=0,w=0,S=0;for(const A of e.members){const P=this._getTypeSize(A.type);P!==null&&(u=Math.max(P.align,u),_=this._roundUp(P.align,_+w),w=P.size,S=_)}return c=this._roundUp(u,S+w),new y_(Math.max(a,u),Math.max(n,c))}return null}_isUniformVar(e){return e instanceof pu&&e.storage=="uniform"}_isStorageVar(e){return e instanceof pu&&e.storage=="storage"}_isTextureVar(e){return e instanceof pu&&e.type!==null&&Ja._textureTypes.indexOf(e.type.name)!=-1}_isSamplerVar(e){return e instanceof pu&&e.type!==null&&Ja._samplerTypes.indexOf(e.type.name)!=-1}_getAttribute(e,i){const s=e;if(!s||!s.attributes)return null;const n=s.attributes;for(let a of n)if(a.name==i)return a;return null}_getAttributeNum(e,i,s){if(e===null)return s;for(let n of e)if(n.name==i){let a=n!==null&&n.value!==null?n.value:s;return a instanceof Array&&(a=a[0]),typeof a=="number"?a:typeof a=="string"?parseInt(a):s}return s}_roundUp(e,i){return Math.ceil(i/e)*e}}Ja._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}};Ja._textureTypes=ie.any_texture_type.map(t=>t.name);Ja._samplerTypes=ie.sampler_type.map(t=>t.name);function fV(t){var a;const e={attributes:[],bindings:[]};let i;try{i=dV(t)}catch(u){return at.error(u.message)(),e}for(const u of i.uniforms){const c=[];for(const _ of((a=u.type)==null?void 0:a.members)||[])c.push({name:_.name,type:rI(_.type)});e.bindings.push({type:"uniform",name:u.name,location:u.binding,group:u.group,members:c})}const s=i.entry.vertex[0],n=(s==null?void 0:s.inputs.length)||0;for(let u=0;u`:t.name}function dV(t){try{return new Ja(t)}catch(e){if(e instanceof Error)throw e;let i="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(i+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(i+=e.token.line||""),new Error(i,{cause:e})}}const pV=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND const float TWO_PI = 6.2831854820251465; const float PI_2 = 1.5707963705062866; const float PI_16 = 0.1963495463132858; @@ -230,7 +230,7 @@ return tan_taylor_fp32(a); return tan(a); #endif } -`,uV={name:"fp32",vs:cV},hV=[0,1,1,1],dV=`uniform pickingUniforms { +`,gV={name:"fp32",vs:pV},mV=[0,1,1,1],_V=`uniform pickingUniforms { float isActive; float isAttribute; float isHighlightActive; @@ -282,7 +282,7 @@ if (bool(picking.isAttribute)) { picking_vRGBcolor_Avalid.rgb = value; } } -`,fV=`uniform pickingUniforms { +`,yV=`uniform pickingUniforms { float isActive; float isAttribute; float isHighlightActive; @@ -319,7 +319,7 @@ vec4 picking_filterColor(vec4 color) { vec4 highlightColor = picking_filterHighlightColor(color); return picking_filterPickingColor(highlightColor); } -`,oI={name:"picking",vs:dV,fs:fV,uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3",highlightColor:"vec4"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:hV},getUniforms:pV};function pV(t={},e){const i={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)i.isHighlightActive=!1;else{i.isHighlightActive=!0;const s=t.highlightedObjectColor.slice(0,3);i.highlightedObjectColor=s}if(t.highlightColor){const s=Array.from(t.highlightColor,n=>n/255);Number.isFinite(s[3])||(s[3]=1),i.highlightColor=s}return t.isActive!==void 0&&(i.isActive=!!t.isActive,i.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(i.useFloatColors=!!t.useFloatColors),i}function PM(t,e=[],i=0){const s=Math.fround(t),n=t-s;return e[i]=s,e[i+1]=n,e}function mV(t){return t-Math.fround(t)}function gV(t){const e=new Float32Array(32);for(let i=0;i<4;++i)for(let s=0;s<4;++s){const n=i*4+s;PM(t[s*4+i],e,n*2)}return e}const _V=`uniform float ONE; +`,oI={name:"picking",vs:_V,fs:yV,uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3",highlightColor:"vec4"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:mV},getUniforms:bV};function bV(t={},e){const i={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)i.isHighlightActive=!1;else{i.isHighlightActive=!0;const s=t.highlightedObjectColor.slice(0,3);i.highlightedObjectColor=s}if(t.highlightColor){const s=Array.from(t.highlightColor,n=>n/255);Number.isFinite(s[3])||(s[3]=1),i.highlightColor=s}return t.isActive!==void 0&&(i.isActive=!!t.isActive,i.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(i.useFloatColors=!!t.useFloatColors),i}function kR(t,e=[],i=0){const s=Math.fround(t),n=t-s;return e[i]=s,e[i+1]=n,e}function vV(t){return t-Math.fround(t)}function xV(t){const e=new Float32Array(32);for(let i=0;i<4;++i)for(let s=0;s<4;++s){const n=i*4+s;kR(t[s*4+i],e,n*2)}return e}const wV=`uniform float ONE; vec2 split(float a) { const float SPLIT = 4097.0; float t = a * SPLIT; @@ -451,8 +451,8 @@ return sum_fp64(split(yn), prod); return sum_fp64(vec2(yn, 0.0), prod); #endif } -`,yV={ONE:1};function bV(){return yV}const vV={name:"fp64-arithmetic",vs:_V,getUniforms:bV,fp64ify:PM,fp64LowPart:mV,fp64ifyMatrix4:gV},xV={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...xV}};const co=globalThis.mathgl.config;function wV(t,{precision:e=co.precision}={}){return t=TV(t),`${parseFloat(t.toPrecision(e))}`}function vd(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Wl(t,e,i){return EV(t,s=>Math.max(e,Math.min(i,s)))}function _y(t,e,i){return vd(t)?t.map((s,n)=>_y(s,e[n],i)):i*e+(1-i)*t}function nm(t,e,i){const s=co.EPSILON;try{if(t===e)return!0;if(vd(t)&&vd(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+wV(this[s],e);return`${e.printTypes?this.constructor.name:""}[${i}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i=0&&e=0&&eMath.PI*2)throw Error("expected radians")}function h8(t,e,i,s,n,a){const u=2*a/(i-e),c=2*a/(n-s),_=(i+e)/(i-e),w=(n+s)/(n-s),S=-1,C=-1,P=-2*a;return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=_,t[9]=w,t[10]=S,t[11]=C,t[12]=0,t[13]=0,t[14]=P,t[15]=0,t}const NM="#define SMOOTH_EDGE_RADIUS 0.5",d8=` -${NM} +`,TV={ONE:1};function SV(){return TV}const EV={name:"fp64-arithmetic",vs:wV,getUniforms:SV,fp64ify:kR,fp64LowPart:vV,fp64ifyMatrix4:xV},AV={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...AV}};const mo=globalThis.mathgl.config;function IV(t,{precision:e=mo.precision}={}){return t=CV(t),`${parseFloat(t.toPrecision(e))}`}function zf(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ic(t,e,i){return MV(t,s=>Math.max(e,Math.min(i,s)))}function Ty(t,e,i){return zf(t)?t.map((s,n)=>Ty(s,e[n],i)):i*e+(1-i)*t}function pg(t,e,i){const s=mo.EPSILON;try{if(t===e)return!0;if(zf(t)&&zf(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+IV(this[s],e);return`${e.printTypes?this.constructor.name:""}[${i}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i=0&&e=0&&eMath.PI*2)throw Error("expected radians")}function m8(t,e,i,s,n,a){const u=2*a/(i-e),c=2*a/(n-s),_=(i+e)/(i-e),w=(n+s)/(n-s),S=-1,A=-1,P=-2*a;return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=_,t[9]=w,t[10]=S,t[11]=A,t[12]=0,t[13]=0,t[14]=P,t[15]=0,t}const zR="#define SMOOTH_EDGE_RADIUS 0.5",_8=` +${zR} struct VertexGeometry { vec4 position; @@ -469,8 +469,8 @@ struct VertexGeometry { vec2(0.0), vec3(0.0) ); -`,f8=` -${NM} +`,y8=` +${zR} struct FragmentGeometry { vec2 uv; @@ -479,9 +479,9 @@ struct FragmentGeometry { float smoothedge(float edge, float x) { return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x); } -`,p8={name:"geometry",vs:d8,fs:f8},Fi={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Fi,"IDENTITY",{get:()=>(Xi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const na={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},by={common:0,meters:1,pixels:2},xw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},m8=Object.keys(Fi).map(t=>`const int COORDINATE_SYSTEM_${t} = ${Fi[t]};`).join(""),g8=Object.keys(na).map(t=>`const int PROJECTION_MODE_${t} = ${na[t]};`).join(""),_8=Object.keys(by).map(t=>`const int UNIT_${t.toUpperCase()} = ${by[t]};`).join(""),y8=`${m8} -${g8} -${_8} +`,b8={name:"geometry",vs:_8,fs:y8},Li={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Li,"IDENTITY",{get:()=>(qi.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const ca={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},Ey={common:0,meters:1,pixels:2},Mw={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},v8=Object.keys(Li).map(t=>`const int COORDINATE_SYSTEM_${t} = ${Li[t]};`).join(""),x8=Object.keys(ca).map(t=>`const int PROJECTION_MODE_${t} = ${ca[t]};`).join(""),w8=Object.keys(Ey).map(t=>`const int UNIT_${t.toUpperCase()} = ${Ey[t]};`).join(""),T8=`${v8} +${x8} +${w8} uniform int project_uCoordinateSystem; uniform int project_uProjectionMode; uniform float project_uScale; @@ -668,7 +668,7 @@ return pixels / project_uScale; vec2 project_pixel_size(vec2 pixels) { return pixels / project_uScale; } -`;function b8(t,e){if(t===e)return!0;if(Array.isArray(t)){const i=t.length;if(!e||e.length!==i)return!1;for(let s=0;s{for(const n in s)if(!b8(s[n],e[n])){i=t(s),e=s;break}return i}}const uI=[0,0,0,0],v8=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],BM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],x8=[0,0,0],LM=[0,0,0],w8=km(E8);function zM(t,e,i=LM){i.length<3&&(i=[i[0],i[1],0]);let s=i,n,a=!0;switch(e===Fi.LNGLAT_OFFSETS||e===Fi.METER_OFFSETS?n=i:n=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case na.WEB_MERCATOR:(e===Fi.LNGLAT||e===Fi.CARTESIAN)&&(n=[0,0,0],a=!1);break;case na.WEB_MERCATOR_AUTO_OFFSET:e===Fi.LNGLAT?s=n:e===Fi.CARTESIAN&&(s=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],n=t.unprojectPosition(s),s[0]-=i[0],s[1]-=i[1],s[2]-=i[2]);break;case na.IDENTITY:s=t.position.map(Math.fround),s[2]=s[2]||0;break;case na.GLOBE:a=!1,n=null;break;default:a=!1}return{geospatialOrigin:n,shaderCoordinateOrigin:s,offsetMode:a}}function T8(t,e,i){const{viewMatrixUncentered:s,projectionMatrix:n}=t;let{viewMatrix:a,viewProjectionMatrix:u}=t,c=uI,_=uI,w=t.cameraPosition;const{geospatialOrigin:S,shaderCoordinateOrigin:C,offsetMode:P}=zM(t,e,i);return P&&(_=t.projectPosition(S||C),w=[w[0]-_[0],w[1]-_[1],w[2]-_[2]],_[3]=1,c=Mm([],_,u),a=s||a,u=_u([],n,a),u=_u([],u,v8)),{viewMatrix:a,viewProjectionMatrix:u,projectionCenter:c,originCommon:_,cameraPosCommon:w,shaderCoordinateOrigin:C,geospatialOrigin:S}}function S8({viewport:t,devicePixelRatio:e=1,modelMatrix:i=null,coordinateSystem:s=Fi.DEFAULT,coordinateOrigin:n=LM,autoWrapLongitude:a=!1}){s===Fi.DEFAULT&&(s=t.isGeospatial?Fi.LNGLAT:Fi.CARTESIAN);const u=w8({viewport:t,devicePixelRatio:e,coordinateSystem:s,coordinateOrigin:n});return u.project_uWrapLongitude=a,u.project_uModelMatrix=i||BM,u}function E8({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:s}){const{projectionCenter:n,viewProjectionMatrix:a,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:_,geospatialOrigin:w}=T8(t,i,s),S=t.getDistanceScales(),C=[t.width*e,t.height*e],P=Mm([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,D={project_uCoordinateSystem:i,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:_,project_uCommonOrigin:u.slice(0,3),project_uCenter:n,project_uPseudoMeters:!!t._pseudoMeters,project_uViewportSize:C,project_uDevicePixelRatio:e,project_uFocalDistance:P,project_uCommonUnitsPerMeter:S.unitsPerMeter,project_uCommonUnitsPerWorldUnit:S.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:x8,project_uScale:t.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:a,project_uModelMatrix:BM,project_uCameraPosition:c};if(w){const j=t.getDistanceScales(w);switch(i){case Fi.METER_OFFSETS:D.project_uCommonUnitsPerWorldUnit=j.unitsPerMeter,D.project_uCommonUnitsPerWorldUnit2=j.unitsPerMeter2;break;case Fi.LNGLAT:case Fi.LNGLAT_OFFSETS:t._pseudoMeters||(D.project_uCommonUnitsPerMeter=j.unitsPerMeter),D.project_uCommonUnitsPerWorldUnit=j.unitsPerDegree,D.project_uCommonUnitsPerWorldUnit2=j.unitsPerDegree2;break;case Fi.CARTESIAN:D.project_uCommonUnitsPerWorldUnit=[1,1,j.unitsPerMeter[2]],D.project_uCommonUnitsPerWorldUnit2=[0,0,j.unitsPerMeter2[2]];break}}return D}const A8={};function I8(t=A8){return"viewport"in t?S8(t):{}}const W1={name:"project",dependencies:[uV,p8],vs:y8,getUniforms:I8},C8=` +`;function S8(t,e){if(t===e)return!0;if(Array.isArray(t)){const i=t.length;if(!e||e.length!==i)return!1;for(let s=0;s{for(const n in s)if(!S8(s[n],e[n])){i=t(s),e=s;break}return i}}const uI=[0,0,0,0],E8=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],UR=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A8=[0,0,0],VR=[0,0,0],I8=jg(M8);function jR(t,e,i=VR){i.length<3&&(i=[i[0],i[1],0]);let s=i,n,a=!0;switch(e===Li.LNGLAT_OFFSETS||e===Li.METER_OFFSETS?n=i:n=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case ca.WEB_MERCATOR:(e===Li.LNGLAT||e===Li.CARTESIAN)&&(n=[0,0,0],a=!1);break;case ca.WEB_MERCATOR_AUTO_OFFSET:e===Li.LNGLAT?s=n:e===Li.CARTESIAN&&(s=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],n=t.unprojectPosition(s),s[0]-=i[0],s[1]-=i[1],s[2]-=i[2]);break;case ca.IDENTITY:s=t.position.map(Math.fround),s[2]=s[2]||0;break;case ca.GLOBE:a=!1,n=null;break;default:a=!1}return{geospatialOrigin:n,shaderCoordinateOrigin:s,offsetMode:a}}function C8(t,e,i){const{viewMatrixUncentered:s,projectionMatrix:n}=t;let{viewMatrix:a,viewProjectionMatrix:u}=t,c=uI,_=uI,w=t.cameraPosition;const{geospatialOrigin:S,shaderCoordinateOrigin:A,offsetMode:P}=jR(t,e,i);return P&&(_=t.projectPosition(S||A),w=[w[0]-_[0],w[1]-_[1],w[2]-_[2]],_[3]=1,c=Vg([],_,u),a=s||a,u=Iu([],n,a),u=Iu([],u,E8)),{viewMatrix:a,viewProjectionMatrix:u,projectionCenter:c,originCommon:_,cameraPosCommon:w,shaderCoordinateOrigin:A,geospatialOrigin:S}}function P8({viewport:t,devicePixelRatio:e=1,modelMatrix:i=null,coordinateSystem:s=Li.DEFAULT,coordinateOrigin:n=VR,autoWrapLongitude:a=!1}){s===Li.DEFAULT&&(s=t.isGeospatial?Li.LNGLAT:Li.CARTESIAN);const u=I8({viewport:t,devicePixelRatio:e,coordinateSystem:s,coordinateOrigin:n});return u.project_uWrapLongitude=a,u.project_uModelMatrix=i||UR,u}function M8({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:s}){const{projectionCenter:n,viewProjectionMatrix:a,originCommon:u,cameraPosCommon:c,shaderCoordinateOrigin:_,geospatialOrigin:w}=C8(t,i,s),S=t.getDistanceScales(),A=[t.width*e,t.height*e],P=Vg([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,D={project_uCoordinateSystem:i,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:_,project_uCommonOrigin:u.slice(0,3),project_uCenter:n,project_uPseudoMeters:!!t._pseudoMeters,project_uViewportSize:A,project_uDevicePixelRatio:e,project_uFocalDistance:P,project_uCommonUnitsPerMeter:S.unitsPerMeter,project_uCommonUnitsPerWorldUnit:S.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:A8,project_uScale:t.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:a,project_uModelMatrix:UR,project_uCameraPosition:c};if(w){const U=t.getDistanceScales(w);switch(i){case Li.METER_OFFSETS:D.project_uCommonUnitsPerWorldUnit=U.unitsPerMeter,D.project_uCommonUnitsPerWorldUnit2=U.unitsPerMeter2;break;case Li.LNGLAT:case Li.LNGLAT_OFFSETS:t._pseudoMeters||(D.project_uCommonUnitsPerMeter=U.unitsPerMeter),D.project_uCommonUnitsPerWorldUnit=U.unitsPerDegree,D.project_uCommonUnitsPerWorldUnit2=U.unitsPerDegree2;break;case Li.CARTESIAN:D.project_uCommonUnitsPerWorldUnit=[1,1,U.unitsPerMeter[2]],D.project_uCommonUnitsPerWorldUnit2=[0,0,U.unitsPerMeter2[2]];break}}return D}const R8={};function k8(t=R8){return"viewport"in t?P8(t):{}}const H1={name:"project",dependencies:[gV,b8],vs:T8,getUniforms:k8},O8=` vec4 project_position_to_clipspace( vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition ) { @@ -689,7 +689,7 @@ vec4 project_position_to_clipspace( vec4 commonPosition; return project_position_to_clipspace(position, position64Low, offset, commonPosition); } -`,P8={name:"project32",dependencies:[W1],vs:C8};function R8(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function ud(t,e){const i=Mm([],e,t);return r8(i,i,1/i[3]),i}function hI(t,e){const i=t%e;return i<0?e+i:i}function ww(t,e,i){return ti?i:t}function M8(t){return Math.log(t)*Math.LOG2E}const H1=Math.log2||M8;function Qa(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Io=Math.PI,UM=Io/4,uo=Io/180,Tw=180/Io,wd=512,vy=4003e4,y_=85.051129,k8=1.5;function O8(t){return H1(t)}function rm(t){const[e,i]=t;Qa(Number.isFinite(e)),Qa(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");const s=e*uo,n=i*uo,a=wd*(s+Io)/(2*Io),u=wd*(Io+Math.log(Math.tan(UM+n*.5)))/(2*Io);return[a,u]}function Td(t){const[e,i]=t,s=e/wd*(2*Io)-Io,n=2*(Math.atan(Math.exp(i/wd*(2*Io)-Io))-UM);return[s*Tw,n*Tw]}function D8(t){const{latitude:e}=t;Qa(Number.isFinite(e));const i=Math.cos(e*uo);return O8(vy*i)-9}function z_(t){const e=Math.cos(t*uo);return wd/vy/e}function Sw(t){const{latitude:e,longitude:i,highPrecision:s=!1}=t;Qa(Number.isFinite(e)&&Number.isFinite(i));const n=wd,a=Math.cos(e*uo),u=n/360,c=u/a,_=n/vy/a,w={unitsPerMeter:[_,_,_],metersPerUnit:[1/_,1/_,1/_],unitsPerDegree:[u,c,_],degreesPerUnit:[1/u,1/c,1/_]};if(s){const S=uo*Math.tan(e*uo)/a,C=u*S/2,P=n/vy*S,D=P/c*_;w.unitsPerDegree2=[0,C,P],w.unitsPerMeter2=[D,0,D]}return w}function VM(t,e){const[i,s,n]=t,[a,u,c]=e,{unitsPerMeter:_,unitsPerMeter2:w}=Sw({longitude:i,latitude:s,highPrecision:!0}),S=rm(t);S[0]+=a*(_[0]+w[0]*u),S[1]+=u*(_[1]+w[1]*u);const C=Td(S),P=(n||0)+(c||0);return Number.isFinite(n)||Number.isFinite(c)?[C[0],C[1],P]:C}function F8(t){const{height:e,pitch:i,bearing:s,altitude:n,scale:a,center:u}=t,c=R8();yy(c,c,[0,0,-n]),DM(c,c,-i*uo),FM(c,c,s*uo);const _=a/e;return $1(c,c,[_,_,_]),u&&yy(c,c,FV([],u)),c}function N8(t){const{width:e,height:i,altitude:s,pitch:n=0,offset:a,center:u,scale:c,nearZMultiplier:_=1,farZMultiplier:w=1}=t;let{fovy:S=xy(k8)}=t;s!==void 0&&(S=xy(s));const C=S*uo,P=n*uo,D=jM(S);let j=D;u&&(j+=u[2]*c/Math.cos(P)/i);const L=C*(.5+(a?a[1]:0)/i),H=Math.sin(L)*j/Math.sin(ww(Math.PI/2-P-L,.01,Math.PI-.01)),te=Math.sin(P)*H+j,G=j*10,se=Math.min(te*w,G);return{fov:C,aspect:e/i,focalDistance:D,near:_,far:se}}function xy(t){return 2*Math.atan(.5/t)*Tw}function jM(t){return .5/Math.tan(.5*t*uo)}function $M(t,e){const[i,s,n=0]=t;return Qa(Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(n)),ud(e,[i,s,n,1])}function q1(t,e,i=0){const[s,n,a]=t;if(Qa(Number.isFinite(s)&&Number.isFinite(n),"invalid pixel coordinate"),Number.isFinite(a))return ud(e,[s,n,a,1]);const u=ud(e,[s,n,0,1]),c=ud(e,[s,n,1,1]),_=u[2],w=c[2],S=_===w?0:((i||0)-_)/(w-_);return MM([],u,c,S)}function B8(t){const{width:e,height:i,bounds:s,minExtent:n=0,maxZoom:a=24,offset:u=[0,0]}=t,[[c,_],[w,S]]=s,C=L8(t.padding),P=rm([c,ww(S,-y_,y_)]),D=rm([w,ww(_,-y_,y_)]),j=[Math.max(Math.abs(D[0]-P[0]),n),Math.max(Math.abs(D[1]-P[1]),n)],L=[e-C.left-C.right-Math.abs(u[0])*2,i-C.top-C.bottom-Math.abs(u[1])*2];Qa(L[0]>0&&L[1]>0);const H=L[0]/j[0],te=L[1]/j[1],G=(C.right-C.left)/2/H,se=(C.top-C.bottom)/2/te,ve=[(D[0]+P[0])/2+G,(D[1]+P[1])/2+se],Se=Td(ve),ge=Math.min(a,H1(Math.abs(Math.min(H,te))));return Qa(Number.isFinite(ge)),{longitude:Se[0],latitude:Se[1],zoom:ge}}function L8(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(Qa(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const dI=Math.PI/180;function z8(t,e=0){const{width:i,height:s,unproject:n}=t,a={targetZ:e},u=n([0,s],a),c=n([i,s],a);let _,w;const S=t.fovy?.5*t.fovy*dI:Math.atan(.5/t.altitude),C=(90-t.pitch)*dI;return S>C-.01?(_=fI(t,0,e),w=fI(t,i,e)):(_=n([0,0],a),w=n([i,0],a)),[u,c,w,_]}function fI(t,e,i){const{pixelUnprojectionMatrix:s}=t,n=ud(s,[e,0,1,1]),a=ud(s,[e,t.height,1,1]),c=(i*t.distanceScales.unitsPerMeter[2]-n[2])/(a[2]-n[2]),_=MM([],n,a,c),w=Td(_);return w.push(i),w}const pI=512;function U8(t){const{width:e,height:i,pitch:s=0}=t;let{longitude:n,latitude:a,zoom:u,bearing:c=0}=t;(n<-180||n>180)&&(n=hI(n+180,360)-180),(c<-180||c>180)&&(c=hI(c+180,360)-180);const _=H1(i/pI);if(u<=_)u=_,a=0;else{const w=i/2/Math.pow(2,u),S=Td([0,w])[1];if(aC&&(a=C)}}return{width:e,height:i,longitude:n,latitude:a,zoom:u,pitch:s,bearing:c}}const V8=` +`,D8={name:"project32",dependencies:[H1],vs:O8};function F8(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mf(t,e){const i=Vg([],e,t);return u8(i,i,1/i[3]),i}function hI(t,e){const i=t%e;return i<0?e+i:i}function Rw(t,e,i){return ti?i:t}function N8(t){return Math.log(t)*Math.LOG2E}const W1=Math.log2||N8;function nl(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Ro=Math.PI,$R=Ro/4,_o=Ro/180,kw=180/Ro,Vf=512,Ay=4003e4,w_=85.051129,B8=1.5;function L8(t){return W1(t)}function gg(t){const[e,i]=t;nl(Number.isFinite(e)),nl(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");const s=e*_o,n=i*_o,a=Vf*(s+Ro)/(2*Ro),u=Vf*(Ro+Math.log(Math.tan($R+n*.5)))/(2*Ro);return[a,u]}function jf(t){const[e,i]=t,s=e/Vf*(2*Ro)-Ro,n=2*(Math.atan(Math.exp(i/Vf*(2*Ro)-Ro))-$R);return[s*kw,n*kw]}function z8(t){const{latitude:e}=t;nl(Number.isFinite(e));const i=Math.cos(e*_o);return L8(Ay*i)-9}function W_(t){const e=Math.cos(t*_o);return Vf/Ay/e}function Ow(t){const{latitude:e,longitude:i,highPrecision:s=!1}=t;nl(Number.isFinite(e)&&Number.isFinite(i));const n=Vf,a=Math.cos(e*_o),u=n/360,c=u/a,_=n/Ay/a,w={unitsPerMeter:[_,_,_],metersPerUnit:[1/_,1/_,1/_],unitsPerDegree:[u,c,_],degreesPerUnit:[1/u,1/c,1/_]};if(s){const S=_o*Math.tan(e*_o)/a,A=u*S/2,P=n/Ay*S,D=P/c*_;w.unitsPerDegree2=[0,A,P],w.unitsPerMeter2=[D,0,D]}return w}function HR(t,e){const[i,s,n]=t,[a,u,c]=e,{unitsPerMeter:_,unitsPerMeter2:w}=Ow({longitude:i,latitude:s,highPrecision:!0}),S=gg(t);S[0]+=a*(_[0]+w[0]*u),S[1]+=u*(_[1]+w[1]*u);const A=jf(S),P=(n||0)+(c||0);return Number.isFinite(n)||Number.isFinite(c)?[A[0],A[1],P]:A}function U8(t){const{height:e,pitch:i,bearing:s,altitude:n,scale:a,center:u}=t,c=F8();Sy(c,c,[0,0,-n]),BR(c,c,-i*_o),LR(c,c,s*_o);const _=a/e;return $1(c,c,[_,_,_]),u&&Sy(c,c,UV([],u)),c}function V8(t){const{width:e,height:i,altitude:s,pitch:n=0,offset:a,center:u,scale:c,nearZMultiplier:_=1,farZMultiplier:w=1}=t;let{fovy:S=Iy(B8)}=t;s!==void 0&&(S=Iy(s));const A=S*_o,P=n*_o,D=WR(S);let U=D;u&&(U+=u[2]*c/Math.cos(P)/i);const L=A*(.5+(a?a[1]:0)/i),W=Math.sin(L)*U/Math.sin(Rw(Math.PI/2-P-L,.01,Math.PI-.01)),ee=Math.sin(P)*W+U,G=U*10,se=Math.min(ee*w,G);return{fov:A,aspect:e/i,focalDistance:D,near:_,far:se}}function Iy(t){return 2*Math.atan(.5/t)*kw}function WR(t){return .5/Math.tan(.5*t*_o)}function qR(t,e){const[i,s,n=0]=t;return nl(Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(n)),Mf(e,[i,s,n,1])}function q1(t,e,i=0){const[s,n,a]=t;if(nl(Number.isFinite(s)&&Number.isFinite(n),"invalid pixel coordinate"),Number.isFinite(a))return Mf(e,[s,n,a,1]);const u=Mf(e,[s,n,0,1]),c=Mf(e,[s,n,1,1]),_=u[2],w=c[2],S=_===w?0:((i||0)-_)/(w-_);return DR([],u,c,S)}function j8(t){const{width:e,height:i,bounds:s,minExtent:n=0,maxZoom:a=24,offset:u=[0,0]}=t,[[c,_],[w,S]]=s,A=$8(t.padding),P=gg([c,Rw(S,-w_,w_)]),D=gg([w,Rw(_,-w_,w_)]),U=[Math.max(Math.abs(D[0]-P[0]),n),Math.max(Math.abs(D[1]-P[1]),n)],L=[e-A.left-A.right-Math.abs(u[0])*2,i-A.top-A.bottom-Math.abs(u[1])*2];nl(L[0]>0&&L[1]>0);const W=L[0]/U[0],ee=L[1]/U[1],G=(A.right-A.left)/2/W,se=(A.top-A.bottom)/2/ee,fe=[(D[0]+P[0])/2+G,(D[1]+P[1])/2+se],Se=jf(fe),Te=Math.min(a,W1(Math.abs(Math.min(W,ee))));return nl(Number.isFinite(Te)),{longitude:Se[0],latitude:Se[1],zoom:Te}}function $8(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(nl(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const fI=Math.PI/180;function H8(t,e=0){const{width:i,height:s,unproject:n}=t,a={targetZ:e},u=n([0,s],a),c=n([i,s],a);let _,w;const S=t.fovy?.5*t.fovy*fI:Math.atan(.5/t.altitude),A=(90-t.pitch)*fI;return S>A-.01?(_=dI(t,0,e),w=dI(t,i,e)):(_=n([0,0],a),w=n([i,0],a)),[u,c,w,_]}function dI(t,e,i){const{pixelUnprojectionMatrix:s}=t,n=Mf(s,[e,0,1,1]),a=Mf(s,[e,t.height,1,1]),c=(i*t.distanceScales.unitsPerMeter[2]-n[2])/(a[2]-n[2]),_=DR([],n,a,c),w=jf(_);return w.push(i),w}const pI=512;function W8(t){const{width:e,height:i,pitch:s=0}=t;let{longitude:n,latitude:a,zoom:u,bearing:c=0}=t;(n<-180||n>180)&&(n=hI(n+180,360)-180),(c<-180||c>180)&&(c=hI(c+180,360)-180);const _=W1(i/pI);if(u<=_)u=_,a=0;else{const w=i/2/Math.pow(2,u),S=jf([0,w])[1];if(aA&&(a=A)}}return{width:e,height:i,longitude:n,latitude:a,zoom:u,pitch:s,bearing:c}}const q8=` const int max_lights = 2; uniform mat4 shadow_uViewProjectionMatrices[max_lights]; uniform vec4 shadow_uProjectCenters[max_lights]; @@ -714,7 +714,7 @@ vec4 shadow_setVertexPosition(vec4 position_commonspace) { } return gl_Position; } -`,j8=` +`,X8=` const int max_lights = 2; uniform bool shadow_uDrawShadowMap; uniform bool shadow_uUseShadowMap; @@ -758,11 +758,11 @@ vec4 shadow_filterShadowColor(vec4 color) { } return color; } -`,$8=km(Z8),W8=km(K8),H8=[0,0,0,1],q8=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function X8(t,e){const[i,s,n]=t,a=q1([i,s,n],e);return Number.isFinite(n)?a:[a[0],a[1],0]}function Z8({viewport:t,center:e}){return new da(t.viewProjectionMatrix).invert().transform(e)}function K8({viewport:t,shadowMatrices:e}){const i=[],s=t.pixelUnprojectionMatrix,n=t.isGeospatial?void 0:1,a=[[0,0,n],[t.width,0,n],[0,t.height,n],[t.width,t.height,n],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(u=>X8(u,s));for(const u of e){const c=u.clone().translate(new ha(t.center).negate()),_=a.map(S=>c.transform(S)),w=new da().ortho({left:Math.min(..._.map(S=>S[0])),right:Math.max(..._.map(S=>S[0])),bottom:Math.min(..._.map(S=>S[1])),top:Math.max(..._.map(S=>S[1])),near:Math.min(..._.map(S=>-S[2])),far:Math.max(..._.map(S=>-S[2]))});i.push(w.multiplyRight(u))}return i}function Y8(t,e){const{shadowEnabled:i=!0}=t;if(!i||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const s={shadow_uDrawShadowMap:!!t.drawToShadowMap,shadow_uUseShadowMap:t.shadowMaps?t.shadowMaps.length>0:!1,shadow_uColor:t.shadowColor||H8,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},n=$8({viewport:t.viewport,center:e.project_uCenter}),a=[],u=W8({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let c=0;cG8(u,s));for(const u of e){const c=u.clone().translate(new ma(t.center).negate()),_=a.map(S=>c.transform(S)),w=new _a().ortho({left:Math.min(..._.map(S=>S[0])),right:Math.max(..._.map(S=>S[0])),bottom:Math.min(..._.map(S=>S[1])),top:Math.max(..._.map(S=>S[1])),near:Math.min(..._.map(S=>-S[2])),far:Math.max(..._.map(S=>-S[2]))});i.push(w.multiplyRight(u))}return i}function tj(t,e){const{shadowEnabled:i=!0}=t;if(!i||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const s={shadow_uDrawShadowMap:!!t.drawToShadowMap,shadow_uUseShadowMap:t.shadowMaps?t.shadowMaps.length>0:!1,shadow_uColor:t.shadowColor||K8,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},n=Z8({viewport:t.viewport,center:e.project_uCenter}),a=[],u=Y8({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let c=0;c"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?Y8(t,e):{}},J8={...oI,defaultUniforms:{...oI.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":` + `},getUniforms:(t={},e={})=>"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?tj(t,e):{}},ij={...oI,defaultUniforms:{...oI.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":` // for picking depth values picking_setPickingAttribute(position.z / position.w); `,"vs:DECKGL_FILTER_COLOR":` @@ -773,14 +773,14 @@ vec4 shadow_filterShadowColor(vec4 color) { // use picking color if rendering to picking FBO. color = picking_filterPickingColor(color); - `}}},G8=[W1],Q8=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function ej(){const t=ly.getDefaultShaderAssembler();for(const e of G8)t.addDefaultModule(e);for(const e of Q8)t.addShaderHook(e);return t}const tj=[255,255,255],ij=1;let sj=0;class nj{constructor(e={}){this.type="ambient";const{color:i=tj}=e,{intensity:s=ij}=e;this.id=e.id||`ambient-${sj++}`,this.color=i,this.intensity=s}}const rj=[255,255,255],oj=1,aj=[0,0,-1];let lj=0;class gI{constructor(e={}){this.type="directional";const{color:i=rj}=e,{intensity:s=oj}=e,{direction:n=aj}=e,{_shadow:a=!1}=e;this.id=e.id||`directional-${lj++}`,this.color=i,this.intensity=s,this.type="directional",this.direction=new ha(n).normalize().toArray(),this.shadow=a}getProjectedLight(e){return this}}class cj{constructor(e,i={id:"pass"}){const{id:s}=i;this.id=s,this.device=e,this.props={...i}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class X1 extends cj{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[i,s]=this.device.canvasContext.getDrawingBufferSize(),n=e.clearCanvas??!0,a=e.clearColor??(n?[0,0,0,0]:!1),u=n?1:!1,c=n?0:!1,_=e.colorMask??15,w={viewport:[0,0,i,s]};e.colorMask&&(w.colorMask=_),e.scissorRect&&(w.scissorRect=e.scissorRect);const S=this.device.beginRenderPass({framebuffer:e.target,parameters:w,clearColor:a,clearDepth:u,clearStencil:c});try{return this._drawLayers(S,e)}finally{S.end()}}_drawLayers(e,i){const{target:s,moduleParameters:n,viewports:a,views:u,onViewportActive:c,clearStack:_=!0}=i;i.pass=i.pass||"unknown",_&&(this._lastRenderIndex=-1);const w=[];for(const S of a){const C=u&&u[S.id];c==null||c(S);const P=this._getDrawLayerParams(S,i),D=S.subViewports||[S];for(const j of D){const L=this._drawLayersInViewport(e,{target:s,moduleParameters:n,viewport:j,view:C,pass:i.pass,layers:i.layers},P);w.push(L)}}return w}_getDrawLayerParams(e,{layers:i,pass:s,isPicking:n=!1,layerFilter:a,cullRect:u,effects:c,moduleParameters:_},w=!1){var j;const S=[],C=WM(this._lastRenderIndex+1),P={layer:i[0],viewport:e,isPicking:n,renderPass:s,cullRect:u},D={};for(let L=0;Lthis.device.clearWebGL(C))}const S={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:w});for(let C=0;C{const u=n.props._offset,c=n.id,_=n.parent&&n.parent.id;let w;if(_&&!(_ in e)&&s(n.parent,!1),_ in i){const S=i[_]=i[_]||WM(e[_],e);w=S(n,a),i[c]=S}else Number.isFinite(u)?(w=u+(e[_]||0),i[c]=null):w=t;return a&&w>=t&&(t=w+1),e[c]=w,w};return s}function uj(t,{moduleParameters:e,target:i,viewport:s}){const n=e&&e.devicePixelRatio||t.canvasContext.cssToDeviceRatio(),[,a]=t.canvasContext.getDrawingBufferSize(),u=i?i.height:a,c=s;return[c.x*n,u-(c.y+c.height)*n,c.width*n,c.height*n]}class hj extends X1{constructor(e,i){super(e,i),this.shadowMap=e.createTexture({width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),this.depthBuffer=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1,dataFormat:6402,type:5125}),this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[this.shadowMap],depthStencilAttachment:this.depthBuffer})}render(e){const i=this.fbo,s=this.device.canvasContext.cssToDeviceRatio(),n=e.viewports[0],a=n.width*s,u=n.height*s,c=[1,1,1,1];(a!==i.width||u!==i.height)&&i.resize({width:a,height:u}),super.render({...e,clearColor:c,target:i,pass:"shadow"})}getLayerParameters(e,i,s){return{...e.props.parameters,blend:!1,depthRange:[0,1],depthTest:!0}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.shadowMap&&(this.shadowMap.destroy(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.destroy(),this.depthBuffer=null)}}const dj={color:[255,255,255],intensity:1},_I=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],fj=[0,0,0,200/255];class HM{constructor(e={}){this.id="lighting-effect",this.shadowColor=fj,this.shadow=!1,this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:i,deck:s}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(i),s._addDefaultShaderModule(mI),this.dummyShadowMap=i.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(const i in e){const s=e[i];switch(s.type){case"ambient":this.ambientLight=s;break;case"directional":this.directionalLights.push(s);break;case"point":this.pointLights.push(s);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(i=>i.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:i,viewports:s,onViewportActive:n,views:a}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let u=0;us.getProjectedLight({layer:e})),pointLights:this.pointLights.map(s=>s.getProjectedLight({layer:e}))},i}cleanup(e){for(const i of this.shadowPasses)i.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(mI))}_calculateMatrices(){const e=[];for(const i of this.directionalLights){const s=new da().lookAt({eye:new ha(i.direction).negate()});e.push(s)}return e}_createShadowPasses(e){for(let i=0;in&&(a=n);const u=this._pool,c=e.BYTES_PER_ELEMENT*a,_=u.findIndex(w=>w.byteLength>=c);if(_>=0){const w=new e(u.splice(_,1)[0],0,a);return s&&w.fill(0),w}return new e(a)}_release(e){if(!ArrayBuffer.isView(e))return;const i=this._pool,{buffer:s}=e,{byteLength:n}=s,a=i.findIndex(u=>u.byteLength>=n);a<0?i.push(s):(a>0||i.lengththis.opts.poolSize&&i.shift()}}const om=new pj;function Pp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function mj(t){return[t[12],t[13],t[14]]}function gj(t){return{left:Dh(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:Dh(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:Dh(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:Dh(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:Dh(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:Dh(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const yI=new ha;function Dh(t,e,i,s){yI.set(t,e,i);const n=yI.len();return{distance:s/n,normal:new ha(-t/n,-e/n,-i/n)}}function _j(t){return t-Math.fround(t)}let _p;function ax(t,e){const{size:i=1,startIndex:s=0}=e,n=e.endIndex!==void 0?e.endIndex:t.length,a=(n-s)/i;_p=om.allocate(_p,a,{type:Float32Array,size:i*2});let u=s,c=0;for(;u=i.delay+i.duration*i.repeat}getTime(e){if(e===void 0)return this.time;const i=this.channels.get(e);return i===void 0?-1:i.time}setTime(e){this.time=Math.max(0,e);const i=this.channels.values();for(const n of i)this._setChannelTime(n,this.time);const s=this.animations.values();for(const n of s){const{animation:a,channel:u}=n;a.setTime(this.getTime(u))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,i){const s=Aj++;return this.animations.set(s,{animation:e,channel:i}),e.setTime(this.getTime(i)),s}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,i){const s=i-e.delay,n=e.duration*e.repeat;s>=n?e.time=e.duration*e.rate:(e.time=Math.max(0,s)%e.duration,e.time*=e.rate)}}let Ij=0;const Cj={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:ld.stats.get(`animation-loop-${Ij++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class Pj{constructor(e){J(this,"device",null);J(this,"canvas",null);J(this,"props");J(this,"animationProps",null);J(this,"timeline",null);J(this,"stats");J(this,"cpuTime");J(this,"gpuTime");J(this,"frameRate");J(this,"display");J(this,"needsRedraw","initialized");J(this,"_initialized",!1);J(this,"_running",!1);J(this,"_animationFrameId",null);J(this,"_nextFramePromise",null);J(this,"_resolveNextFrame",null);J(this,"_cpuStartTime",0);if(this.props={...Cj,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:i=!0}=this.props;this.stats=e.stats||new S0({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:i}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const i=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(i),i}}stop(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=T5(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(S5(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),this.device.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var e,i;if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:(i=(e=this.device)==null?void 0:e.canvasContext)==null?void 0:i.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:i,aspect:s}=this._getSizeAndAspect();(e!==this.animationProps.width||i!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),s!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=i,this.animationProps.aspect=s,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const i=document.createElement("div");i.style.position="absolute",i.style.left="10px",i.style.bottom="10px",i.style.width="300px",i.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(i);const s=this.props.onAddHTML(i);s&&(i.innerHTML=s)}}_getSizeAndAspect(){var a,u,c,_;if(!this.device)return{width:1,height:1,aspect:1};const[e,i]=((u=(a=this.device)==null?void 0:a.canvasContext)==null?void 0:u.getPixelSize())||[1,1];let s=1;const n=(_=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:_.canvas;return n&&n.clientHeight?s=n.clientWidth/n.clientHeight:e>0&&i>0&&(s=e/i),{width:e,height:i,aspect:s}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,i;this.props.autoResizeDrawingBuffer&&((i=(e=this.device)==null?void 0:e.canvasContext)==null||i.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}class xI{constructor(e){J(this,"id");J(this,"userData",{});J(this,"topology");J(this,"bufferLayout",[]);J(this,"vertexCount");J(this,"indices");J(this,"attributes");this.id=e.id||ku("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&ns(this.indices.usage===Ns.INDEX)}destroy(){var e;(e=this.indices)==null||e.destroy();for(const i of Object.values(this.attributes))i.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices}_calculateVertexCount(e){return e.byteLength/12}}function Rj(t,e){if(e instanceof xI)return e;const i=Mj(t,e),{attributes:s,bufferLayout:n}=kj(t,e);return new xI({topology:e.topology||"triangle-list",bufferLayout:n,vertexCount:e.vertexCount,indices:i,attributes:s})}function Mj(t,e){if(!e.indices)return;const i=e.indices.value;return t.createBuffer({usage:Ns.INDEX,data:i})}function kj(t,e){const i=[],s={};for(const[a,u]of Object.entries(e.attributes)){let c=a;switch(a){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}s[c]=t.createBuffer({data:u.value,id:`${a}-buffer`});const{value:_,size:w,normalized:S}=u;i.push({name:c,format:y5(_,w,S)})}const n=e._calculateVertexCount(e.attributes,e.indices);return{attributes:s,bufferLayout:i,vertexCount:n}}class Oj{constructor(e){J(this,"modules");J(this,"moduleUniforms");J(this,"moduleBindings");J(this,"moduleUniformsChanged");const i=A0(Object.values(e).filter(s=>s.dependencies));for(const s of i)e[s.name]=s;lt.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[s,n]of Object.entries(e)){const a=s;this.moduleUniforms[a]=n.defaultUniforms||{},this.moduleBindings[a]={}}}destroy(){}setProps(e){var i;for(const s of Object.keys(e)){const n=s,a=e[n],u=this.modules[n];if(!u){lt.warn(`Module ${s} not found`)();continue}const c=this.moduleUniforms[n],_=this.moduleBindings[n],w=((i=u.getUniforms)==null?void 0:i.call(u,a,c))||a,{uniforms:S,bindings:C}=j1(w);this.moduleUniforms[n]={...c,...S},this.moduleBindings[n]={..._,...C}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindings(){const e={};for(const i of Object.values(this.moduleBindings))Object.assign(e,i);return e}getDebugTable(){var i;const e={};for(const[s,n]of Object.entries(this.moduleUniforms))for(const[a,u]of Object.entries(n))e[`${s}.${a}`]={type:(i=this.modules[s].uniformTypes)==null?void 0:i[a],value:String(u)};return e}}const e0=class e0{constructor(e){J(this,"device");J(this,"_hashCounter",0);J(this,"_hashes",{});J(this,"_renderPipelineCache",{});J(this,"_computePipelineCache",{});this.device=e}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new e0(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const i={...yd.defaultProps,...e},s=this._hashRenderPipeline(i);if(!this._renderPipelineCache[s]){const n=this.device.createRenderPipeline({...i,id:i.id?`${i.id}-cached`:void 0});n.hash=s,this._renderPipelineCache[s]={pipeline:n,useCount:0}}return this._renderPipelineCache[s].useCount++,this._renderPipelineCache[s].pipeline}createComputePipeline(e){const i={...py.defaultProps,...e},s=this._hashComputePipeline(i);if(!this._computePipelineCache[s]){const n=this.device.createComputePipeline({...i,id:i.id?`${i.id}-cached`:void 0});n.hash=s,this._computePipelineCache[s]={pipeline:n,useCount:0}}return this._computePipelineCache[s].useCount++,this._computePipelineCache[s].pipeline}release(e){const i=e.hash,s=e instanceof py?this._computePipelineCache:this._renderPipelineCache;s[i].useCount--,s[i].useCount===0&&(s[i].pipeline.destroy(),delete s[i])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const i=this._getHash(e.vs.source),s=e.fs?this._getHash(e.fs.source):0,n="-",a=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${i}/${s}V${n}BL${a}`;default:const u=this._getHash(JSON.stringify(e.parameters));return`${i}/${s}V${n}T${e.topology}P${u}BL${a}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};J(e0,"defaultProps",{...yd.defaultProps});let Ew=e0;const t0=class t0{constructor(e){J(this,"device");J(this,"_cache",{});this.device=e}static getDefaultShaderFactory(e){var i;return(i=e._lumaData).defaultShaderFactory||(i.defaultShaderFactory=new t0(e)),e._lumaData.defaultShaderFactory}createShader(e){const i=this._hashShader(e);let s=this._cache[i];if(!s){const n=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[i]=s={shader:n,useCount:0}}return s.useCount++,s.shader}release(e){const i=this._hashShader(e),s=this._cache[i];s&&(s.useCount--,s.useCount===0&&(delete this._cache[i],s.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};J(t0,"defaultProps",{...hy.defaultProps});let Aw=t0;function Dj(t,e){var n;const i={},s="Values";if(t.attributes.length===0&&!((n=t.varyings)!=null&&n.length))return{"No attributes or varyings":{[s]:"N/A"}};for(const a of t.attributes)if(a){const u=`${a.location} ${a.name}: ${a.type}`;i[`in ${u}`]={[s]:a.stepMode||"vertex"}}for(const a of t.varyings||[]){const u=`${a.location} ${a.name}`;i[`out ${u}`]={[s]:JSON.stringify(a.accessor)}}return i}let un=null,cx=null;function Fj(t,{id:e,minimap:i,opaque:s,top:n="0",left:a="0",rgbaScale:u=1}){un||(un=document.createElement("canvas"),un.id=e,un.title=e,un.style.zIndex="100",un.style.position="absolute",un.style.top=n,un.style.left=a,un.style.border="blue 1px solid",un.style.transform="scaleY(-1)",document.body.appendChild(un),cx=un.getContext("2d")),(un.width!==t.width||un.height!==t.height)&&(un.width=t.width/2,un.height=t.height/2,un.style.width="400px",un.style.height="400px");const c=t.device.readPixelsToArrayWebGL(t),_=cx.createImageData(t.width,t.height),w=0;for(let S=0;S[C.name,C]))||[]);this.setShaderInputs(i.shaderInputs||new Oj(s));const n=Bj(e),a=(((_=this.props.modules)==null?void 0:_.length)>0?this.props.modules:(w=this.shaderInputs)==null?void 0:w.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(S=this.props).shaderLayout||(S.shaderLayout=aV(this.props.source));const{source:C,getUniforms:P}=this.props.shaderAssembler.assembleShader({platformInfo:n,...this.props,modules:a});this.source=C,this._getModuleUniforms=P}else{const{vs:C,fs:P,getUniforms:D}=this.props.shaderAssembler.assembleShaderPair({platformInfo:n,...this.props,modules:a});this.vs=C,this.fs=P,this._getModuleUniforms=D}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,i.geometry&&this.setGeometry(i.geometry),this.pipelineFactory=i.pipelineFactory||Ew.getDefaultPipelineFactory(this.device),this.shaderFactory=i.shaderFactory||Aw.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in i&&(this.isInstanced=i.isInstanced),i.instanceCount&&this.setInstanceCount(i.instanceCount),i.vertexCount&&this.setVertexCount(i.vertexCount),i.indexBuffer&&this.setIndexBuffer(i.indexBuffer),i.attributes&&this.setAttributes(i.attributes),i.constantAttributes&&this.setConstantAttributes(i.constantAttributes),i.bindings&&this.setBindings(i.bindings),i.uniforms&&this.setUniforms(i.uniforms),i.moduleSettings&&this.updateModuleSettings(i.moduleSettings),i.transformFeedback&&(this.transformFeedback=i.transformFeedback),Object.seal(this)}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){this.predraw();let i;try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings,{disableWarnings:this.props.disableWarnings}),cy(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:s}=this.vertexArray,n=s?s.byteLength/(s.indexType==="uint32"?4:2):void 0;i=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:n,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{this._logDrawCallEnd()}return this._logFramebuffer(e),i?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",i}setGeometry(e){var s;(s=this._gpuGeometry)==null||s.destroy();const i=e&&Rj(this.device,e);i&&(this.setTopology(i.topology||"triangle-list"),this.bufferLayout=wI(i.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i)),this._gpuGeometry=i}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){this.bufferLayout=this._gpuGeometry?wI(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){mw(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new _5(this.shaderInputs.modules);for(const i of Object.keys(this.shaderInputs.modules)){const s=this._uniformStore.getManagedUniformBuffer(this.device,i);this.bindings[`${i}Uniforms`]=s}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindings()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,i){e.indices&<.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();for(const[s,n]of Object.entries(e)){const a=this.bufferLayout.find(_=>TI(_).includes(s));if(!a){lt.warn(`Model(${this.id}): Missing layout for buffer "${s}".`)();continue}const u=TI(a);let c=!1;for(const _ of u){const w=this._attributeInfos[_];w&&(this.vertexArray.setBuffer(w.location,n),c=!0)}!c&&!((i==null?void 0:i.disableWarnings)??this.props.disableWarnings)&<.warn(`Model(${this.id}): Ignoring buffer "${n.id}" for unknown attribute "${s}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,i){for(const[s,n]of Object.entries(e)){const a=this._attributeInfos[s];a?this.vertexArray.setConstantWebGL(a.location,n):((i==null?void 0:i.disableWarnings)??this.props.disableWarnings)||lt.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${s}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){cy(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettings(e){const{bindings:i,uniforms:s}=j1(this._getModuleUniforms(e));Object.assign(this.bindings,i),Object.assign(this.uniforms,s),this.setNeedsRedraw("moduleSettings")}_getBindingsUpdateTimestamp(){let e=0;for(const i of Object.values(this.bindings))i instanceof uy?e=Math.max(e,i.texture.updateTimestamp):i instanceof Ns||i instanceof ao?e=Math.max(e,i.updateTimestamp):i instanceof dy||(e=Math.max(e,i.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const i={...e.attributes};for(const[s]of Object.entries(i))!this.pipeline.shaderLayout.attributes.find(n=>n.name===s)&&s!=="positions"&&delete i[s];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(i,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,i=null;this.pipeline&&(lt.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,i=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const s=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debug:this.props.debugShaders});let n=null;this.source?n=s:this.fs&&(n=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debug:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:s,fs:n}),this._attributeInfos=gM(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),i&&this.shaderFactory.release(i)}return this.pipeline}_logDrawCallStart(){const e=lt.level>3?0:Nj;lt.level<2||Date.now()-this._lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:lt.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=Dj(this.pipeline.shaderLayout,this.id);lt.table(Fh,e)();const i=this.shaderInputs.getDebugTable();for(const[n,a]of Object.entries(this.uniforms))i[n]={value:a};lt.table(Fh,i)();const s=this._getAttributeDebugTable();lt.table(Fh,this._attributeInfos)(),lt.table(Fh,s)(),lt.groupEnd(Fh)(),this._logOpen=!1}}_logFramebuffer(e){const i=lt.get("framebuffer");if(this._drawCount++,!i||this._drawCount++>3&&this._drawCount%60)return;const s=e.props.framebuffer;s&&Fj(s,{id:s.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[i,s]of Object.entries(this._attributeInfos))e[s.location]={name:i,type:s.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[s.location],s.bufferDataType)};if(this.vertexArray.indexBuffer){const{indexBuffer:i}=this.vertexArray,s=i.indexType==="uint32"?new Uint32Array(i.debugData):new Uint16Array(i.debugData);e.indices={name:"indices",type:i.indexType,values:s.toString()}}return e}_getBufferOrConstantValues(e,i){const s=bM(i);return(e instanceof Ns?new s(e.debugData):e).toString()}};J(i0,"defaultProps",{...yd.defaultProps,source:null,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:ly.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let Sd=i0;function wI(t,e){const i=[...t];for(const s of e){const n=i.findIndex(a=>a.name===s.name);n<0?i.push(s):i[n]=s}return i}function Bj(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function TI(t){var e;return t.attributes?(e=t.attributes)==null?void 0:e.map(i=>i.attribute):[t.name]}class lm{constructor(e,i=Sd.defaultProps){J(this,"device");J(this,"model");J(this,"transformFeedback");ns(lm.isSupported(e),"BufferTransform not yet implemented on WebGPU"),this.device=e,this.model=new Sd(this.device,{id:i.id||"buffer-transform-model",fs:i.fs||bU(),topology:i.topology||"point-list",...i}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:i.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var i;return((i=e==null?void 0:e.info)==null?void 0:i.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){const i=this.device.beginRenderPass(e);this.model.draw(i),i.end()}update(...e){console.warn("TextureTransform#update() not implemented")}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const i=this.getBuffer(e);if(i instanceof Ns)return i.readAsync();const{buffer:s,byteOffset:n=0,byteLength:a=s.byteLength}=i;return s.readAsync(n,a)}}class Lj{constructor(e){J(this,"id");J(this,"topology");J(this,"vertexCount");J(this,"indices");J(this,"attributes");J(this,"userData",{});const{attributes:i={},indices:s=null,vertexCount:n=null}=e;this.id=e.id||ku("geometry"),this.topology=e.topology,s&&(this.indices=ArrayBuffer.isView(s)?{value:s,size:1}:s),this.attributes={};for(const[a,u]of Object.entries(i)){const c=ArrayBuffer.isView(u)?{value:u}:u;ns(ArrayBuffer.isView(c.value),`${this._print(a)}: must be typed array or object with value as typed array`),(a==="POSITION"||a==="positions")&&!c.size&&(c.size=3),a==="indices"?(ns(!this.indices),this.indices=c):this.attributes[a]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=n||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,i){return this}_calculateVertexCount(e,i){if(i)return i.value.length;let s=1/0;for(const n of Object.values(e)){const{value:a,size:u,constant:c}=n;!c&&a&&u>=1&&(s=Math.min(s,a.length/u))}return ns(Number.isFinite(s)),s}}const zj={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class ZM extends X1{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:i,views:s,viewports:n,onViewportActive:a,pickingFBO:u,deviceRect:{x:c,y:_,width:w,height:S},cullRect:C,effects:P,pass:D="picking",pickZ:j,moduleParameters:L}){this.pickZ=j;const H=this._resetColorEncoder(j),te=[c,_,w,S],G=super.render({target:u,layers:e,layerFilter:i,views:s,viewports:n,onViewportActive:a,cullRect:C,effects:P==null?void 0:P.filter(ve=>ve.useInPicking),pass:D,isPicking:!0,moduleParameters:L,clearColor:[0,0,0,0],colorMask:15,scissorRect:te});return this._colorEncoderState=null,{decodePickingColor:H&&Vj.bind(null,H),stats:G}}shouldDrawLayer(e){const{pickable:i,operation:s}=e.props;return i&&s.includes("draw")||s.includes("terrain")||s.includes("mask")}getModuleParameters(){return{picking:{isActive:1,isAttribute:this.pickZ},lightSources:{}}}getLayerParameters(e,i,s){const n={depthMask:!0,depthTest:!0,depthRange:[0,1],...e.props.parameters},{pickable:a,operation:u}=e.props;return!this._colorEncoderState||u.includes("terrain")?n.blend=!1:a&&u.includes("draw")&&(Object.assign(n,zj),n.blend=!0,n.blendColor=Uj(this._colorEncoderState,e,s)),n}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function Uj(t,e,i){const{byLayer:s,byAlpha:n}=t;let a,u=s.get(e);return u?(u.viewports.push(i),a=u.a):(a=s.size+1,a<=255?(u={a,layer:e,viewports:[i]},s.set(e,u),n[a]=u):(Xi.warn("Too many pickable layers, only picking the first 255")(),a=0)),[0,0,0,a/255]}function Vj(t,e){const i=t.byAlpha[e[3]];return i&&{pickedLayer:i.layer,pickedViewports:i.viewports,pickedObjectIndex:i.layer.decodePickingColor(e)}}const jh={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Ty=Symbol.for("component"),yu=Symbol.for("propTypes"),ux=Symbol.for("deprecatedProps"),hd=Symbol.for("asyncPropDefaults"),Su=Symbol.for("asyncPropOriginal"),Hl=Symbol.for("asyncPropResolved");function cm(t,e=()=>!0){return Array.isArray(t)?KM(t,e,[]):e(t)?[t]:[]}function KM(t,e,i){let s=-1;for(;++s0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,i){if(e===this._data&&!i)return;this._data=e;const s=++this._loadCount;let n=e;typeof e=="string"&&(n=iw(e)),n instanceof Promise?(this.isLoaded=!1,this._loader=n.then(a=>{this._loadCount===s&&(this.isLoaded=!0,this._error=void 0,this._content=a)}).catch(a=>{this._loadCount===s&&(this.isLoaded=!0,this._error=a||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const a of this._subscribers)a.onChange(this.getData())}}class Wj{constructor(e){var i;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(i=e.device)==null?void 0:i.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:i,forceUpdate:s=!1,persistent:n=!0}){let a=this._resources[e];a?a.setData(i,s):(a=new $j(e,i,this._context),this._resources[e]=a),a.persistent=n}remove(e){const i=this._resources[e];i&&(i.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const i=this._consumers[e];if(i){for(const s in i){const n=i[s],a=this._resources[n.resourceId];a&&a.unsubscribe(n)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:i,consumerId:s,requestId:n="default"}){const{_resources:a,protocol:u}=this;e.startsWith(u)&&(e=e.replace(u,""),a[e]||this.add({resourceId:e,data:null,persistent:!1}));const c=a[e];if(this._track(s,n,c,i),c)return c.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,i,s,n){const a=this._consumers,u=a[e]=a[e]||{};let c=u[i];const _=c&&c.resourceId&&this._resources[c.resourceId];_&&(_.unsubscribe(c),this.prune()),s&&(c?(c.onChange=n,c.resourceId=s.id):c={onChange:n,resourceId:s.id},u[i]=c,s.subscribe(c))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const i=this._resources[e];!i.persistent&&!i.inUse()&&(i.delete(),delete this._resources[e])}}}const Hj="layerManager.setLayers",qj="layerManager.activateViewport";class Xj{constructor(e,i){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=c=>{tr(qj,this,c),c&&(this.context.viewport=c)};const{deck:s,stats:n,viewport:a,timeline:u}=i||{};this.layers=[],this.resourceManager=new Wj({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:s,shaderAssembler:ej(),defaultShaderModules:[],renderPass:void 0,stats:n||new S0({id:"deck.gl"}),viewport:a||new wy({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:u||new XM,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let i=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const s of this.layers){const n=s.getNeedsRedraw(e);i=i||n}return i}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(i=>e.find(s=>i.id.indexOf(s)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,i){tr(Hj,this,i,e),this._lastRenderedLayers=e;const s=cm(e,Boolean);for(const n of s)n.context=this.context;this._updateLayers(this.layers,s)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:i}=this.context;i.find(s=>s.name===e.name)||(i.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:i}=this.context,s=i.findIndex(n=>n.name===e.name);s>=0&&(i.splice(s,1),this._defaultShaderModulesChanged=!0)}_handleError(e,i,s){s.raiseError(i,`${e} of ${s}`)}_updateLayers(e,i){const s={};for(const u of e)s[u.id]?Xi.warn(`Multiple old layers with same id ${u.id}`)():s[u.id]=u;if(this._defaultShaderModulesChanged){for(const u of e)u.setNeedsUpdate(),u.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const n=[];this._updateSublayersRecursively(i,s,n),this._finalizeOldLayers(s);let a=!1;for(const u of n)if(u.hasUniformTransition()){a=`Uniform transition in ${u}`;break}this._needsUpdate=a,this.layers=n}_updateSublayersRecursively(e,i,s){for(const n of e){n.context=this.context;const a=i[n.id];a===null&&Xi.warn(`Multiple new layers with same id ${n.id}`)(),i[n.id]=null;let u=null;try{this._debug&&a!==n&&n.validateProps(),a?(this._transferLayerState(a,n),this._updateLayer(n)):this._initializeLayer(n),s.push(n),u=n.isComposite?n.getSubLayers():null}catch(c){this._handleError("matching",c,n)}u&&this._updateSublayersRecursively(u,i,s)}}_finalizeOldLayers(e){for(const i in e){const s=e[i];s&&this._finalizeLayer(s)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=jh.INITIALIZED}catch(i){this._handleError("initialization",i,e)}}_transferLayerState(e,i){i._transferState(e),i.lifecycle=jh.MATCHED,i!==e&&(e.lifecycle=jh.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(i){this._handleError("update",i,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=jh.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=jh.FINALIZED}catch(i){this._handleError("finalization",i,e)}}}function Xr(t,e,i){if(t===e)return!0;if(!i||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let s=0;si.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(i=>{e[i.id]=i}),e}getView(e){return this.views.find(i=>i.id===e)}getViewState(e){const i=typeof e=="string"?this.getView(e):e,s=i&&this.viewState[i.getViewStateId()]||this.viewState;return i?i.filterViewState(s):s}getViewport(e){return this._viewportMap[e]}unproject(e,i){const s=this.getViewports(),n={x:e[0],y:e[1]};for(let a=s.length-1;a>=0;--a){const u=s[a];if(u.containsPixel(n)){const c=e.slice();return c[0]-=u.x,c[1]-=u.y,u.unproject(c,i)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,i){(e!==this.width||i!==this.height)&&(this.width=e,this.height=i,this.setNeedsUpdate("Size changed"))}_setViews(e){e=cm(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Xr(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Xi.warn("missing `viewState` or `initialViewState`")()}_createController(e,i){const s=i.type;return new s({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:a=>{var u;return(u=this.getView(e.id))==null?void 0:u.makeViewport({viewState:a,width:this.width,height:this.height})}})}_updateController(e,i,s,n){const a=e.controller;if(a&&s){const u={...i,...a,id:e.id,x:s.x,y:s.y,width:s.width,height:s.height};return(!n||n.constructor!==a.type)&&(n=this._createController(e,u)),n&&n.setProps(u),n}return null}_rebuildViewports(){const{views:e}=this,i=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let n=e.length;n--;){const a=e[n],u=this.getViewState(a),c=a.makeViewport({viewState:u,width:this.width,height:this.height});let _=i[a.id];const w=!!a.controller;w&&!_&&(s=!0),(s||!w)&&_&&(_.finalize(),_=null),this.controllers[a.id]=this._updateController(a,u,c,_),c&&this._viewports.unshift(c)}for(const n in i){const a=i[n];a&&!this.controllers[n]&&a.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,i){return e.length!==i.length?!0:e.some((s,n)=>!e[n].equals(i[n]))}}const Kj=/([0-9]+\.?[0-9]*)(%|px)/;function Rl(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=Kj.exec(t);if(e&&e.length>=3){const i=e[2]==="%",s=parseFloat(e[1]);return{position:i?s/100:s,relative:i}}default:throw new Error(`Could not parse position string ${t}`)}}function Ml(t,e){return t.relative?Math.round(t.position*e):t.position}class Yj{constructor(e){const{id:i,x:s=0,y:n=0,width:a="100%",height:u="100%",padding:c=null}=e;this.id=i||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=Rl(s),this._y=Rl(n),this._width=Rl(a),this._height=Rl(u),this._padding=c&&{left:Rl(c.left||0),right:Rl(c.right||0),top:Rl(c.top||0),bottom:Rl(c.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.ViewportType===e.ViewportType&&Xr(this.props,e.props,2)}makeViewport({width:e,height:i,viewState:s}){s=this.filterViewState(s);const n=this.getDimensions({width:e,height:i});return!n.height||!n.width?null:new this.ViewportType({...s,...this.props,...n})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const i={...e};for(const s in this.props.viewState)s!=="id"&&(i[s]=this.props.viewState[s]);return i}return e}getDimensions({width:e,height:i}){const s={x:Ml(this._x,e),y:Ml(this._y,i),width:Ml(this._width,e),height:Ml(this._height,i)};return this._padding&&(s.padding={left:Ml(this._padding.left,e),top:Ml(this._padding.top,i),right:Ml(this._padding.right,e),bottom:Ml(this._padding.bottom,i)}),s}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class C0{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var i,s;this.cancel(),this.settings=e,this._inProgress=!0,(s=(i=this.settings).onStart)==null||s.call(i,this)}end(){var e,i;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(i=(e=this.settings).onEnd)==null||i.call(e,this))}cancel(){var e,i;this._inProgress&&((i=(e=this.settings).onInterrupt)==null||i.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,i;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:s,settings:n}=this;this._handle=s.addChannel({delay:s.getTime(),duration:n.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(i=(e=this.settings).onUpdate)==null||i.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const SI=()=>{},Iw={BREAK:1,SNAP_TO_END:2,IGNORE:3},Jj=t=>t,Gj=Iw.BREAK;class Qj{constructor(e){this._onTransitionUpdate=i=>{const{time:s,settings:{interpolator:n,startProps:a,endProps:u,duration:c,easing:_}}=i,w=_(s/c),S=n.interpolateProps(a,u,w);this.propsInTransition=this.getControllerState({...this.props,...S}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new C0(e.timeline),this.onViewStateChange=e.onViewStateChange||SI,this.onStateChange=e.onStateChange||SI}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let i=!1;const s=this.props;if(this.props=e,!s||this._shouldIgnoreViewportChange(s,e))return!1;if(this._isTransitionEnabled(e)){let n=s;if(this.transition.inProgress){const{interruption:a,endProps:u}=this.transition.settings;n={...s,...a===Iw.SNAP_TO_END?u:this.propsInTransition||s}}this._triggerTransition(n,e),i=!0}else this.transition.cancel();return i}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:i,transitionInterpolator:s}=e;return(i>0||i==="auto")&&!!s}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,i){return this.transition.inProgress?this.transition.settings.interruption===Iw.IGNORE||this._isUpdateDueToCurrentTransition(i):this._isTransitionEnabled(i)?i.transitionInterpolator.arePropsEqual(e,i):!0}_triggerTransition(e,i){const s=this.getControllerState(e),n=this.getControllerState(i).shortestPathFrom(s),a=i.transitionInterpolator,u=a.getDuration?a.getDuration(e,i):i.transitionDuration;if(u===0)return;const c=a.initializeProps(e,n);this.propsInTransition={};const _={duration:u,easing:i.transitionEasing||Jj,interpolator:a,interruption:i.transitionInterruption||Gj,startProps:c.start,endProps:c.end,onStart:i.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(i.onTransitionInterrupt),onEnd:this._onTransitionEnd(i.onTransitionEnd)};this.transition.start(_),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return i=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(i)}}}function Ks(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class e${constructor(e){const{compare:i,extract:s,required:n}=e;this._propsToCompare=i,this._propsToExtract=s||i,this._requiredProps=n}arePropsEqual(e,i){for(const s of this._propsToCompare)if(!(s in e)||!(s in i)||!nm(e[s],i[s]))return!1;return!0}initializeProps(e,i){const s={},n={};for(const a of this._propsToExtract)(a in e||a in i)&&(s[a]=e[a],n[a]=i[a]);return this._checkRequiredProps(s),this._checkRequiredProps(n),{start:s,end:n}}getDuration(e,i){return i.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(i=>{const s=e[i];Ks(Number.isFinite(s)||Array.isArray(s),`${i} is required for transition`)})}}const t$=["longitude","latitude","zoom","bearing","pitch"],i$=["longitude","latitude","zoom"];class YM extends e${constructor(e={}){const i=Array.isArray(e)?e:e.transitionProps,s=Array.isArray(e)?{}:e;s.transitionProps=Array.isArray(i)?{compare:i,required:i}:i||{compare:t$,required:i$},super(s.transitionProps),this.opts=s}initializeProps(e,i){const s=super.initializeProps(e,i),{makeViewport:n,around:a}=this.opts;if(n&&a){const u=n(e),c=n(i),_=u.unproject(a);s.start.around=a,Object.assign(s.end,{around:c.project(_),aroundPosition:_,width:i.width,height:i.height})}return s}interpolateProps(e,i,s){const n={};for(const a of this._propsToExtract)n[a]=_y(e[a]||0,i[a]||0,s);if(i.aroundPosition&&this.opts.makeViewport){const a=this.opts.makeViewport({...i,...n});Object.assign(n,a.panByPosition(i.aroundPosition,_y(e.around,i.around,s)))}return n}}const kl={transitionDuration:0},s$=300,b_=t=>1-(1-t)*(1-t),Nh={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]},Gc={};class n${constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new Qj({...e,getControllerState:i=>new this.ControllerState(i),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const i in this._events)this._events[i]&&((e=this.eventManager)==null||e.off(i,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const i=this._eventStartBlocked;switch(e.type){case"panstart":return i?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return i?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return i?!1:this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:i,y:s}=this.props,{offsetCenter:n}=e;return[n.x-i,n.y-s]}isPointInBounds(e,i){const{width:s,height:n}=this.props;if(i&&i.handled)return!1;const a=e[0]>=0&&e[0]<=s&&e[1]>=0&&e[1]<=n;return a&&i&&i.stopPropagation(),a}isFunctionKeyPressed(e){const{srcEvent:i}=e;return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const i=setTimeout(()=>{this._eventStartBlocked===i&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=i}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:i}=e;this.inertia=Number.isFinite(i)?i:i===!0?s$:0;const{scrollZoom:s=!0,dragPan:n=!0,dragRotate:a=!0,doubleClickZoom:u=!0,touchZoom:c=!0,touchRotate:_=!1,keyboard:w=!0}=e,S=!!this.onViewStateChange;this.toggleEvents(Nh.WHEEL,S&&s),this.toggleEvents(Nh.PAN,S),this.toggleEvents(Nh.PINCH,S&&(c||_)),this.toggleEvents(Nh.TRIPLE_PAN,S&&_),this.toggleEvents(Nh.DOUBLE_TAP,S&&u),this.toggleEvents(Nh.KEYBOARD,S&&w),this.scrollZoom=s,this.dragPan=n,this.dragRotate=a,this.doubleClickZoom=u,this.touchZoom=c,this.touchRotate=_,this.keyboard=w}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,i){this.eventManager&&e.forEach(s=>{this._events[s]!==i&&(this._events[s]=i,i?this.eventManager.on(s,this.handleEvent):this.eventManager.off(s,this.handleEvent))})}updateViewport(e,i=null,s={}){const n={...e.getViewportProps(),...i},a=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(s),a){const u=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:u,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;let s=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(s=!s);const n=this.controllerState[s?"panStart":"rotateStart"]({pos:i});return this._panMove=s,this.updateViewport(n,kl,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const i=this.getCenter(e),s=this.controllerState.pan({pos:i});return this.updateViewport(s,kl,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:i}=this;if(this.dragPan&&i&&e.velocity){const s=this.getCenter(e),n=[s[0]+e.velocityX*i/2,s[1]+e.velocityY*i/2],a=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:b_},{isDragging:!1,isPanning:!0})}else{const s=this.controllerState.panEnd();this.updateViewport(s,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const i=this.getCenter(e),s=this.controllerState.rotate({pos:i});return this.updateViewport(s,kl,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:i}=this;if(this.dragRotate&&i&&e.velocity){const s=this.getCenter(e),n=[s[0]+e.velocityX*i/2,s[1]+e.velocityY*i/2],a=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:b_},{isDragging:!1,isRotating:!0})}else{const s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;e.srcEvent.preventDefault();const{speed:s=.01,smooth:n=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:a}=e;let u=2/(1+Math.exp(-Math.abs(a*s)));a<0&&u!==0&&(u=1/u);const c=this.controllerState.zoom({pos:i,scale:u});return this.updateViewport(c,{...this._getTransitionProps({around:i}),transitionDuration:n?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.controllerState.rotateStart({pos:i});return this.updateViewport(s,kl,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const i=this.getCenter(e);i[0]-=e.deltaX;const s=this.controllerState.rotate({pos:i});return this.updateViewport(s,kl,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:i}=this;if(this.touchRotate&&i&&e.velocityY){const s=this.getCenter(e),n=[s[0],s[1]+=e.velocityY*i/2],a=this.controllerState.rotate({pos:n});this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:b_},{isDragging:!1,isRotating:!0}),this.blockEvents(i)}else{const s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.controllerState.zoomStart({pos:i}).rotateStart({pos:i});return Gc._startPinchRotation=e.rotation,Gc._lastPinchEvent=e,this.updateViewport(s,kl,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let i=this.controllerState;if(this.touchZoom){const{scale:s}=e,n=this.getCenter(e);i=i.zoom({pos:n,scale:s})}if(this.touchRotate){const{rotation:s}=e;i=i.rotate({deltaAngleX:Gc._startPinchRotation-s})}return this.updateViewport(i,kl,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),Gc._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:i}=this,{_lastPinchEvent:s}=Gc;if(this.touchZoom&&i&&s&&e.scale!==s.scale){const n=this.getCenter(e);let a=this.controllerState.rotateEnd();const u=Math.log2(e.scale),c=(u-Math.log2(s.scale))/(e.deltaTime-s.deltaTime),_=Math.pow(2,u+c*i/2);a=a.zoom({pos:n,scale:_}).zoomEnd(),this.updateViewport(a,{...this._getTransitionProps({around:n}),transitionDuration:i,transitionEasing:b_},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(i)}else{const n=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(n,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return Gc._startPinchRotation=null,Gc._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.isFunctionKeyPressed(e),n=this.controllerState.zoom({pos:i,scale:s?.5:2});return this.updateViewport(n,this._getTransitionProps({around:i}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const i=this.isFunctionKeyPressed(e),{zoomSpeed:s,moveSpeed:n,rotateSpeedX:a,rotateSpeedY:u}=this.keyboard===!0?{}:this.keyboard,{controllerState:c}=this;let _;const w={};switch(e.srcEvent.code){case"Minus":_=i?c.zoomOut(s).zoomOut(s):c.zoomOut(s),w.isZooming=!0;break;case"Equal":_=i?c.zoomIn(s).zoomIn(s):c.zoomIn(s),w.isZooming=!0;break;case"ArrowLeft":i?(_=c.rotateLeft(a),w.isRotating=!0):(_=c.moveLeft(n),w.isPanning=!0);break;case"ArrowRight":i?(_=c.rotateRight(a),w.isRotating=!0):(_=c.moveRight(n),w.isPanning=!0);break;case"ArrowUp":i?(_=c.rotateUp(u),w.isRotating=!0):(_=c.moveUp(n),w.isPanning=!0);break;case"ArrowDown":i?(_=c.rotateDown(u),w.isRotating=!0):(_=c.moveDown(n),w.isPanning=!0);break;default:return!1}return this.updateViewport(_,this._getTransitionProps(),w),!0}_getTransitionProps(e){const{transition:i}=this;return!i||!i.transitionInterpolator?kl:e?{...i,transitionInterpolator:new YM({...e,...i.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:i}}class r${constructor(e,i){this._viewportProps=this.applyConstraints(e),this._state=i}getViewportProps(){return this._viewportProps}getState(){return this._state}}const EI=5,o$=1.2;class a$ extends r${constructor(e){const{width:i,height:s,latitude:n,longitude:a,zoom:u,bearing:c=0,pitch:_=0,altitude:w=1.5,position:S=[0,0,0],maxZoom:C=20,minZoom:P=0,maxPitch:D=60,minPitch:j=0,startPanLngLat:L,startZoomLngLat:H,startRotatePos:te,startBearing:G,startPitch:se,startZoom:ve,normalize:Se=!0}=e;Ks(Number.isFinite(a)),Ks(Number.isFinite(n)),Ks(Number.isFinite(u)),super({width:i,height:s,latitude:n,longitude:a,zoom:u,bearing:c,pitch:_,altitude:w,maxZoom:C,minZoom:P,maxPitch:D,minPitch:j,normalize:Se,position:S},{startPanLngLat:L,startZoomLngLat:H,startRotatePos:te,startBearing:G,startPitch:se,startZoom:ve}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:i}){const s=this.getState().startPanLngLat||this._unproject(i);if(!s)return this;const a=this.makeViewport(this.getViewportProps()).panByPosition(s,e);return this._getUpdatedState(a)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:i=0,deltaAngleY:s=0}){const{startRotatePos:n,startBearing:a,startPitch:u}=this.getState();if(!n||a===void 0||u===void 0)return this;let c;return e?c=this._getNewRotation(e,n,u,a):c={bearing:a+i,pitch:u+s},this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:i,scale:s}){let{startZoom:n,startZoomLngLat:a}=this.getState();if(a||(n=this.getViewportProps().zoom,a=this._unproject(i)||this._unproject(e)),!a)return this;const{maxZoom:u,minZoom:c}=this.getViewportProps();let _=n+Math.log2(s);_=Wl(_,c,u);const w=this.makeViewport({...this.getViewportProps(),zoom:_});return this._getUpdatedState({zoom:_,...w.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const i=e.getViewportProps(),s={...this.getViewportProps()},{bearing:n,longitude:a}=s;return Math.abs(n-i.bearing)>180&&(s.bearing=n<0?n+360:n-360),Math.abs(a-i.longitude)>180&&(s.longitude=a<0?a+360:a-360),s}applyConstraints(e){const{maxZoom:i,minZoom:s,zoom:n}=e;e.zoom=Wl(n,s,i);const{maxPitch:a,minPitch:u,pitch:c}=e;e.pitch=Wl(c,u,a);const{normalize:_=!0}=e;return _&&Object.assign(e,U8(e)),e}_zoomFromCenter(e){const{width:i,height:s}=this.getViewportProps();return this.zoom({pos:[i/2,s/2],scale:e})}_panFromCenter(e){const{width:i,height:s}=this.getViewportProps();return this.pan({startPos:[i/2,s/2],pos:[i/2+e[0],s/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const i=this.makeViewport(this.getViewportProps());return e&&i.unproject(e)}_getNewRotation(e,i,s,n){const a=e[0]-i[0],u=e[1]-i[1],c=e[1],_=i[1],{width:w,height:S}=this.getViewportProps(),C=a/w;let P=0;u>0?Math.abs(S-_)>EI&&(P=u/(_-S)*o$):u<0&&_>EI&&(P=1-c/_),P=Wl(P,-1,1);const{minPitch:D,maxPitch:j}=this.getViewportProps(),L=n+180*C;let H=s;return P>0?H=s+P*(j-s):P<0&&(H=s-P*(D-s)),{pitch:H,bearing:L}}}class l$ extends n${constructor(){super(...arguments),this.ControllerState=a$,this.transition={transitionDuration:300,transitionInterpolator:new YM({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const i=this.props;super.setProps(e),(!i||i.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}const HS=class HS extends Yj{constructor(e={}){super(e)}get ViewportType(){return am}get ControllerType(){return l$}};HS.displayName="MapView";let Sy=HS;const c$=new HM;function u$(t,e){const i=t.order??1/0,s=e.order??1/0;return i-s}class h${constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const i=this._defaultEffects;if(!i.find(s=>s.id===e.id)){const s=i.findIndex(n=>u$(n,e)>0);s<0?i.push(e):i.splice(s,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Xr(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const i=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),i}getEffects(){return this._resolvedEffects}_setEffects(e){const i={};for(const n of this.effects)i[n.id]=n;const s=[];for(const n of e){const a=i[n.id];let u=n;a&&a!==n?a.setProps?(a.setProps(n.props),u=a):a.cleanup(this._context):a||n.setup(this._context),s.push(u),delete i[n.id]}for(const n in i)i[n].cleanup(this._context);this.effects=s,this._resolvedEffects=s.concat(this._defaultEffects),e.some(n=>n instanceof HM)||this._resolvedEffects.push(c$),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class d$ extends X1{shouldDrawLayer(e){const{operation:i}=e.props;return i.includes("draw")||i.includes("terrain")}}const f$="deckRenderer.renderLayers";class p${constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new d$(e),this.pickLayersPass=new ZM(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const i=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,s={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};s.effects&&this._preRender(s.effects,s);const n=this.lastPostProcessEffect?this.renderBuffers[0]:s.target;this.lastPostProcessEffect&&(s.clearColor=[0,0,0,0],s.clearCanvas=!0);const a=i.render({...s,target:n});s.effects&&this._postRender(s.effects,s),this.renderCount++,tr(f$,this,a,e)}needsRedraw(e={clearRedrawFlags:!1}){const i=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),i}finalize(){const{renderBuffers:e}=this;for(const i of e)i.delete();e.length=0}_preRender(e,i){this.lastPostProcessEffect=null,i.preRenderStats=i.preRenderStats||{};for(const s of e)i.preRenderStats[s.id]=s.preRender(i),s.postRender&&(this.lastPostProcessEffect=s.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,i=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(s=>{const n=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${s}`,colorAttachments:[n]}))});for(const s of e)s.resize(i)}_postRender(e,i){const{renderBuffers:s}=this,n={...i,inputBuffer:s[0],swapBuffer:s[1]};for(const a of e)if(a.postRender){n.target=a.id===this.lastPostProcessEffect?i.target:void 0;const u=a.postRender(n);n.inputBuffer=u,n.swapBuffer=u===s[0]?s[1]:s[0]}}}const m$={pickedColor:null,pickedObjectIndex:-1};function g$({pickedColors:t,decodePickingColor:e,deviceX:i,deviceY:s,deviceRadius:n,deviceRect:a}){const{x:u,y:c,width:_,height:w}=a;let S=n*n,C=-1,P=0;for(let D=0;DS)P+=4*_;else for(let H=0;H<_;H++){if(t[P+3]-1>=0){const G=H+u-i,se=G*G+L;se<=S&&(S=se,C=P)}P+=4}}if(C>=0){const D=t.slice(C,C+4),j=e(D);if(j){const L=Math.floor(C/4/_),H=C/4-L*_;return{...j,pickedColor:D,pickedX:u+H,pickedY:c+L}}Xi.error("Picked non-existent layer. Is picking buffer corrupt?")()}return m$}function _$({pickedColors:t,decodePickingColor:e}){const i=new Map;if(t){for(let s=0;s=0){const a=t.slice(s,s+4),u=a.join(",");if(!i.has(u)){const c=e(a);c?i.set(u,{...c,color:a}):Xi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}function JM({pickInfo:t,viewports:e,pixelRatio:i,x:s,y:n,z:a}){let u=e[0];e.length>1&&(u=b$((t==null?void 0:t.pickedViewports)||e,{x:s,y:n}));let c;if(u){const _=[s-u.x,n-u.y];a!==void 0&&(_[2]=a),c=u.unproject(_)}return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:n,pixel:[s,n],coordinate:c,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:i}}function y$(t){const{pickInfo:e,lastPickedInfo:i,mode:s,layers:n}=t,{pickedColor:a,pickedLayer:u,pickedObjectIndex:c}=e,_=u?[u]:[];if(s==="hover"){const C=i.index,P=i.layerId,D=u?u.props.id:null;if(D!==P||c!==C){if(D!==P){const j=n.find(L=>L.props.id===P);j&&_.unshift(j)}i.layerId=D,i.index=c,i.info=null}}const w=JM(t),S=new Map;return S.set(null,w),_.forEach(C=>{let P={...w};C===u&&(P.color=a,P.index=c,P.picked=!0),P=GM({layer:C,info:P,mode:s});const D=P.layer;C===u&&s==="hover"&&(i.info=P),S.set(D.id,P),s==="hover"&&D.updateAutoHighlight(P)}),S}function GM({layer:t,info:e,mode:i}){for(;t&&e;){const s=e.layer||null;e.sourceLayer=s,e.layer=t,e=t.getPickingInfo({info:e,mode:i,sourceLayer:s}),t=t.parent}return e}function b$(t,e){for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.containsPixel(e))return s}return t[0]}class v${constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new ZM(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:i,layers:s,viewports:n},a=this.lastPickedInfo.info){const u=a&&a.layer&&a.layer.id,c=a&&a.viewport&&a.viewport.id,_=u?s.find(P=>P.id===u):null,w=c&&n.find(P=>P.id===c)||n[0],S=w&&w.unproject([e-w.x,i-w.y]);return{...a,...{x:e,y:i,viewport:w,coordinate:S,layer:_}}}_resizeBuffer(){var i,s;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const n=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=n}const{canvas:e}=this.device.getCanvasContext();(i=this.pickingFBO)==null||i.resize({width:e.width,height:e.height}),(s=this.depthFBO)==null||s.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const i=e.filter(s=>this.pickLayersPass.shouldDrawLayer(s)&&!s.isComposite);return i.length?i:null}_pickClosestObject({layers:e,views:i,viewports:s,x:n,y:a,radius:u=0,depth:c=1,mode:_="query",unproject3D:w,onViewportActive:S,effects:C}){const P=this.device.canvasContext.cssToDeviceRatio(),D=this._getPickable(e);if(!D||s.length===0)return{result:[],emptyInfo:JM({viewports:s,x:n,y:a,pixelRatio:P})};this._resizeBuffer();const j=this.device.canvasContext.cssToDevicePixels([n,a],!0),L=[j.x+Math.floor(j.width/2),j.y+Math.floor(j.height/2)],H=Math.round(u*P),{width:te,height:G}=this.pickingFBO,se=this._getPickingRect({deviceX:L[0],deviceY:L[1],deviceRadius:H,deviceWidth:te,deviceHeight:G}),ve={x:n-u,y:a-u,width:u*2+1,height:u*2+1};let Se;const ge=[],De=new Set;for(let Fe=0;Fe=w);Qe++){const He=ge[Qe];let Xe={color:He.pickedColor,layer:null,index:He.pickedObjectIndex,picked:!0,x:n,y:a,pixelRatio:D};Xe=GM({layer:He.pickedLayer,info:Xe,mode:_});const dt=Xe.layer.id;De.has(dt)||De.set(dt,new Set);const yt=De.get(dt),Ft=Xe.object??Xe.index;yt.has(Ft)||(yt.add(Ft),Fe.push(Xe))}return Fe}_drawAndSample({layers:e,views:i,viewports:s,onViewportActive:n,deviceRect:a,cullRect:u,effects:c,pass:_},w=!1){const S=w?this.depthFBO:this.pickingFBO,C={layers:e,layerFilter:this.layerFilter,views:i,viewports:s,onViewportActive:n,pickingFBO:S,deviceRect:a,cullRect:u,effects:c,pass:_,pickZ:w,preRenderStats:{}};for(const G of c)G.useInPicking&&(C.preRenderStats[G.id]=G.preRender(C));const{decodePickingColor:P}=this.pickLayersPass.render(C),{x:D,y:j,width:L,height:H}=a,te=new(w?Float32Array:Uint8Array)(L*H*4);return this.device.readPixelsToArrayWebGL(S,{sourceX:D,sourceY:j,sourceWidth:L,sourceHeight:H,target:te}),{pickedColors:te,decodePickingColor:P}}_getPickingRect({deviceX:e,deviceY:i,deviceRadius:s,deviceWidth:n,deviceHeight:a}){const u=Math.max(0,e-s),c=Math.max(0,i-s),_=Math.min(n,e+s+1)-u,w=Math.min(a,i+s+1)-c;return _<=0||w<=0?null:{x:u,y:c,width:_,height:w}}}const x$={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},w$="top-left",AI="__root";class T${constructor({deck:e,parentElement:i}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=i}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Xr(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(i=>i.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const i={};for(const s of this.resolvedWidgets)i[s.id]=s;this.resolvedWidgets.length=0;for(const s of this.defaultWidgets)i[s.id]=null,this.resolvedWidgets.push(s);for(let s of e){const n=i[s.id];n?n.viewId!==s.viewId||n.placement!==s.placement?(this._remove(n),this._add(s)):s!==n&&(n.setProps(s.props),s=n):this._add(s),i[s.id]=null,this.resolvedWidgets.push(s)}for(const s in i){const n=i[s];n&&this._remove(n)}this.widgets=e}_add(e){const{viewId:i=null,placement:s=w$}=e,n=e.onAdd({deck:this.deck,viewId:i});n&&this._getContainer(i,s).append(n),e._element=n}_remove(e){e.onRemove(),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,i){var u;const s=e||AI;let n=this.containers[s];n||(n=document.createElement("div"),n.style.pointerEvents="none",n.style.position="absolute",n.style.overflow="hidden",(u=this.parentElement)==null||u.append(n),this.containers[s]=n);let a=n.querySelector(`.${i}`);return a||(a=document.createElement("div"),a.className=i,a.style.position="absolute",a.style.zIndex="2",Object.assign(a.style,x$[i]),n.append(a)),a}_updateContainers(){const e=this.deck.width,i=this.deck.height;for(const s in this.containers){const n=this.lastViewports[s]||null,a=s===AI||n,u=this.containers[s];a?(u.style.display="block",u.style.left=`${n?n.x:0}px`,u.style.top=`${n?n.y:0}px`,u.style.width=`${n?n.width:e}px`,u.style.height=`${n?n.height:i}px`):u.style.display="none"}}onRedraw({viewports:e,layers:i}){var a,u;const s=e.reduce((c,_)=>(c[_.id]=_,c),{}),{lastViewports:n}=this;for(const c of this.getWidgets()){const{viewId:_}=c;if(_){const w=s[_];w&&(c.onViewportChange&&!w.equals(n[_])&&c.onViewportChange(w),(a=c.onRedraw)==null||a.call(c,{viewports:[w],layers:i}))}else{if(c.onViewportChange)for(const w of e)w.equals(n[w.id])||c.onViewportChange(w);(u=c.onRedraw)==null||u.call(c,{viewports:e,layers:i})}}this.lastViewports=s,this._updateContainers()}onHover(e,i){var s,n;for(const a of this.getWidgets()){const{viewId:u}=a;(!u||u===((s=e.viewport)==null?void 0:s.id))&&((n=a.onHover)==null||n.call(a,e,i))}}onEvent(e,i){var n,a;const s=xw[i.type];if(s)for(const u of this.getWidgets()){const{viewId:c}=u;(!c||c===((n=e.viewport)==null?void 0:n.id))&&((a=u[s.handler])==null||a.call(u,e,i))}}}const S$={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class E${constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const i=document.createElement("div");return i.className="deck-tooltip",Object.assign(i.style,S$),this.deck=e,this.element=i,i}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var i;this.isVisible&&e.id===((i=this.lastViewport)==null?void 0:i.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:i}=this,s=i&&i.props.getTooltip;if(!s)return;const n=s(e);this.lastViewport=e.viewport,this.setTooltip(n,e.x,e.y)}setTooltip(e,i,s){const n=this.element;if(n){if(typeof e=="string")n.innerText=e;else if(e)e.text&&(n.innerText=e.text),e.html&&(n.innerHTML=e.html),e.className&&(n.className=e.className);else{this.isVisible=!1,n.style.display="none";return}this.isVisible=!0,n.style.display="block",n.style.transform=`translate(${i}px, ${s}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(n.style,e.style)}}}var Wh;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Wh||(Wh={}));const Z1={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},js=(t,e,i)=>e?t.enable(i):t.disable(i),II=(t,e,i)=>t.hint(i,e),Vr=(t,e,i)=>t.pixelStorei(i,e),CI=(t,e,i)=>{const s=i===36006?36009:36008;return t.bindFramebuffer(s,e)},yp=(t,e,i)=>{const n={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[i];t.bindBuffer(n,e)};function hx(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const A$={3042:js,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:js,2885:(t,e)=>t.cullFace(e),2929:js,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:js,35723:II,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var i;return(i=t.bindTransformFeedback)==null?void 0:i.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:CI,36010:CI,34964:yp,36662:yp,36663:yp,35053:yp,35055:yp,2886:(t,e)=>t.frontFace(e),33170:II,2849:(t,e)=>t.lineWidth(e),32823:js,32824:"polygonOffset",10752:"polygonOffset",35977:js,32926:js,32928:js,32938:"sampleCoverage",32939:"sampleCoverage",3089:js,3088:(t,e)=>t.scissor(...e),2960:js,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:js,10754:js,12288:js,12289:js,12290:js,12291:js,12292:js,12293:js,12294:js,12295:js,3333:Vr,3317:Vr,37440:Vr,37441:Vr,37443:Vr,3330:Vr,3332:Vr,3331:Vr,3314:Vr,32878:Vr,3316:Vr,3315:Vr,32877:Vr,framebuffer:(t,e)=>{const i=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,i)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const i=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...i)},blendFunc:(t,e)=>{const i=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...i)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=hx(e)?e:[e,e];const[i,s]=e;t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,s)},stencilFunc:(t,e)=>{e=hx(e)&&e.length===3?[...e,...e]:e;const[i,s,n,a,u,c]=e;t.stencilFuncSeparate(1028,i,s,n),t.stencilFuncSeparate(1029,a,u,c)},stencilOp:(t,e)=>{e=hx(e)&&e.length===3?[...e,...e]:e;const[i,s,n,a,u,c]=e;t.stencilOpSeparate(1028,i,s,n),t.stencilOpSeparate(1029,a,u,c)},viewport:(t,e)=>t.viewport(...e)};function Ss(t,e,i){return e[t]!==void 0?e[t]:i[t]}const I$={blendEquation:(t,e,i)=>t.blendEquationSeparate(Ss(32777,e,i),Ss(34877,e,i)),blendFunc:(t,e,i)=>t.blendFuncSeparate(Ss(32969,e,i),Ss(32968,e,i),Ss(32971,e,i),Ss(32970,e,i)),polygonOffset:(t,e,i)=>t.polygonOffset(Ss(32824,e,i),Ss(10752,e,i)),sampleCoverage:(t,e,i)=>t.sampleCoverage(Ss(32938,e,i),Ss(32939,e,i)),stencilFuncFront:(t,e,i)=>t.stencilFuncSeparate(1028,Ss(2962,e,i),Ss(2967,e,i),Ss(2963,e,i)),stencilFuncBack:(t,e,i)=>t.stencilFuncSeparate(1029,Ss(34816,e,i),Ss(36003,e,i),Ss(36004,e,i)),stencilOpFront:(t,e,i)=>t.stencilOpSeparate(1028,Ss(2964,e,i),Ss(2965,e,i),Ss(2966,e,i)),stencilOpBack:(t,e,i)=>t.stencilOpSeparate(1029,Ss(34817,e,i),Ss(34818,e,i),Ss(34819,e,i))},PI={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,i)=>t({[e]:i}),hint:(t,e,i)=>t({[e]:i}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,i)=>t({36007:i}),bindTransformFeedback:(t,e,i)=>t({36389:i}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,i)=>{switch(e){case 36160:return t({36006:i,36010:i});case 36009:return t({36006:i});case 36008:return t({36010:i});default:return null}},bindBuffer:(t,e,i)=>{const s={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return s?t({[s]:i}):{valueChanged:!0}},blendColor:(t,e,i,s,n)=>t({32773:new Float32Array([e,i,s,n])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,i)=>t({32777:e,34877:i}),blendFunc:(t,e,i)=>t({32969:e,32968:i,32971:e,32970:i}),blendFuncSeparate:(t,e,i,s,n)=>t({32969:e,32968:i,32971:s,32970:n}),clearColor:(t,e,i,s,n)=>t({3106:new Float32Array([e,i,s,n])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,i,s,n)=>t({3107:[e,i,s,n]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,i)=>t({2928:new Float32Array([e,i])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,i)=>t({32824:e,10752:i}),sampleCoverage:(t,e,i)=>t({32938:e,32939:i}),scissor:(t,e,i,s,n)=>t({3088:new Int32Array([e,i,s,n])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,i)=>t({[e===1028?2968:36005]:i}),stencilFunc:(t,e,i,s)=>t({2962:e,2967:i,2963:s,34816:e,36003:i,36004:s}),stencilFuncSeparate:(t,e,i,s,n)=>t({[e===1028?2962:34816]:i,[e===1028?2967:36003]:s,[e===1028?2963:36004]:n}),stencilOp:(t,e,i,s)=>t({2964:e,2965:i,2966:s,34817:e,34818:i,34819:s}),stencilOpSeparate:(t,e,i,s,n)=>t({[e===1028?2964:34817]:i,[e===1028?2965:34818]:s,[e===1028?2966:34819]:n}),viewport:(t,e,i,s,n)=>t({2978:[e,i,s,n]})},Ko=(t,e)=>t.isEnabled(e),RI={3042:Ko,2884:Ko,2929:Ko,3024:Ko,32823:Ko,32926:Ko,32928:Ko,3089:Ko,2960:Ko,35977:Ko},C$=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Od(t,e){if(R$(e))return;const i={};for(const n in e){const a=Number(n),u=A$[n];u&&(typeof u=="string"?i[u]=!0:u(t,e[n],a))}const s=t.state&&t.state.cache;if(s)for(const n in i){const a=I$[n];a(t,e,s)}}function QM(t,e=Z1){if(typeof e=="number"){const n=e,a=RI[n];return a?a(t,n):t.getParameter(n)}const i=Array.isArray(e)?e:Object.keys(e),s={};for(const n of i){const a=RI[n];s[n]=a?a(t,Number(n)):t.getParameter(Number(n))}return s}function P$(t){Od(t,Z1)}function R$(t){for(const e in t)return!1;return!0}function M$(t,e){if(t===e)return!0;const i=Array.isArray(t)||ArrayBuffer.isView(t),s=Array.isArray(e)||ArrayBuffer.isView(e);if(i&&s&&t.length===e.length){for(let n=0;n{}}={}){J(this,"gl");J(this,"program",null);J(this,"stateStack",[]);J(this,"enable",!0);J(this,"cache");J(this,"log");this.gl=e,this.cache=i?QM(e):Object.assign({},Z1),this.log=s,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){ns(this.stateStack.length>0);const e=this.stateStack[this.stateStack.length-1];Od(this.gl,e),this.stateStack.pop()}_updateCache(e){let i=!1,s;const n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const a in e){ns(a!==void 0);const u=e[a],c=this.cache[a];M$(u,c)||(i=!0,s=c,n&&!(a in n)&&(n[a]=c),this.cache[a]=u)}return{valueChanged:i,oldValue:s}}}function Eu(t){return t.state}function ek(t,e){const{enable:i=!0,copyState:s}=e;if(ns(s!==void 0),!t.state){t.state=new k$(t,{copyState:s}),D$(t);for(const a in PI){const u=PI[a];O$(t,a,u)}MI(t,"getParameter"),MI(t,"isEnabled")}const n=Eu(t);return n.enable=i,t}function P0(t){let e=Eu(t);e||(ek(t,{copyState:!1}),e=Eu(t)),e.push()}function um(t){const e=Eu(t);ns(e),e.pop()}function MI(t,e){const i=t[e].bind(t);t[e]=function(n){if(n===void 0||C$.has(n))return i(n);const a=Eu(t);return n in a.cache||(a.cache[n]=i(n)),a.enable?a.cache[n]:i(n)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function O$(t,e,i){if(!t[e])return;const s=t[e].bind(t);t[e]=function(...a){const u=Eu(t),{valueChanged:c,oldValue:_}=i(u._updateCache,...a);return c&&s(...a),_},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function D$(t){const e=t.useProgram.bind(t);t.useProgram=function(s){const n=Eu(t);n.program!==s&&(e(s),n.program=s)}}const F$={powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function N$(t,e){e={...F$,...e};let i=null;const s=a=>i=a.statusMessage||i;t.addEventListener("webglcontextcreationerror",s,!1);let n=null;if(n||(n=t.getContext("webgl2",e)),t.removeEventListener("webglcontextcreationerror",s,!1),!n)throw new Error(`Failed to create WebGL context: ${i||"Unknown error"}`);if(e.onContextLost){const{onContextLost:a}=e;t.addEventListener("webglcontextlost",u=>a(u),!1)}if(e.onContextRestored){const{onContextRestored:a}=e;t.addEventListener("webglcontextrestored",u=>a(u),!1)}return n}function rc(t,e,i){return i[e]===void 0&&(i[e]=t.getExtension(e)||null),i[e]}function B$(t,e){const i=t.getParameter(7936),s=t.getParameter(7937);rc(t,"WEBGL_debug_renderer_info",e);const n=e.WEBGL_debug_renderer_info,a=t.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),u=t.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),c=a||i,_=u||s,w=t.getParameter(7938),S=tk(c,_),C=L$(c,_),P=z$(c,_);return{type:"webgl",gpu:S,gpuType:P,gpuBackend:C,vendor:c,renderer:_,version:w,shadingLanguage:"glsl",shadingLanguageVersion:300}}function tk(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function L$(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function z$(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(tk(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function ik(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Fn="texture-compression-bc",Wi="texture-compression-astc",Yo="texture-compression-etc2",U$="texture-compression-etc1-webgl",v_="texture-compression-pvrtc-webgl",dx="texture-compression-atc-webgl",bp="float32-renderable-webgl",fx="float16-renderable-webgl",V$="rgb9e5ufloat_renderable-webgl",px="snorm8-renderable-webgl",vp="norm16-renderable-webgl",mx="snorm16-renderable-webgl",x_="float32-filterable",kI="float16-filterable-webgl",Rp="WEBGL_compressed_texture_s3tc",Mp="WEBGL_compressed_texture_s3tc_srgb",Hh="EXT_texture_compression_rgtc",qh="EXT_texture_compression_bptc",j$="WEBGL_compressed_texture_etc",$$="WEBGL_compressed_texture_astc",W$="WEBGL_compressed_texture_etc1",H$="WEBGL_compressed_texture_pvrtc",q$="WEBGL_compressed_texture_atc",OI="EXT_texture_norm16",DI="EXT_render_snorm",X$="EXT_color_buffer_float",K1={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat_renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[DI],"norm16-renderable-webgl":[OI],"snorm16-renderable-webgl":[OI,DI],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[Rp,Mp,Hh,qh],"texture-compression-bc5-webgl":[Hh],"texture-compression-bc7-webgl":[qh],"texture-compression-etc2":[j$],"texture-compression-astc":[$$],"texture-compression-etc1-webgl":[W$],"texture-compression-pvrtc-webgl":[H$],"texture-compression-atc-webgl":[q$]};function Z$(t){return t in K1}function K$(t,e,i){return(K1[e]||[]).every(n=>rc(t,n,i))}const R0={"rgb8unorm-unsized":{gl:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,rb:!0},r8snorm:{gl:36756,b:1,c:1,render:px},r8uint:{gl:33330,b:1,c:1,rb:!0},r8sint:{gl:33329,b:1,c:1,rb:!0},rg8unorm:{gl:33323,b:2,c:2,rb:!0},rg8snorm:{gl:36757,b:2,c:2,render:px},rg8uint:{gl:33336,b:2,c:2,rb:!0},rg8sint:{gl:33335,b:2,c:2,rb:!0},r16uint:{gl:33332,b:2,c:1,rb:!0},r16sint:{gl:33331,b:2,c:1,rb:!0},r16float:{gl:33325,b:2,c:1,render:fx,filter:"float16-filterable-webgl",rb:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:vp,rb:!0},"r16snorm-webgl":{gl:36760,b:2,c:1,f:mx},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,rb:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,rb:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,rb:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,b:4,c:4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4,render:px},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:fx,filter:kI,rb:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,render:vp},"rg16snorm-webgl":{gl:36761,b:2,c:2,render:mx},r32uint:{gl:33334,b:4,c:1,bpp:4,rb:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,rb:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:bp,filter:x_},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:V$},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:bp,rb:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,rb:!0},"rgb10a2uint-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,rb:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:vp},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:vp},rg32uint:{gl:33340,b:8,c:2,rb:!0},rg32sint:{gl:33339,b:8,c:2,rb:!0},rg32float:{gl:33328,b:8,c:2,render:bp,filter:x_,rb:!0},rgba16uint:{gl:36214,b:8,c:4,rb:!0},rgba16sint:{gl:36232,b:8,c:4,rb:!0},rgba16float:{gl:34842,b:8,c:4,render:fx,filter:kI},"rgba16unorm-webgl":{gl:32859,b:2,c:4,render:vp,rb:!0},"rgba16snorm-webgl":{gl:36763,b:2,c:4,render:mx},"rgb32float-webgl":{gl:34837,render:bp,filter:x_,gl2ext:X$,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,rb:!0},rgba32sint:{gl:36226,b:16,c:4,rb:!0},rgba32float:{gl:34836,b:16,c:4,render:bp,filter:x_,rb:!0},stencil8:{gl:36168,b:1,c:1,attachment:36128,rb:!0},depth16unorm:{gl:33189,b:2,c:1,attachment:36096,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096,dataFormat:6402,types:[5125]},depth32float:{gl:36012,b:4,c:1,attachment:36096,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,dataFormat:34041,types:[34042],rb:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Rp,f:Fn},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:Mp,f:Fn},"bc1-rgba-unorm":{gl:33777,x:Rp,f:Fn},"bc1-rgba-unorm-srgb":{gl:35916,x:Mp,f:Fn},"bc2-rgba-unorm":{gl:33778,x:Rp,f:Fn},"bc2-rgba-unorm-srgb":{gl:35918,x:Mp,f:Fn},"bc3-rgba-unorm":{gl:33779,x:Rp,f:Fn},"bc3-rgba-unorm-srgb":{gl:35919,x:Mp,f:Fn},"bc4-r-unorm":{gl:36283,x:Hh,f:Fn},"bc4-r-snorm":{gl:36284,x:Hh,f:Fn},"bc5-rg-unorm":{gl:36285,x:Hh,f:Fn},"bc5-rg-snorm":{gl:36286,x:Hh,f:Fn},"bc6h-rgb-ufloat":{gl:36495,x:qh,f:Fn},"bc6h-rgb-float":{gl:36494,x:qh,f:Fn},"bc7-rgba-unorm":{gl:36492,x:qh,f:Fn},"bc7-rgba-unorm-srgb":{gl:36493,x:qh,f:Fn},"etc2-rgb8unorm":{gl:37492,f:Yo},"etc2-rgb8unorm-srgb":{gl:37494,f:Yo},"etc2-rgb8a1unorm":{gl:37496,f:Yo},"etc2-rgb8a1unorm-srgb":{gl:37497,f:Yo},"etc2-rgba8unorm":{gl:37493,f:Yo},"etc2-rgba8unorm-srgb":{gl:37495,f:Yo},"eac-r11unorm":{gl:37488,f:Yo},"eac-r11snorm":{gl:37489,f:Yo},"eac-rg11unorm":{gl:37490,f:Yo},"eac-rg11snorm":{gl:37491,f:Yo},"astc-4x4-unorm":{gl:37808,f:Wi},"astc-4x4-unorm-srgb":{gl:37840,f:Wi},"astc-5x4-unorm":{gl:37809,f:Wi},"astc-5x4-unorm-srgb":{gl:37841,f:Wi},"astc-5x5-unorm":{gl:37810,f:Wi},"astc-5x5-unorm-srgb":{gl:37842,f:Wi},"astc-6x5-unorm":{gl:37811,f:Wi},"astc-6x5-unorm-srgb":{gl:37843,f:Wi},"astc-6x6-unorm":{gl:37812,f:Wi},"astc-6x6-unorm-srgb":{gl:37844,f:Wi},"astc-8x5-unorm":{gl:37813,f:Wi},"astc-8x5-unorm-srgb":{gl:37845,f:Wi},"astc-8x6-unorm":{gl:37814,f:Wi},"astc-8x6-unorm-srgb":{gl:37846,f:Wi},"astc-8x8-unorm":{gl:37815,f:Wi},"astc-8x8-unorm-srgb":{gl:37847,f:Wi},"astc-10x5-unorm":{gl:37819,f:Wi},"astc-10x5-unorm-srgb":{gl:37851,f:Wi},"astc-10x6-unorm":{gl:37817,f:Wi},"astc-10x6-unorm-srgb":{gl:37849,f:Wi},"astc-10x8-unorm":{gl:37818,f:Wi},"astc-10x8-unorm-srgb":{gl:37850,f:Wi},"astc-10x10-unorm":{gl:37819,f:Wi},"astc-10x10-unorm-srgb":{gl:37851,f:Wi},"astc-12x10-unorm":{gl:37820,f:Wi},"astc-12x10-unorm-srgb":{gl:37852,f:Wi},"astc-12x12-unorm":{gl:37821,f:Wi},"astc-12x12-unorm-srgb":{gl:37853,f:Wi},"pvrtc-rgb4unorm-webgl":{gl:35840,f:v_},"pvrtc-rgba4unorm-webgl":{gl:35842,f:v_},"pvrtc-rbg2unorm-webgl":{gl:35841,f:v_},"pvrtc-rgba2unorm-webgl":{gl:35843,f:v_},"etc1-rbg-unorm-webgl":{gl:36196,f:U$},"atc-rgb-unorm-webgl":{gl:35986,f:dx},"atc-rgba-unorm-webgl":{gl:35986,f:dx},"atc-rgbai-unorm-webgl":{gl:34798,f:dx}},Y$={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},J$={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function Y1(t,e,i){const s=R0[e];if(!s||s.gl===void 0)return!1;const n=s.x||s.gl2ext;return n?!!rc(t,n,i):!0}function sk(t){const e=R0[t],i=e==null?void 0:e.gl;if(i===void 0)throw new Error(`Unsupported texture format ${t}`);return i}function G$(t,e,i){if(!Y1(t,e,i)||e.startsWith("depth")||e.startsWith("stencil"))return!1;try{if(dM(e).signed)return!1}catch{return!1}return e.endsWith("32float")?!!rc(t,"OES_texture_float_linear, extensions",i):e.endsWith("16float")?!!rc(t,"OES_texture_half_float_linear, extensions",i):!0}function Q$(t,e,i){return!(!Y1(t,e,i)||typeof e=="number")}function Ey(t){var n;const e=R0[t],i=sk(t),s=dM(t);return{format:i,dataFormat:(e==null?void 0:e.dataFormat)||t9(s.format,s.integer,s.normalized,i),type:s.dataType?ik(s.dataType):((n=e==null?void 0:e.types)==null?void 0:n[0])||5121,compressed:s.compressed}}function e9(t){const e=R0[t];if(!(e!=null&&e.attachment))throw new Error(`${t} is not a depth stencil format`);return e.attachment}function FI(t){const e=Ey(t),i=Y$[e.dataFormat]||4,s=J$[e.type]||1;return i*s}function t9(t,e,i,s){if(s===6408||s===6407)return s;switch(t){case"r":return e&&!i?36244:6403;case"rg":return e&&!i?33320:33319;case"rgb":return e&&!i?36248:6407;case"rgba":return e&&!i?36249:6408;default:return 6408}}const NI={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class i9 extends FU{constructor(i,s,n){super([],n);J(this,"gl");J(this,"extensions");J(this,"testedFeatures",new Set);this.gl=i,this.extensions=s,rc(i,"EXT_color_buffer_float",s)}*[Symbol.iterator](){const i=this.getFeatures();for(const s of i)this.has(s)&&(yield s);return[]}has(i){return this.disabledFeatures[i]?!1:(this.testedFeatures.has(i)||(this.testedFeatures.add(i),Z$(i)&&K$(this.gl,i,this.extensions)&&this.features.add(i),this.getWebGLFeature(i)&&this.features.add(i)),this.features.has(i))}initializeFeatures(){const i=this.getFeatures().filter(s=>s!=="polygon-mode-webgl");for(const s of i)this.has(s)}getFeatures(){return[...Object.keys(NI),...Object.keys(K1)]}getWebGLFeature(i){const s=NI[i];return typeof s=="string"?!!rc(this.gl,s,this.extensions):!!s}}class s9 extends DU{constructor(i){super();J(this,"gl");J(this,"limits",{});this.gl=i}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(i){return this.limits[i]===void 0&&(this.limits[i]=this.gl.getParameter(i)),this.limits[i]}}function ql(t,e,i){if(n9(e))return i(t);const{nocatch:s=!0}=e;P0(t),Od(t,e);let n;if(s)n=i(t),um(t);else try{n=i(t)}finally{um(t)}return n}function n9(t){for(const e in t)return!1;return!0}function r9(t,e,i,s){if(cy(e))return s(t);const n=t;P0(n.gl);try{return o9(t,e),Od(n.gl,i),s(t)}finally{um(n.gl)}}function o9(t,e){const i=t,{gl:s}=i;if(e.cullMode)switch(e.cullMode){case"none":s.disable(2884);break;case"front":s.enable(2884),s.cullFace(1028);break;case"back":s.enable(2884),s.cullFace(1029);break}if(e.frontFace&&s.frontFace(bu("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&s.enable(34383),e.depthBias!==void 0&&(s.enable(32823),s.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const a=i.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,u=bu("provokingVertex",e.provokingVertex,{first:36429,last:36430});a==null||a.provokingVertexWEBGL(u)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const a=i.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,u=bu("polygonMode",e.polygonMode,{fill:6914,line:6913});a==null||a.polygonModeWEBGL(1028,u),a==null||a.polygonModeWEBGL(1029,u)}e.polygonOffsetLine&&s.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&s.enable(12288),e.clipDistance1&&s.enable(12289),e.clipDistance2&&s.enable(12290),e.clipDistance3&&s.enable(12291),e.clipDistance4&&s.enable(12292),e.clipDistance5&&s.enable(12293),e.clipDistance6&&s.enable(12294),e.clipDistance7&&s.enable(12295)),e.depthWriteEnabled!==void 0&&s.depthMask(l9("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?s.enable(2929):s.disable(2929),s.depthFunc(Cw("depthCompare",e.depthCompare))),e.stencilWriteMask){const n=e.stencilWriteMask;s.stencilMaskSeparate(1028,n),s.stencilMaskSeparate(1029,n)}if(e.stencilReadMask&<.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const n=e.stencilReadMask||4294967295,a=Cw("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?s.enable(2960):s.disable(2960),s.stencilFuncSeparate(1028,a,0,n),s.stencilFuncSeparate(1029,a,0,n)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const n=gx("stencilPassOperation",e.stencilPassOperation),a=gx("stencilFailOperation",e.stencilFailOperation),u=gx("stencilDepthFailOperation",e.stencilDepthFailOperation);s.stencilOpSeparate(1028,a,u,n),s.stencilOpSeparate(1029,a,u,n)}if(e.blendColorOperation||e.blendAlphaOperation){s.enable(3042);const n=BI("blendColorOperation",e.blendColorOperation||"add"),a=BI("blendAlphaOperation",e.blendAlphaOperation||"add");s.blendEquationSeparate(n,a);const u=w_("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=w_("blendColorDstFactor",e.blendColorDstFactor||"zero"),_=w_("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),w=w_("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");s.blendFuncSeparate(u,c,_,w)}}function Cw(t,e){return bu(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function gx(t,e){return bu(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function BI(t,e){return bu(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function w_(t,e){return bu(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function a9(t,e){return`Illegal parameter ${e} for ${t}`}function bu(t,e,i){if(!(e in i))throw new Error(a9(t,e));return i[e]}function l9(t,e){return e}function nk(t){const e={};return t.addressModeU&&(e[10242]=_x(t.addressModeU)),t.addressModeV&&(e[10243]=_x(t.addressModeV)),t.addressModeW&&(e[32882]=_x(t.addressModeW)),t.magFilter&&(e[10240]=rk(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=c9(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=Cw("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function _x(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function rk(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function c9(t,e){if(!e)return rk(t);switch(t){case"nearest":return e==="nearest"?9984:9986;case"linear":return e==="nearest"?9985:9987}}class Yl extends Ns{constructor(i,s={}){super(i,s);J(this,"device");J(this,"gl");J(this,"handle");J(this,"glTarget");J(this,"glUsage");J(this,"glIndexType",5123);J(this,"byteLength");J(this,"bytesUsed");this.device=i,this.gl=this.device.gl;const n=typeof s=="object"?s.handle:void 0;this.handle=n||this.gl.createBuffer(),i.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=u9(this.props.usage),this.glUsage=h9(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,s.data?this._initWithData(s.data,s.byteOffset,s.byteLength):this._initWithByteLength(s.byteLength||0)}_initWithData(i,s=0,n=i.byteLength+s){const a=this.glTarget;this.gl.bindBuffer(a,this.handle),this.gl.bufferData(a,n,this.glUsage),this.gl.bufferSubData(a,s,i),this.gl.bindBuffer(a,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(i,s,n),this.trackAllocatedMemory(n)}_initWithByteLength(i){ns(i>=0);let s=i;i===0&&(s=new Float32Array(0));const n=this.glTarget;return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,s,this.glUsage),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(null,0,i),this.trackAllocatedMemory(i),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(i,s=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,s,i),this.gl.bindBuffer(36663,null),this._setDebugData(i,s,i.byteLength)}async readAsync(i=0,s){return this.readSyncWebGL(i,s)}readSyncWebGL(i=0,s){s=s??this.byteLength-i;const n=new Uint8Array(s),a=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,n,a,s),this.gl.bindBuffer(36662,null),this._setDebugData(n,i,s),n}}function u9(t){return t&Ns.INDEX?34963:t&Ns.VERTEX?34962:t&Ns.UNIFORM?35345:34962}function h9(t){return t&Ns.INDEX||t&Ns.VERTEX?35044:t&Ns.UNIFORM?35048:35044}class Pw extends dy{constructor(i,s){super(i,s);J(this,"device");J(this,"handle");J(this,"parameters");this.device=i,this.parameters=nk(s),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(i){for(const[s,n]of Object.entries(i)){const a=Number(s);switch(a){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,a,n);break;default:this.device.gl.samplerParameteri(this.handle,a,n);break}}}}class Xh extends uy{constructor(i,s){super(i,{...ao.defaultProps,...s});J(this,"device");J(this,"gl");J(this,"handle");J(this,"texture");this.device=i,this.gl=this.device.gl,this.handle=null,this.texture=s.texture}}const d9={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},Yp=class Yp extends ao{constructor(i,s){var n;super(i,{...d9,format:"rgba8unorm",...s});J(this,"MAX_ATTRIBUTES");J(this,"device");J(this,"gl");J(this,"handle");J(this,"sampler");J(this,"view");J(this,"glFormat");J(this,"type");J(this,"dataFormat");J(this,"mipmaps");J(this,"target");J(this,"textureUnit");J(this,"loaded",!1);J(this,"_video");this.device=i,this.gl=this.device.gl,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=f9(this.props),this.loaded=!1,typeof((n=this.props)==null?void 0:n.data)=="string"&&Object.assign(this.props,{data:w5(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}createView(i){return new Xh(this.device,{...i,texture:this})}initialize(i={}){if(this.props.dimension==="cube")return this.initializeCube(i);let s=i.data;if(s instanceof Promise)return s.then(te=>this.initialize(Object.assign({},i,{pixels:te,data:te}))),this;const n=typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement;if(n&&s.readyStatethis.initialize(i)),this;const{parameters:a={}}=i,{pixels:u=null,pixelStore:c={},textureUnit:_=void 0,mipmaps:w=!0}=i;s||(s=u);let{width:S,height:C,dataFormat:P,type:D,compressed:j=!1}=i;const{depth:L=0}=i,H=sk(i.format);return{width:S,height:C,compressed:j,dataFormat:P,type:D}=this._deduceParameters({format:i.format,type:D,dataFormat:P,compressed:j,data:s,width:S,height:C}),this.width=S,this.height=C,this.glFormat=H,this.type=D,this.dataFormat=P,this.textureUnit=_,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),this.mipmaps=w,this.setImageData({data:s,width:S,height:C,depth:L,format:H,type:D,dataFormat:P,parameters:c,compressed:j}),this.setSampler(i.sampler),this._setSamplerParameters(a),this.view=this.createView({...this.props,mipLevelCount:1,arrayLayerCount:1}),w&&this.device.isTextureFormatFilterable(i.format)&&this.generateMipmap(),n&&(this._video={video:s,parameters:a,lastTime:s.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?s.currentTime:-1}),this}initializeCube(i){const{mipmaps:s=!0,parameters:n={}}=i;return this.setCubeMapImageData(i).then(()=>{this.loaded=!0,s&&this.generateMipmap(i),this.setSampler(i.sampler),this._setSamplerParameters(n)}),this}setSampler(i={}){let s;i instanceof Pw?(this.sampler=i,s=i.props):(this.sampler=new Pw(this.device,i),s=i);const n=nk(s);return this._setSamplerParameters(n),this}resize(i){const{height:s,width:n,mipmaps:a=!1}=i;return n!==this.width||s!==this.height?this.initialize({width:n,height:s,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:a}):this}update(){if(this._video){const{video:i,parameters:s,lastTime:n}=this._video;if(n===i.currentTime||i.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this}setImageData(i){if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(i);this.trackDeallocatedMemory("Texture");const{target:s=this.target,pixels:n=null,level:a=0,glFormat:u=this.glFormat,offset:c=0,parameters:_={}}=i;let{data:w=null,type:S=this.type,width:C=this.width,height:P=this.height,dataFormat:D=this.dataFormat,compressed:j=!1}=i;w||(w=n),{type:S,dataFormat:D,compressed:j,width:C,height:P}=this._deduceParameters({format:this.props.format,type:S,dataFormat:D,compressed:j,data:w,width:C,height:P});const{gl:L}=this;L.bindTexture(this.target,this.handle);let H=null;if({data:w,dataType:H}=this._getDataType({data:w,compressed:j}),ql(this.gl,_,()=>{switch(H){case"null":L.texImage2D(s,a,u,C,P,0,D,S,w);break;case"typed-array":L.texImage2D(s,a,u,C,P,0,D,S,w,c);break;case"buffer":this.device.gl.bindBuffer(35052,w.handle||w),this.device.gl.texImage2D(s,a,u,C,P,0,D,S,c),this.device.gl.bindBuffer(35052,null);break;case"browser-object":L.texImage2D(s,a,u,C,P,0,D,S,w);break;case"compressed":for(const[te,G]of w.entries())L.compressedTexImage2D(s,te,G.format,G.width,G.height,0,G.data);break;default:ns(!1,"Unknown image data type")}}),w&&w.byteLength)this.trackAllocatedMemory(w.byteLength,"Texture");else{const te=FI(this.props.format);this.trackAllocatedMemory(this.width*this.height*te,"Texture")}return this.loaded=!0,this}setSubImageData({target:i=this.target,pixels:s=null,data:n=null,x:a=0,y:u=0,width:c=this.width,height:_=this.height,level:w=0,glFormat:S=this.glFormat,type:C=this.type,dataFormat:P=this.dataFormat,compressed:D=!1,offset:j=0,parameters:L={}}){if({type:C,dataFormat:P,compressed:D,width:c,height:_}=this._deduceParameters({format:this.props.format,type:C,dataFormat:P,compressed:D,data:n,width:c,height:_}),ns(this.depth===1,"texSubImage not supported for 3D textures"),n||(n=s),n&&n.data){const H=n;n=H.data,c=H.shape[0],_=H.shape[1]}n instanceof Yl&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),ql(this.gl,L,()=>{D?this.gl.compressedTexSubImage2D(i,w,a,u,c,_,S,n):n===null?this.gl.texSubImage2D(i,w,a,u,c,_,P,C,null):ArrayBuffer.isView(n)?this.gl.texSubImage2D(i,w,a,u,c,_,P,C,n,j):typeof WebGLBuffer<"u"&&n instanceof WebGLBuffer?(this.device.gl.bindBuffer(35052,n),this.device.gl.texSubImage2D(i,w,a,u,c,_,P,C,j),this.device.gl.bindBuffer(35052,null)):this.device.gl.texSubImage2D(i,w,a,u,c,_,P,C,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(i={}){return lt.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(i=this.textureUnit){const{gl:s}=this;return i!==void 0&&(this.textureUnit=i,s.activeTexture(33984+i)),s.bindTexture(this.target,this.handle),i}unbind(i=this.textureUnit){const{gl:s}=this;return i!==void 0&&(this.textureUnit=i,s.activeTexture(33984+i)),s.bindTexture(this.target,null),i}_getDataType({data:i,compressed:s=!1}){return s?{data:i,dataType:"compressed"}:i===null?{data:i,dataType:"null"}:ArrayBuffer.isView(i)?{data:i,dataType:"typed-array"}:i instanceof Yl?{data:i.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&i instanceof WebGLBuffer?{data:i,dataType:"buffer"}:{data:i,dataType:"browser-object"}}_deduceParameters(i){const{format:s,data:n}=i;let{width:a,height:u,dataFormat:c,type:_,compressed:w}=i;const S=Ey(s);return c=c||S.dataFormat,_=_||S.type,w=w||S.compressed,{width:a,height:u}=this._deduceImageSize(n,a,u),{dataFormat:c,type:_,compressed:w,width:a,height:u,format:s,data:n}}_deduceImageSize(i,s,n){let a;return typeof ImageData<"u"&&i instanceof ImageData?a={width:i.width,height:i.height}:typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement?a={width:i.naturalWidth,height:i.naturalHeight}:typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement?a={width:i.width,height:i.height}:typeof ImageBitmap<"u"&&i instanceof ImageBitmap?a={width:i.width,height:i.height}:typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?a={width:i.videoWidth,height:i.videoHeight}:i?a={width:s,height:n}:a={width:s>=0?s:1,height:n>=0?n:1},ns(a,"Could not deduced texture size"),ns(s===void 0||a.width===s,"Deduced texture width does not match supplied width"),ns(n===void 0||a.height===n,"Deduced texture height does not match supplied height"),a}async setCubeMapImageData(i){const{gl:s}=this,{width:n,height:a,pixels:u,data:c,format:_=6408,type:w=5121}=i,S=u||c,C=await Promise.all(Yp.FACES.map(P=>{const D=S[P];return Promise.all(Array.isArray(D)?D:[D])}));this.bind(),Yp.FACES.forEach((P,D)=>{C[D].length>1&&this.props.mipmaps!==!1&<.warn(`${this.id} has mipmap and multiple LODs.`)(),C[D].forEach((j,L)=>{n&&a?s.texImage2D(P,L,_,n,a,0,_,w,j):s.texImage2D(P,L,_,_,w,j)})}),this.unbind()}setImageDataForFace(i){const{face:s,width:n,height:a,pixels:u,data:c,format:_=6408,type:w=5121}=i,{gl:S}=this,C=u||c;return this.bind(),C instanceof Promise?C.then(P=>this.setImageDataForFace(Object.assign({},i,{face:s,data:P,pixels:P}))):this.width||this.height?S.texImage2D(s,0,_,n,a,0,_,w,C):S.texImage2D(s,0,_,_,w,C),this}setImageData3D(i){const{level:s=0,dataFormat:n,format:a,type:u,width:c,height:_,depth:w=1,offset:S=0,data:C,parameters:P={}}=i;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);const D=Ey(a);if(ql(this.gl,P,()=>{ArrayBuffer.isView(C)&&this.gl.texImage3D(this.target,s,D.format,c,_,w,0,D.dataFormat,D.type,C),C instanceof Yl&&(this.gl.bindBuffer(35052,C.handle),this.gl.texImage3D(this.target,s,n,c,_,w,0,a,u,S))}),C&&C.byteLength)this.trackAllocatedMemory(C.byteLength,"Texture");else{const j=FI(this.props.format);this.trackAllocatedMemory(this.width*this.height*this.depth*j,"Texture")}return this.loaded=!0,this}_setSamplerParameters(i){if(!cy(i)){p9(i),this.gl.bindTexture(this.target,this.handle);for(const[s,n]of Object.entries(i)){const a=Number(s),u=n;switch(a){case 33082:case 33083:this.gl.texParameterf(this.target,a,u);break;default:this.gl.texParameteri(this.target,a,u);break}}this.gl.bindTexture(this.target,null)}}};J(Yp,"FACES",[34069,34070,34071,34072,34073,34074]);let ra=Yp;function f9(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(t.dimension)}}function p9(t){lt.log(1,"texture sampler parameters",t)()}class jp extends fy{constructor(i,s){super(i,s);J(this,"device");J(this,"gl");J(this,"handle");const n=s.handle===null;if(this.device=i,this.gl=i.gl,this.handle=this.props.handle||n?this.props.handle:this.gl.createFramebuffer(),!n){i.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures();const a=this.gl.bindFramebuffer(36160,this.handle);for(let u=0;ult.info("Spector capture started:",e)()),Hi==null||Hi.onCapture.add(e=>{lt.info("Spector capture complete:",e)(),Hi==null||Hi.getResultUI(),Hi==null||Hi.resultView.display(),Hi==null||Hi.resultView.addCapture(e)})),t!=null&&t.canvas){if(typeof t.spector=="string"&&t.spector!==t.canvas.id)return Hi;Hi==null||Hi.startCapture(t==null?void 0:t.canvas,500),new Promise(e=>setTimeout(e,2e3)).then(e=>{lt.info("Spector capture stopped after 2 seconds")(),Hi==null||Hi.stopCapture()})}return Hi}const T9="https://unpkg.com/webgl-debug@2.0.1/index.js";function ok(t){return t.luma=t.luma||{},t.luma}async function S9(){pc()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await vM(T9))}function E9(t,e={}){return t?e.debug?I9(t,e):A9(t):null}function A9(t){const e=ok(t);return e.realContext?e.realContext:t}function I9(t,e){if(!globalThis.WebGLDebugUtils)return lt.warn("webgl-debug not loaded")(),t;const i=ok(t);if(i.debugContext)return i.debugContext;globalThis.WebGLDebugUtils.init({...Wh,...t});const s=globalThis.WebGLDebugUtils.makeDebugContext(t,C9.bind(null,e),P9.bind(null,e));for(const u in Wh)!(u in s)&&typeof Wh[u]=="number"&&(s[u]=Wh[u]);class n{}Object.setPrototypeOf(s,Object.getPrototypeOf(t)),Object.setPrototypeOf(n,s);const a=Object.create(n);return i.realContext=t,i.debugContext=a,a.debug=!0,a}function yx(t,e){e=Array.from(e).map(s=>s===void 0?"undefined":s);let i=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return i=`${i.slice(0,100)}${i.length>100?"...":""}`,`gl.${t}(${i})`}function C9(t,e,i,s){s=Array.from(s).map(c=>c===void 0?"undefined":c);const n=globalThis.WebGLDebugUtils.glEnumToString(e),a=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,s),u=`${n} in gl.${i}(${a})`;lt.error(u)();debugger;if(t.throwOnError)throw new Error(u)}function P9(t,e,i){let s="";if(lt.level>=1&&(s=yx(e,i),lt.log(1,s)()),t.break&&t.break.length>0&&(s=s||yx(e,i),t.break.every(a=>s.indexOf(a)!==-1)))debugger;for(const n of i)if(n===void 0){if(s=s||yx(e,i),t.throwOnError)throw new Error(`Undefined argument: ${s}`);lt.error(`Undefined argument: ${s}`)();debugger}}function R9(t){const e=t.split(/\r?\n/),i=[];for(const s of e){if(s.length<=1)continue;const n=s.split(":");if(n.length===2){const[C,P]=n;i.push({message:P.trim(),type:zI(C),lineNum:0,linePos:0});continue}const[a,u,c,..._]=n;let w=parseInt(c,10);isNaN(w)&&(w=0);let S=parseInt(u,10);isNaN(S)&&(S=0),i.push({message:_.join(":").trim(),type:zI(a),lineNum:w,linePos:S})}return i}function zI(t){const e=["warning","error","info"],i=t.toLowerCase();return e.includes(i)?i:"info"}class M9 extends hy{constructor(i,s){super(i,s);J(this,"device");J(this,"handle");switch(this.device=i,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const i=this.device.gl.getShaderInfoLog(this.handle);return R9(i)}getTranslatedSource(){const s=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return s==null?void 0:s.getTranslatedShaderSource(this.handle)}async _compile(i){i=(a=>a.startsWith("#version ")?a:`#version 100 -${a}`)(i);const{gl:n}=this.device;if(n.shaderSource(this.handle,i),n.compileShader(this.handle),lt.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}lt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),lt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const i=async a=>await new Promise(u=>setTimeout(u,a));if(!this.device.features.has("compilation-status-async-webgl")){await i(10);return}const{gl:n}=this.device;for(;;){if(n.getShaderParameter(this.handle,37297))return;await i(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}const k9=256,O9=1024,D9=16384,bx=6144,F9=[1,2,4,8];class N9 extends cw{constructor(i,s){super(i,s);J(this,"device");J(this,"glParameters");this.device=i,P0(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){um(this.device.gl)}pushDebugGroup(i){}popDebugGroup(){}insertDebugMarker(i){}setParameters(i={}){const s={...this.glParameters};this.props.framebuffer&&(s.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(s.depthMask=!this.props.depthReadOnly),s.stencilMask=this.props.stencilReadOnly?0:1,s[35977]=this.props.discard,i.viewport&&(i.viewport.length>=6?(s.viewport=i.viewport.slice(0,4),s.depthRange=[i.viewport[4],i.viewport[5]]):s.viewport=i.viewport),i.scissorRect&&(s.scissorTest=!0,s.scissor=i.scissorRect),i.blendConstant&&(s.blendColor=i.blendConstant),i.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),i[2967]=i.stencilReference),i.colorMask&&(s.colorMask=F9.map(n=>!!(n&i.colorMask))),this.glParameters=s,Od(this.device.gl,s)}beginOcclusionQuery(i){const s=this.props.occlusionQuerySet;s==null||s.beginOcclusionQuery()}endOcclusionQuery(){const i=this.props.occlusionQuerySet;i==null||i.endOcclusionQuery()}clear(){const i={...this.glParameters};let s=0;this.props.clearColor!==!1&&(s|=D9,i.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(s|=k9,i.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(s|=O9,i.clearStencil=this.props.clearStencil),s!==0&&ql(this.device.gl,i,()=>{this.device.gl.clear(s)})}clearColorBuffer(i=0,s=[0,0,0,0]){ql(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(s.constructor){case Int32Array:this.device.gl.clearBufferiv(bx,i,s);break;case Uint32Array:this.device.gl.clearBufferuiv(bx,i,s);break;case Float32Array:default:this.device.gl.clearBufferfv(bx,i,s);break}})}}const B9="Failed to deduce GL constant from typed array";function L9(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(B9)}}function Rw(t,e){const{clamped:i=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return i?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}const z9={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},U9={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class $p{constructor(...e){J(this,"offset");J(this,"stride");J(this,"type");J(this,"size");J(this,"divisor");J(this,"normalized");J(this,"integer");J(this,"buffer");J(this,"index");e.forEach(i=>this._assign(i)),Object.freeze(this)}static getBytesPerElement(e){return Rw(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return ns(e.size),Rw(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new $p(z9,...e)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return $p.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return $p.getBytesPerVertex(this)}_assign(e={}){return e=v5("Accessor",e,U9),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}}function V9(t){return j9.includes(t)}const j9=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],ak={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2","float32x2"],35665:[5126,3,"vec3","vec3","float32x3"],35666:[5126,4,"vec4","vec4","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2","sint32x2"],35668:[5124,3,"ivec3","vec3","sint32x3"],35669:[5124,4,"ivec4","vec4","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2","uint32x2"],36295:[5125,3,"uvec3","vec3","uint32x3"],36296:[5125,4,"uvec4","vec4","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2","float32x2"],35672:[5126,3,"bvec3","vec3","float32x3"],35673:[5126,4,"bvec4","vec4","float32x4"],35674:[5126,8,"mat2","mat2x2"],35685:[5126,8,"mat2x3","mat2x3"],35686:[5126,8,"mat2x4","mat2x4"],35687:[5126,12,"mat3x2","mat3x2"],35675:[5126,12,"mat3","mat3x3"],35688:[5126,12,"mat3x4","mat3x4"],35689:[5126,16,"mat4x2","mat4x2"],35690:[5126,16,"mat4x3","mat4x3"],35676:[5126,16,"mat4","mat4x4"]};function lk(t){const e=ak[t];if(!e)throw new Error("uniform");const[i,s,,n]=e;return{format:n,components:s,glType:i}}function $9(t){const e=ak[t];if(!e)throw new Error("attribute");const[,i,,s,n]=e;return{attributeType:s,vertexFormat:n,components:i}}function W9(t,e){const i={attributes:[],bindings:[]};i.attributes=H9(t,e);const s=Z9(t,e);for(const c of s){const _=c.uniforms.map(w=>({name:w.name,format:w.format,byteOffset:w.byteOffset,byteStride:w.byteStride,arrayLength:w.arrayLength}));i.bindings.push({type:"uniform",name:c.name,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:_})}const n=X9(t,e);let a=0;for(const c of n)if(V9(c.type)){const{viewDimension:_,sampleType:w}=Y9(c.type);i.bindings.push({type:"texture",name:c.name,location:a,viewDimension:_,sampleType:w}),c.textureUnit=a,a+=1}n.length&&(i.uniforms=n);const u=q9(t,e);return u!=null&&u.length&&(i.varyings=u),i}function H9(t,e){const i=[],s=t.getProgramParameter(e,35721);for(let n=0;n=0){const{attributeType:w}=$9(c),S=/instance/i.test(u)?"instance":"vertex";i.push({name:u,location:_,stepMode:S,type:w})}}return i.sort((n,a)=>n.location-a.location),i}function q9(t,e){const i=[],s=t.getProgramParameter(e,35971);for(let n=0;nn.location-a.location),i}function X9(t,e){const i=[],s=t.getProgramParameter(e,35718);for(let n=0;n1)for(let D=0;Dt.getActiveUniformBlockParameter(e,a,u),s=[],n=t.getProgramParameter(e,35382);for(let a=0;aa.location-u.location),s}const K9={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function Y9(t){const e=K9[t];if(!e)throw new Error("sampler");const[i,s]=e;return{viewDimension:i,sampleType:s}}function J9(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const i=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!i||i.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:i[1],length:i[2]?1:0,isArray:!!i[2]}}function G9(t,e,i,s){const n=t;let a=s;a===!0&&(a=1),a===!1&&(a=0);const u=typeof a=="number"?[a]:a;switch(i){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof s!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,s);case 5126:return t.uniform1fv(e,u);case 35664:return t.uniform2fv(e,u);case 35665:return t.uniform3fv(e,u);case 35666:return t.uniform4fv(e,u);case 5124:return t.uniform1iv(e,u);case 35667:return t.uniform2iv(e,u);case 35668:return t.uniform3iv(e,u);case 35669:return t.uniform4iv(e,u);case 35670:return t.uniform1iv(e,u);case 35671:return t.uniform2iv(e,u);case 35672:return t.uniform3iv(e,u);case 35673:return t.uniform4iv(e,u);case 5125:return n.uniform1uiv(e,u,1);case 36294:return n.uniform2uiv(e,u,2);case 36295:return n.uniform3uiv(e,u,3);case 36296:return n.uniform4uiv(e,u,4);case 35674:return t.uniformMatrix2fv(e,!1,u);case 35675:return t.uniformMatrix3fv(e,!1,u);case 35676:return t.uniformMatrix4fv(e,!1,u);case 35685:return n.uniformMatrix2x3fv(e,!1,u);case 35686:return n.uniformMatrix2x4fv(e,!1,u);case 35687:return n.uniformMatrix3x2fv(e,!1,u);case 35688:return n.uniformMatrix3x4fv(e,!1,u);case 35689:return n.uniformMatrix4x2fv(e,!1,u);case 35690:return n.uniformMatrix4x3fv(e,!1,u)}throw new Error("Illegal uniform")}function Q9(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function eW(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}const UI=4;class tW extends yd{constructor(i,s){super(i,s);J(this,"device");J(this,"handle");J(this,"vs");J(this,"fs");J(this,"introspectedLayout");J(this,"uniforms",{});J(this,"bindings",{});J(this,"varyings",null);J(this,"_uniformCount",0);J(this,"_uniformSetters",{});this.device=i,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=s.vs,this.fs=s.fs;const{varyings:n,bufferMode:a=35981}=s;switch(n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,a)),this._linkShaders(),lt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=W9(this.device.gl,this.handle),lt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=a5(this.introspectedLayout,s.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":lt.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(i,s){for(const[n,a]of Object.entries(i)){const u=this.shaderLayout.bindings.find(c=>c.name===n)||this.shaderLayout.bindings.find(c=>c.name===`${n}Uniforms`);if(!u){const c=this.shaderLayout.bindings.map(_=>`"${_.name}"`).join(", ");s!=null&&s.disableWarnings||lt.warn(`Unknown binding "${n}" in render pipeline "${this.id}", expected one of ${c}`)();continue}switch(a||lt.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),u.type){case"uniform":if(!(a instanceof Yl)&&!(a.buffer instanceof Yl))throw new Error("buffer value");break;case"texture":if(!(a instanceof Xh||a instanceof ra||a instanceof jp))throw new Error("texture value");break;case"sampler":lt.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(u.type)}this.bindings[n]=a}}draw(i){var H;const{renderPass:s,parameters:n=this.props.parameters,topology:a=this.props.topology,vertexArray:u,vertexCount:c,instanceCount:_,isInstanced:w=!1,firstVertex:S=0,transformFeedback:C}=i,P=Q9(a),D=!!u.indexBuffer,j=(H=u.indexBuffer)==null?void 0:H.glIndexType;if(this.linkStatus!=="success")return lt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||c===0)return lt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(c===0)return lt.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),u.bindBeforeRender(s),C&&C.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const L=s;return r9(this.device,n,L.glParameters,()=>{D&&w?this.device.gl.drawElementsInstanced(P,c||0,j,S,_||0):D?this.device.gl.drawElements(P,c||0,j,S):w?this.device.gl.drawArraysInstanced(P,S,c||0,_||0):this.device.gl.drawArrays(P,S,c||0),C&&C.end()}),u.unbindAfterRender(s),!0}setUniformsWebGL(i){const{bindings:s}=j1(i);Object.keys(s).forEach(n=>{lt.warn(`Unsupported value "${JSON.stringify(s[n])}" used in setUniforms() for key ${n}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,i)}async _linkShaders(){const{gl:i}=this.device;if(i.attachShader(this.handle,this.vs.handle),i.attachShader(this.handle,this.fs.handle),lt.time(UI,`linkProgram for ${this.id}`)(),i.linkProgram(this.handle),lt.timeEnd(UI,`linkProgram for ${this.id}`)(),lt.level,!this.device.features.has("compilation-status-async-webgl")){const n=this._getLinkStatus();this._reportLinkStatus(n);return}lt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),lt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const s=this._getLinkStatus();this._reportLinkStatus(s)}_reportLinkStatus(i){var s;switch(i){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):((s=this.fs)==null?void 0:s.compilationStatus)==="error"?(this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${i}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){const{gl:i}=this.device;return i.getProgramParameter(this.handle,35714)?(i.validateProgram(this.handle),i.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const i=async a=>await new Promise(u=>setTimeout(u,a));if(!this.device.features.has("compilation-status-async-webgl")){await i(10);return}const{gl:n}=this.device;for(;;){if(n.getProgramParameter(this.handle,37297))return;await i(10)}}_areTexturesRenderable(){let i=!0;for(const[,s]of Object.entries(this.bindings))s instanceof ra&&(s.update(),i=i&&s.loaded);return i}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:i}=this.device;i.useProgram(this.handle);let s=0,n=0;for(const a of this.shaderLayout.bindings){const u=this.bindings[a.name]||this.bindings[a.name.replace(/Uniforms$/,"")];if(!u)throw new Error(`No value for binding ${a.name} in ${this.id}`);switch(a.type){case"uniform":const{name:c}=a,_=i.getUniformBlockIndex(this.handle,c);if(_===4294967295)throw new Error(`Invalid uniform block name ${c}`);i.uniformBlockBinding(this.handle,n,_),u instanceof Yl?i.bindBufferBase(35345,n,u.handle):i.bindBufferRange(35345,n,u.buffer.handle,u.offset||0,u.size||u.buffer.byteLength-u.offset),n+=1;break;case"texture":if(!(u instanceof Xh||u instanceof ra||u instanceof jp))throw new Error("texture");let w;if(u instanceof Xh)w=u.texture;else if(u instanceof ra)w=u;else if(u instanceof jp&&u.colorAttachments[0]instanceof Xh)lt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),w=u.colorAttachments[0].texture;else throw new Error("No texture");i.activeTexture(33984+s),i.bindTexture(w.target,w.handle),s+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${a.type}' not supported in WebGL`)}}}_applyUniforms(){for(const i of this.shaderLayout.uniforms||[]){const{name:s,location:n,type:a,textureUnit:u}=i,c=this.uniforms[s]??u;c!==void 0&&G9(this.device.gl,n,a,c)}}}class iW extends hw{constructor(i){super(i,{});J(this,"device");J(this,"commands",[]);this.device=i}submitCommands(i=this.commands){for(const s of i)switch(s.name){case"copy-buffer-to-buffer":sW(this.device,s.options);break;case"copy-buffer-to-texture":nW(this.device,s.options);break;case"copy-texture-to-buffer":rW(this.device,s.options);break;case"copy-texture-to-texture":oW(this.device,s.options);break}}}function sW(t,e){const i=e.source,s=e.destination;t.gl.bindBuffer(36662,i.handle),t.gl.bindBuffer(36663,s.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function nW(t,e){throw new Error("Not implemented")}function rW(t,e){const{source:i,mipLevel:s=0,aspect:n="all",width:a=e.source.width,height:u=e.source.height,depthOrArrayLayers:c=0,origin:_=[0,0],destination:w,byteOffset:S=0,bytesPerRow:C,rowsPerImage:P}=e;if(n!=="all")throw new Error("not supported");if(s!==0||c!==0||C||P)throw new Error("not implemented");const{framebuffer:D,destroyFramebuffer:j}=ck(i);let L;try{const H=w,te=a||D.width,G=u||D.height,se=Ey(D.texture.props.format),ve=se.dataFormat,Se=se.type;t.gl.bindBuffer(35051,H.handle),L=t.gl.bindFramebuffer(36160,D.handle),t.gl.readPixels(_[0],_[1],te,G,ve,Se,S)}finally{t.gl.bindBuffer(35051,null),L!==void 0&&t.gl.bindFramebuffer(36160,L),j&&D.destroy()}}function oW(t,e){const{source:i,destinationMipLevel:s=0,origin:n=[0,0],destinationOrigin:a=[0,0],destination:u}=e;let{width:c=e.destination.width,height:_=e.destination.height}=e;const{framebuffer:w,destroyFramebuffer:S}=ck(i),[C,P]=n,[D,j,L]=a,H=t.gl.bindFramebuffer(36160,w.handle);let te=null,G;if(u instanceof ra)te=u,c=Number.isFinite(c)?c:te.width,_=Number.isFinite(_)?_:te.height,te.bind(0),G=te.target;else throw new Error("invalid destination");switch(G){case 3553:case 34067:t.gl.copyTexSubImage2D(G,s,D,j,C,P,c,_);break;case 35866:case 32879:t.gl.copyTexSubImage3D(G,s,D,j,L,C,P,c,_);break}te&&te.unbind(),t.gl.bindFramebuffer(36160,H),S&&w.destroy()}function ck(t){if(t instanceof ao){const{width:e,height:i,id:s}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${s}`,width:e,height:i,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class aW extends uw{constructor(i,s){super(i,s);J(this,"device");J(this,"commandBuffer");this.device=i,this.commandBuffer=new iW(i)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(i){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:i})}copyBufferToTexture(i){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:i})}copyTextureToBuffer(i){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:i})}copyTextureToTexture(i){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:i})}pushDebugGroup(i){}popDebugGroup(){}insertDebugMarker(i){}resolveQuerySet(i,s,n){}}class J1 extends dw{constructor(i,s){super(i,s);J(this,"device");J(this,"handle");J(this,"buffer",null);J(this,"bufferValue",null);this.device=i,this.handle=this.device.gl.createVertexArray()}get[Symbol.toStringTag](){return"VertexArray"}static isConstantAttributeZeroSupported(i){return C4()==="Chrome"}destroy(){var i;super.destroy(),this.buffer&&((i=this.buffer)==null||i.destroy()),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(i){const s=i;if(s&&s.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,s?s.handle:null),this.indexBuffer=s,this.device.gl.bindVertexArray(null)}setBuffer(i,s){const n=s;if(n.glTarget===34963)throw new Error("Use .setIndexBuffer()");const{size:a,type:u,stride:c,offset:_,normalized:w,integer:S,divisor:C}=this._getAccessor(i);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),S?this.device.gl.vertexAttribIPointer(i,a,u,c,_):this.device.gl.vertexAttribPointer(i,a,u,w,c,_),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(i),this.device.gl.vertexAttribDivisor(i,C||0),this.attributes[i]=n,this.device.gl.bindVertexArray(null)}setConstantWebGL(i,s){this._enable(i,!1),this.attributes[i]=s}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let i=0;i{for(const s in i)this.setBuffer(s,i[s])})}setBuffer(i,s){const n=this._getVaryingIndex(i),{buffer:a,byteLength:u,byteOffset:c}=this._getBufferRange(s);if(n<0){this.unusedBuffers[i]=a,lt.warn(`${this.id} unusedBuffers varying buffer ${i}`)();return}this.buffers[n]={buffer:a,byteLength:u,byteOffset:c},this.bindOnUse||this._bindBuffer(n,a,c,u)}getBuffer(i){if(VI(i))return this.buffers[i]||null;const s=this._getVaryingIndex(i);return s>=0?this.buffers[s]:null}bind(i=this.handle){if(typeof i!="function")return this.gl.bindTransformFeedback(36386,i),this;let s;return this._bound?s=i():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,s=i(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),s}unbind(){this.bind(null)}_getBufferRange(i){if(i instanceof Yl)return{buffer:i,byteOffset:0,byteLength:i.byteLength};const{buffer:s,byteOffset:n=0,byteLength:a=i.buffer.byteLength}=i;return{buffer:s,byteOffset:n,byteLength:a}}_getVaryingIndex(i){if(VI(i))return Number(i);for(const s of this.layout.varyings)if(i===s.name)return s.location;return-1}_bindBuffers(){for(const i in this.buffers){const{buffer:s,byteLength:n,byteOffset:a}=this._getBufferRange(this.buffers[i]);this._bindBuffer(Number(i),s,a,n)}}_unbindBuffers(){for(const i in this.buffers)this.gl.bindBufferBase(35982,Number(i),null)}_bindBuffer(i,s,n=0,a){const u=s&&s.handle;!u||a===void 0?this.gl.bindBufferBase(35982,i,u):this.gl.bindBufferRange(35982,i,u,n,a)}}function VI(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class hW extends pw{constructor(i,s){super(i,s);J(this,"device");J(this,"handle");J(this,"target",null);J(this,"_queryPending",!1);J(this,"_pollingPromise",null);if(this.device=i,s.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(i){return this._begin(i!=null&&i.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(i){this._queryPending||(this.target=i,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const i=this.device.gl.getQueryParameter(this.handle,34919);return i&&(this._queryPending=!1),i}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(i=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let s=0;return this._pollingPromise=new Promise((n,a)=>{const u=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):s++>i?(a("Timed out"),this._pollingPromise=null):requestAnimationFrame(u)};requestAnimationFrame(u)}),this._pollingPromise}}function uk(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return ns(!1),0}}function dW(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return ns(!1),0}}function fW(t,e){var H,te;const{sourceX:i=0,sourceY:s=0,sourceFormat:n=6408,sourceAttachment:a=36064}=e||{};let{target:u=null,sourceWidth:c,sourceHeight:_,sourceType:w}=e||{};const{framebuffer:S,deleteFramebuffer:C}=hk(t);ns(S);const{gl:P,handle:D}=S;c=c||S.width,_=_||S.height;const j=a-36064;w=w||((te=(H=S.colorAttachments[j])==null?void 0:H.texture)==null?void 0:te.type)||5121,u=gW(u,w,n,c,_),w=w||L9(u);const L=P.bindFramebuffer(36160,D);return P.readPixels(i,s,c,_,n,w,u),P.bindFramebuffer(36160,L||null),C&&S.destroy(),u}function pW(t,e){const{target:i,sourceX:s=0,sourceY:n=0,sourceFormat:a=6408,targetByteOffset:u=0}=e||{};let{sourceWidth:c,sourceHeight:_,sourceType:w}=e||{};const{framebuffer:S,deleteFramebuffer:C}=hk(t);ns(S),c=c||S.width,_=_||S.height;const P=S;w=w||5121;let D=i;if(!D){const L=uk(a),H=dW(w),te=u+c*_*L*H;D=P.device.createBuffer({byteLength:te})}const j=t.device.createCommandEncoder();return j.copyTextureToBuffer({source:t,width:c,height:_,origin:[s,n],destination:D,byteOffset:u}),j.destroy(),C&&S.destroy(),D}function hk(t){return t instanceof fy?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:mW(t),deleteFramebuffer:!0}}function mW(t,e){const{device:i,width:s,height:n,id:a}=t;return i.createFramebuffer({...e,id:`framebuffer-for-${a}`,width:s,height:n,colorAttachments:[t]})}function gW(t,e,i,s,n){if(t)return t;e=e||5121;const a=Rw(e,{clamped:!1}),u=uk(i);return new a(s*n*u)}const _W=256,yW=1024,bW=16384,vW="clear: bad arguments";function xW(t,e){const{framebuffer:i=null,color:s=null,depth:n=null,stencil:a=null}=e||{},u={};i&&(u.framebuffer=i);let c=0;s&&(c|=bW,s!==!0&&(u.clearColor=s)),n&&(c|=_W,n!==!0&&(u.clearDepth=n)),a&&(c|=yW,n!==!0&&(u.clearStencil=n)),ns(c!==0,vW);const _=t.gl;ql(_,u,()=>{_.clear(c)})}const xp=1,au=class au extends _d{constructor(i){var _,w;super({...i,id:i.id||ku("webgl-device")});J(this,"type","webgl");J(this,"handle");J(this,"features");J(this,"limits");J(this,"info");J(this,"canvasContext");J(this,"lost");J(this,"_resolveContextLost");J(this,"renderPass",null);J(this,"gl");J(this,"debug",!1);J(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});J(this,"_extensions",{});J(this,"_polyfilled",!1);J(this,"spectorJS");J(this,"_constants");const s=(_=i.gl)==null?void 0:_.device;if(s)throw new Error(`WebGL context already attached to device ${s.id}`);const n=((w=i.gl)==null?void 0:w.canvas)||i.canvas;this.canvasContext=new _9(this,{...i,canvas:n}),this.lost=new Promise(S=>{this._resolveContextLost=S});let a=i.gl||null;if(a||(a=N$(this.canvasContext.canvas,{...i,onContextLost:S=>{var C;return(C=this._resolveContextLost)==null?void 0:C.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}})),!a)throw new Error("WebGL context creation failed");this.handle=a,this.gl=a,this.gl.device=this,this.gl._version=2,i.spector&&(this.spectorJS=w9({...this.props,canvas:this.handle.canvas})),this.info=B$(this.gl,this._extensions),this.limits=new s9(this.gl),this.features=new i9(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();const{enable:u=!0,copyState:c=!1}=i;ek(this.gl,{enable:u,copyState:c,log:(...S)=>lt.log(1,...S)()}),i.debug&&(this.gl=E9(this.gl,{...i,throwOnError:!0}),this.debug=!0,lt.level=Math.max(lt.level,1),lt.warn("WebGL debug mode activated. Performance reduced.")())}static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(i){if(i instanceof au)return i;if((i==null?void 0:i.device)instanceof _d)return i.device;if(!wW(i))throw new Error("Invalid WebGL2RenderingContext");return new au({gl:i})}static async create(i={}){var c;lt.groupCollapsed(xp,"WebGLDevice created")();const s=[];i.debug&&s.push(S9()),i.spector&&s.push(x9()),typeof i.canvas=="string"&&s.push(V1.pageLoaded);const n=await Promise.allSettled(s);for(const _ of n)_.status==="rejected"&<.error(`Failed to initialize debug libraries ${_.reason}`)();if(lt.probe(xp+1,"DOM is loaded")(),(c=i.gl)!=null&&c.device)return lt.warn("reattaching existing device")(),au.attach(i.gl);const a=new au(i),u=`Created ${a.type}${a.debug?" debug":""} context: ${a.info.vendor}, ${a.info.renderer} for canvas: ${a.canvasContext.id}`;return lt.probe(xp,u)(),lt.table(xp,a.info)(),lt.groupEnd(xp)(),a}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(i){return Y1(this.gl,i,this._extensions)}isTextureFormatFilterable(i){return G$(this.gl,i,this._extensions)}isTextureFormatRenderable(i){return Q$(this.gl,i,this._extensions)}createCanvasContext(i){throw new Error("WebGL only supports a single canvas")}createBuffer(i){const s=this._getBufferProps(i);return new Yl(this,s)}_createTexture(i){return new ra(this,i)}createExternalTexture(i){throw new Error("createExternalTexture() not implemented")}createSampler(i){return new Pw(this,i)}createShader(i){return new M9(this,i)}createFramebuffer(i){return new jp(this,i)}createVertexArray(i){return new J1(this,i)}createTransformFeedback(i){return new uW(this,i)}createQuerySet(i){return new hW(this,i)}createRenderPipeline(i){return new tW(this,i)}beginRenderPass(i){return new N9(this,i)}createComputePipeline(i){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(i){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(i){return new aW(this,i)}submit(){var i;(i=this.renderPass)==null||i.end(),this.renderPass=null}readPixelsToArrayWebGL(i,s){return fW(i,s)}readPixelsToBufferWebGL(i,s){return pW(i,s)}setParametersWebGL(i){Od(this.gl,i)}getParametersWebGL(i){return QM(this.gl,i)}withParametersWebGL(i,s){return ql(this.gl,i,s)}clearWebGL(i){xW(this,i)}resetWebGL(){lt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),P$(this.gl)}loseDevice(){var a;let i=!1;const n=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return n&&(i=!0,n.loseContext()),(a=this._resolveContextLost)==null||a.call(this,{reason:"destroyed",message:"Application triggered context loss"}),i}pushState(){P0(this.gl)}popState(){um(this.gl)}setSpectorMetadata(i,s){i.__SPECTOR_Metadata=s}getGLKey(i,s){s=s||this.gl2||this.gl;const n=Number(i);for(const a in s)if(s[a]===n)return`GL.${a}`;return String(i)}setConstantAttributeWebGL(i,s){const n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);const a=this._constants[i];switch(a&&AW(a,s)&<.info(1,`setConstantAttributeWebGL(${i}) could have been skipped, value unchanged`)(),this._constants[i]=s,s.constructor){case Float32Array:TW(this,i,s);break;case Int32Array:SW(this,i,s);break;case Uint32Array:EW(this,i,s);break;default:ns(!1)}}getExtension(i){return rc(this.gl,i,this._extensions),this._extensions}};J(au,"type","webgl");let Wp=au;function wW(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}function TW(t,e,i){switch(i.length){case 1:t.gl.vertexAttrib1fv(e,i);break;case 2:t.gl.vertexAttrib2fv(e,i);break;case 3:t.gl.vertexAttrib3fv(e,i);break;case 4:t.gl.vertexAttrib4fv(e,i);break;default:ns(!1)}}function SW(t,e,i){t.gl.vertexAttribI4iv(e,i)}function EW(t,e,i){t.gl.vertexAttribI4uiv(e,i)}function AW(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let i=0;ithis.device.clearWebGL(A))}const S={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:w});for(let A=0;A{const u=n.props._offset,c=n.id,_=n.parent&&n.parent.id;let w;if(_&&!(_ in e)&&s(n.parent,!1),_ in i){const S=i[_]=i[_]||XR(e[_],e);w=S(n,a),i[c]=S}else Number.isFinite(u)?(w=u+(e[_]||0),i[c]=null):w=t;return a&&w>=t&&(t=w+1),e[c]=w,w};return s}function gj(t,{moduleParameters:e,target:i,viewport:s}){const n=e&&e.devicePixelRatio||t.canvasContext.cssToDeviceRatio(),[,a]=t.canvasContext.getDrawingBufferSize(),u=i?i.height:a,c=s;return[c.x*n,u-(c.y+c.height)*n,c.width*n,c.height*n]}class mj extends X1{constructor(e,i){super(e,i),this.shadowMap=e.createTexture({width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),this.depthBuffer=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1,dataFormat:6402,type:5125}),this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[this.shadowMap],depthStencilAttachment:this.depthBuffer})}render(e){const i=this.fbo,s=this.device.canvasContext.cssToDeviceRatio(),n=e.viewports[0],a=n.width*s,u=n.height*s,c=[1,1,1,1];(a!==i.width||u!==i.height)&&i.resize({width:a,height:u}),super.render({...e,clearColor:c,target:i,pass:"shadow"})}getLayerParameters(e,i,s){return{...e.props.parameters,blend:!1,depthRange:[0,1],depthTest:!0}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.shadowMap&&(this.shadowMap.destroy(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.destroy(),this.depthBuffer=null)}}const _j={color:[255,255,255],intensity:1},_I=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],yj=[0,0,0,200/255];class ZR{constructor(e={}){this.id="lighting-effect",this.shadowColor=yj,this.shadow=!1,this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:i,deck:s}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(i),s._addDefaultShaderModule(gI),this.dummyShadowMap=i.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(const i in e){const s=e[i];switch(s.type){case"ambient":this.ambientLight=s;break;case"directional":this.directionalLights.push(s);break;case"point":this.pointLights.push(s);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(i=>i.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:i,viewports:s,onViewportActive:n,views:a}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let u=0;us.getProjectedLight({layer:e})),pointLights:this.pointLights.map(s=>s.getProjectedLight({layer:e}))},i}cleanup(e){for(const i of this.shadowPasses)i.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(gI))}_calculateMatrices(){const e=[];for(const i of this.directionalLights){const s=new _a().lookAt({eye:new ma(i.direction).negate()});e.push(s)}return e}_createShadowPasses(e){for(let i=0;in&&(a=n);const u=this._pool,c=e.BYTES_PER_ELEMENT*a,_=u.findIndex(w=>w.byteLength>=c);if(_>=0){const w=new e(u.splice(_,1)[0],0,a);return s&&w.fill(0),w}return new e(a)}_release(e){if(!ArrayBuffer.isView(e))return;const i=this._pool,{buffer:s}=e,{byteLength:n}=s,a=i.findIndex(u=>u.byteLength>=n);a<0?i.push(s):(a>0||i.lengththis.opts.poolSize&&i.shift()}}const mg=new bj;function Lp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function vj(t){return[t[12],t[13],t[14]]}function xj(t){return{left:Jh(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:Jh(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:Jh(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:Jh(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:Jh(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:Jh(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const yI=new ma;function Jh(t,e,i,s){yI.set(t,e,i);const n=yI.len();return{distance:s/n,normal:new ma(-t/n,-e/n,-i/n)}}function wj(t){return t-Math.fround(t)}let Ap;function gx(t,e){const{size:i=1,startIndex:s=0}=e,n=e.endIndex!==void 0?e.endIndex:t.length,a=(n-s)/i;Ap=mg.allocate(Ap,a,{type:Float32Array,size:i*2});let u=s,c=0;for(;u=i.delay+i.duration*i.repeat}getTime(e){if(e===void 0)return this.time;const i=this.channels.get(e);return i===void 0?-1:i.time}setTime(e){this.time=Math.max(0,e);const i=this.channels.values();for(const n of i)this._setChannelTime(n,this.time);const s=this.animations.values();for(const n of s){const{animation:a,channel:u}=n;a.setTime(this.getTime(u))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,i){const s=Rj++;return this.animations.set(s,{animation:e,channel:i}),e.setTime(this.getTime(i)),s}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,i){const s=i-e.delay,n=e.duration*e.repeat;s>=n?e.time=e.duration*e.rate:(e.time=Math.max(0,s)%e.duration,e.time*=e.rate)}}let kj=0;const Oj={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:Cf.stats.get(`animation-loop-${kj++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class Dj{constructor(e){K(this,"device",null);K(this,"canvas",null);K(this,"props");K(this,"animationProps",null);K(this,"timeline",null);K(this,"stats");K(this,"cpuTime");K(this,"gpuTime");K(this,"frameRate");K(this,"display");K(this,"needsRedraw","initialized");K(this,"_initialized",!1);K(this,"_running",!1);K(this,"_animationFrameId",null);K(this,"_nextFramePromise",null);K(this,"_resolveNextFrame",null);K(this,"_cpuStartTime",0);if(this.props={...Oj,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:i=!0}=this.props;this.stats=e.stats||new x0({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:i}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const i=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(i),i}}stop(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=C5(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(P5(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),this.device.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var e,i;if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:(i=(e=this.device)==null?void 0:e.canvasContext)==null?void 0:i.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:i,aspect:s}=this._getSizeAndAspect();(e!==this.animationProps.width||i!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),s!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=i,this.animationProps.aspect=s,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const i=document.createElement("div");i.style.position="absolute",i.style.left="10px",i.style.bottom="10px",i.style.width="300px",i.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(i);const s=this.props.onAddHTML(i);s&&(i.innerHTML=s)}}_getSizeAndAspect(){var a,u,c,_;if(!this.device)return{width:1,height:1,aspect:1};const[e,i]=((u=(a=this.device)==null?void 0:a.canvasContext)==null?void 0:u.getPixelSize())||[1,1];let s=1;const n=(_=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:_.canvas;return n&&n.clientHeight?s=n.clientWidth/n.clientHeight:e>0&&i>0&&(s=e/i),{width:e,height:i,aspect:s}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,i;this.props.autoResizeDrawingBuffer&&((i=(e=this.device)==null?void 0:e.canvasContext)==null||i.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}class xI{constructor(e){K(this,"id");K(this,"userData",{});K(this,"topology");K(this,"bufferLayout",[]);K(this,"vertexCount");K(this,"indices");K(this,"attributes");this.id=e.id||$u("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&is(this.indices.usage===Os.INDEX)}destroy(){var e;(e=this.indices)==null||e.destroy();for(const i of Object.values(this.attributes))i.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices}_calculateVertexCount(e){return e.byteLength/12}}function Fj(t,e){if(e instanceof xI)return e;const i=Nj(t,e),{attributes:s,bufferLayout:n}=Bj(t,e);return new xI({topology:e.topology||"triangle-list",bufferLayout:n,vertexCount:e.vertexCount,indices:i,attributes:s})}function Nj(t,e){if(!e.indices)return;const i=e.indices.value;return t.createBuffer({usage:Os.INDEX,data:i})}function Bj(t,e){const i=[],s={};for(const[a,u]of Object.entries(e.attributes)){let c=a;switch(a){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}s[c]=t.createBuffer({data:u.value,id:`${a}-buffer`});const{value:_,size:w,normalized:S}=u;i.push({name:c,format:T5(_,w,S)})}const n=e._calculateVertexCount(e.attributes,e.indices);return{attributes:s,bufferLayout:i,vertexCount:n}}class Lj{constructor(e){K(this,"modules");K(this,"moduleUniforms");K(this,"moduleBindings");K(this,"moduleUniformsChanged");const i=T0(Object.values(e).filter(s=>s.dependencies));for(const s of i)e[s.name]=s;at.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[s,n]of Object.entries(e)){const a=s;this.moduleUniforms[a]=n.defaultUniforms||{},this.moduleBindings[a]={}}}destroy(){}setProps(e){var i;for(const s of Object.keys(e)){const n=s,a=e[n],u=this.modules[n];if(!u){at.warn(`Module ${s} not found`)();continue}const c=this.moduleUniforms[n],_=this.moduleBindings[n],w=((i=u.getUniforms)==null?void 0:i.call(u,a,c))||a,{uniforms:S,bindings:A}=j1(w);this.moduleUniforms[n]={...c,...S},this.moduleBindings[n]={..._,...A}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindings(){const e={};for(const i of Object.values(this.moduleBindings))Object.assign(e,i);return e}getDebugTable(){var i;const e={};for(const[s,n]of Object.entries(this.moduleUniforms))for(const[a,u]of Object.entries(n))e[`${s}.${a}`]={type:(i=this.modules[s].uniformTypes)==null?void 0:i[a],value:String(u)};return e}}const s0=class s0{constructor(e){K(this,"device");K(this,"_hashCounter",0);K(this,"_hashes",{});K(this,"_renderPipelineCache",{});K(this,"_computePipelineCache",{});this.device=e}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new s0(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const i={...Bf.defaultProps,...e},s=this._hashRenderPipeline(i);if(!this._renderPipelineCache[s]){const n=this.device.createRenderPipeline({...i,id:i.id?`${i.id}-cached`:void 0});n.hash=s,this._renderPipelineCache[s]={pipeline:n,useCount:0}}return this._renderPipelineCache[s].useCount++,this._renderPipelineCache[s].pipeline}createComputePipeline(e){const i={...vy.defaultProps,...e},s=this._hashComputePipeline(i);if(!this._computePipelineCache[s]){const n=this.device.createComputePipeline({...i,id:i.id?`${i.id}-cached`:void 0});n.hash=s,this._computePipelineCache[s]={pipeline:n,useCount:0}}return this._computePipelineCache[s].useCount++,this._computePipelineCache[s].pipeline}release(e){const i=e.hash,s=e instanceof vy?this._computePipelineCache:this._renderPipelineCache;s[i].useCount--,s[i].useCount===0&&(s[i].pipeline.destroy(),delete s[i])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const i=this._getHash(e.vs.source),s=e.fs?this._getHash(e.fs.source):0,n="-",a=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${i}/${s}V${n}BL${a}`;default:const u=this._getHash(JSON.stringify(e.parameters));return`${i}/${s}V${n}T${e.topology}P${u}BL${a}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};K(s0,"defaultProps",{...Bf.defaultProps});let Dw=s0;const n0=class n0{constructor(e){K(this,"device");K(this,"_cache",{});this.device=e}static getDefaultShaderFactory(e){var i;return(i=e._lumaData).defaultShaderFactory||(i.defaultShaderFactory=new n0(e)),e._lumaData.defaultShaderFactory}createShader(e){const i=this._hashShader(e);let s=this._cache[i];if(!s){const n=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[i]=s={shader:n,useCount:0}}return s.useCount++,s.shader}release(e){const i=this._hashShader(e),s=this._cache[i];s&&(s.useCount--,s.useCount===0&&(delete this._cache[i],s.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};K(n0,"defaultProps",{..._y.defaultProps});let Fw=n0;function zj(t,e){var n;const i={},s="Values";if(t.attributes.length===0&&!((n=t.varyings)!=null&&n.length))return{"No attributes or varyings":{[s]:"N/A"}};for(const a of t.attributes)if(a){const u=`${a.location} ${a.name}: ${a.type}`;i[`in ${u}`]={[s]:a.stepMode||"vertex"}}for(const a of t.varyings||[]){const u=`${a.location} ${a.name}`;i[`out ${u}`]={[s]:JSON.stringify(a.accessor)}}return i}let cn=null,_x=null;function Uj(t,{id:e,minimap:i,opaque:s,top:n="0",left:a="0",rgbaScale:u=1}){cn||(cn=document.createElement("canvas"),cn.id=e,cn.title=e,cn.style.zIndex="100",cn.style.position="absolute",cn.style.top=n,cn.style.left=a,cn.style.border="blue 1px solid",cn.style.transform="scaleY(-1)",document.body.appendChild(cn),_x=cn.getContext("2d")),(cn.width!==t.width||cn.height!==t.height)&&(cn.width=t.width/2,cn.height=t.height/2,cn.style.width="400px",cn.style.height="400px");const c=t.device.readPixelsToArrayWebGL(t),_=_x.createImageData(t.width,t.height),w=0;for(let S=0;S[A.name,A]))||[]);this.setShaderInputs(i.shaderInputs||new Lj(s));const n=jj(e),a=(((_=this.props.modules)==null?void 0:_.length)>0?this.props.modules:(w=this.shaderInputs)==null?void 0:w.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(S=this.props).shaderLayout||(S.shaderLayout=fV(this.props.source));const{source:A,getUniforms:P}=this.props.shaderAssembler.assembleShader({platformInfo:n,...this.props,modules:a});this.source=A,this._getModuleUniforms=P}else{const{vs:A,fs:P,getUniforms:D}=this.props.shaderAssembler.assembleShaderPair({platformInfo:n,...this.props,modules:a});this.vs=A,this.fs=P,this._getModuleUniforms=D}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,i.geometry&&this.setGeometry(i.geometry),this.pipelineFactory=i.pipelineFactory||Dw.getDefaultPipelineFactory(this.device),this.shaderFactory=i.shaderFactory||Fw.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in i&&(this.isInstanced=i.isInstanced),i.instanceCount&&this.setInstanceCount(i.instanceCount),i.vertexCount&&this.setVertexCount(i.vertexCount),i.indexBuffer&&this.setIndexBuffer(i.indexBuffer),i.attributes&&this.setAttributes(i.attributes),i.constantAttributes&&this.setConstantAttributes(i.constantAttributes),i.bindings&&this.setBindings(i.bindings),i.uniforms&&this.setUniforms(i.uniforms),i.moduleSettings&&this.updateModuleSettings(i.moduleSettings),i.transformFeedback&&(this.transformFeedback=i.transformFeedback),Object.seal(this)}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){this.predraw();let i;try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings,{disableWarnings:this.props.disableWarnings}),gy(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:s}=this.vertexArray,n=s?s.byteLength/(s.indexType==="uint32"?4:2):void 0;i=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:n,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{this._logDrawCallEnd()}return this._logFramebuffer(e),i?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",i}setGeometry(e){var s;(s=this._gpuGeometry)==null||s.destroy();const i=e&&Fj(this.device,e);i&&(this.setTopology(i.topology||"triangle-list"),this.bufferLayout=wI(i.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i)),this._gpuGeometry=i}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){this.bufferLayout=this._gpuGeometry?wI(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){Sw(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new w5(this.shaderInputs.modules);for(const i of Object.keys(this.shaderInputs.modules)){const s=this._uniformStore.getManagedUniformBuffer(this.device,i);this.bindings[`${i}Uniforms`]=s}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindings()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,i){e.indices&&at.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();for(const[s,n]of Object.entries(e)){const a=this.bufferLayout.find(_=>TI(_).includes(s));if(!a){at.warn(`Model(${this.id}): Missing layout for buffer "${s}".`)();continue}const u=TI(a);let c=!1;for(const _ of u){const w=this._attributeInfos[_];w&&(this.vertexArray.setBuffer(w.location,n),c=!0)}!c&&!((i==null?void 0:i.disableWarnings)??this.props.disableWarnings)&&at.warn(`Model(${this.id}): Ignoring buffer "${n.id}" for unknown attribute "${s}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,i){for(const[s,n]of Object.entries(e)){const a=this._attributeInfos[s];a?this.vertexArray.setConstantWebGL(a.location,n):((i==null?void 0:i.disableWarnings)??this.props.disableWarnings)||at.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${s}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){gy(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettings(e){const{bindings:i,uniforms:s}=j1(this._getModuleUniforms(e));Object.assign(this.bindings,i),Object.assign(this.uniforms,s),this.setNeedsRedraw("moduleSettings")}_getBindingsUpdateTimestamp(){let e=0;for(const i of Object.values(this.bindings))i instanceof my?e=Math.max(e,i.texture.updateTimestamp):i instanceof Os||i instanceof po?e=Math.max(e,i.updateTimestamp):i instanceof yy||(e=Math.max(e,i.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const i={...e.attributes};for(const[s]of Object.entries(i))!this.pipeline.shaderLayout.attributes.find(n=>n.name===s)&&s!=="positions"&&delete i[s];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(i,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,i=null;this.pipeline&&(at.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,i=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const s=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debug:this.props.debugShaders});let n=null;this.source?n=s:this.fs&&(n=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debug:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:s,fs:n}),this._attributeInfos=bR(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),i&&this.shaderFactory.release(i)}return this.pipeline}_logDrawCallStart(){const e=at.level>3?0:Vj;at.level<2||Date.now()-this._lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:at.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=zj(this.pipeline.shaderLayout,this.id);at.table(Gh,e)();const i=this.shaderInputs.getDebugTable();for(const[n,a]of Object.entries(this.uniforms))i[n]={value:a};at.table(Gh,i)();const s=this._getAttributeDebugTable();at.table(Gh,this._attributeInfos)(),at.table(Gh,s)(),at.groupEnd(Gh)(),this._logOpen=!1}}_logFramebuffer(e){const i=at.get("framebuffer");if(this._drawCount++,!i||this._drawCount++>3&&this._drawCount%60)return;const s=e.props.framebuffer;s&&Uj(s,{id:s.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[i,s]of Object.entries(this._attributeInfos))e[s.location]={name:i,type:s.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[s.location],s.bufferDataType)};if(this.vertexArray.indexBuffer){const{indexBuffer:i}=this.vertexArray,s=i.indexType==="uint32"?new Uint32Array(i.debugData):new Uint16Array(i.debugData);e.indices={name:"indices",type:i.indexType,values:s.toString()}}return e}_getBufferOrConstantValues(e,i){const s=wR(i);return(e instanceof Os?new s(e.debugData):e).toString()}};K(r0,"defaultProps",{...Bf.defaultProps,source:null,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:py.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let $f=r0;function wI(t,e){const i=[...t];for(const s of e){const n=i.findIndex(a=>a.name===s.name);n<0?i.push(s):i[n]=s}return i}function jj(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function TI(t){var e;return t.attributes?(e=t.attributes)==null?void 0:e.map(i=>i.attribute):[t.name]}class _g{constructor(e,i=$f.defaultProps){K(this,"device");K(this,"model");K(this,"transformFeedback");is(_g.isSupported(e),"BufferTransform not yet implemented on WebGPU"),this.device=e,this.model=new $f(this.device,{id:i.id||"buffer-transform-model",fs:i.fs||SU(),topology:i.topology||"point-list",...i}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:i.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var i;return((i=e==null?void 0:e.info)==null?void 0:i.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){const i=this.device.beginRenderPass(e);this.model.draw(i),i.end()}update(...e){console.warn("TextureTransform#update() not implemented")}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const i=this.getBuffer(e);if(i instanceof Os)return i.readAsync();const{buffer:s,byteOffset:n=0,byteLength:a=s.byteLength}=i;return s.readAsync(n,a)}}class $j{constructor(e){K(this,"id");K(this,"topology");K(this,"vertexCount");K(this,"indices");K(this,"attributes");K(this,"userData",{});const{attributes:i={},indices:s=null,vertexCount:n=null}=e;this.id=e.id||$u("geometry"),this.topology=e.topology,s&&(this.indices=ArrayBuffer.isView(s)?{value:s,size:1}:s),this.attributes={};for(const[a,u]of Object.entries(i)){const c=ArrayBuffer.isView(u)?{value:u}:u;is(ArrayBuffer.isView(c.value),`${this._print(a)}: must be typed array or object with value as typed array`),(a==="POSITION"||a==="positions")&&!c.size&&(c.size=3),a==="indices"?(is(!this.indices),this.indices=c):this.attributes[a]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=n||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,i){return this}_calculateVertexCount(e,i){if(i)return i.value.length;let s=1/0;for(const n of Object.values(e)){const{value:a,size:u,constant:c}=n;!c&&a&&u>=1&&(s=Math.min(s,a.length/u))}return is(Number.isFinite(s)),s}}const Hj={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class JR extends X1{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:i,views:s,viewports:n,onViewportActive:a,pickingFBO:u,deviceRect:{x:c,y:_,width:w,height:S},cullRect:A,effects:P,pass:D="picking",pickZ:U,moduleParameters:L}){this.pickZ=U;const W=this._resetColorEncoder(U),ee=[c,_,w,S],G=super.render({target:u,layers:e,layerFilter:i,views:s,viewports:n,onViewportActive:a,cullRect:A,effects:P==null?void 0:P.filter(fe=>fe.useInPicking),pass:D,isPicking:!0,moduleParameters:L,clearColor:[0,0,0,0],colorMask:15,scissorRect:ee});return this._colorEncoderState=null,{decodePickingColor:W&&qj.bind(null,W),stats:G}}shouldDrawLayer(e){const{pickable:i,operation:s}=e.props;return i&&s.includes("draw")||s.includes("terrain")||s.includes("mask")}getModuleParameters(){return{picking:{isActive:1,isAttribute:this.pickZ},lightSources:{}}}getLayerParameters(e,i,s){const n={depthMask:!0,depthTest:!0,depthRange:[0,1],...e.props.parameters},{pickable:a,operation:u}=e.props;return!this._colorEncoderState||u.includes("terrain")?n.blend=!1:a&&u.includes("draw")&&(Object.assign(n,Hj),n.blend=!0,n.blendColor=Wj(this._colorEncoderState,e,s)),n}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function Wj(t,e,i){const{byLayer:s,byAlpha:n}=t;let a,u=s.get(e);return u?(u.viewports.push(i),a=u.a):(a=s.size+1,a<=255?(u={a,layer:e,viewports:[i]},s.set(e,u),n[a]=u):(qi.warn("Too many pickable layers, only picking the first 255")(),a=0)),[0,0,0,a/255]}function qj(t,e){const i=t.byAlpha[e[3]];return i&&{pickedLayer:i.layer,pickedViewports:i.viewports,pickedObjectIndex:i.layer.decodePickingColor(e)}}const af={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Cy=Symbol.for("component"),Cu=Symbol.for("propTypes"),yx=Symbol.for("deprecatedProps"),Rf=Symbol.for("asyncPropDefaults"),Fu=Symbol.for("asyncPropOriginal"),sc=Symbol.for("asyncPropResolved");function yg(t,e=()=>!0){return Array.isArray(t)?GR(t,e,[]):e(t)?[t]:[]}function GR(t,e,i){let s=-1;for(;++s0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,i){if(e===this._data&&!i)return;this._data=e;const s=++this._loadCount;let n=e;typeof e=="string"&&(n=hw(e)),n instanceof Promise?(this.isLoaded=!1,this._loader=n.then(a=>{this._loadCount===s&&(this.isLoaded=!0,this._error=void 0,this._content=a)}).catch(a=>{this._loadCount===s&&(this.isLoaded=!0,this._error=a||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const a of this._subscribers)a.onChange(this.getData())}}class Yj{constructor(e){var i;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(i=e.device)==null?void 0:i.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:i,forceUpdate:s=!1,persistent:n=!0}){let a=this._resources[e];a?a.setData(i,s):(a=new Zj(e,i,this._context),this._resources[e]=a),a.persistent=n}remove(e){const i=this._resources[e];i&&(i.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const i=this._consumers[e];if(i){for(const s in i){const n=i[s],a=this._resources[n.resourceId];a&&a.unsubscribe(n)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:i,consumerId:s,requestId:n="default"}){const{_resources:a,protocol:u}=this;e.startsWith(u)&&(e=e.replace(u,""),a[e]||this.add({resourceId:e,data:null,persistent:!1}));const c=a[e];if(this._track(s,n,c,i),c)return c.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,i,s,n){const a=this._consumers,u=a[e]=a[e]||{};let c=u[i];const _=c&&c.resourceId&&this._resources[c.resourceId];_&&(_.unsubscribe(c),this.prune()),s&&(c?(c.onChange=n,c.resourceId=s.id):c={onChange:n,resourceId:s.id},u[i]=c,s.subscribe(c))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const i=this._resources[e];!i.persistent&&!i.inUse()&&(i.delete(),delete this._resources[e])}}}const Kj="layerManager.setLayers",Jj="layerManager.activateViewport";class Gj{constructor(e,i){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=c=>{nr(Jj,this,c),c&&(this.context.viewport=c)};const{deck:s,stats:n,viewport:a,timeline:u}=i||{};this.layers=[],this.resourceManager=new Yj({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:s,shaderAssembler:rj(),defaultShaderModules:[],renderPass:void 0,stats:n||new x0({id:"deck.gl"}),viewport:a||new $g({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:u||new KR,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let i=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const s of this.layers){const n=s.getNeedsRedraw(e);i=i||n}return i}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(i=>e.find(s=>i.id.indexOf(s)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,i){nr(Kj,this,i,e),this._lastRenderedLayers=e;const s=yg(e,Boolean);for(const n of s)n.context=this.context;this._updateLayers(this.layers,s)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:i}=this.context;i.find(s=>s.name===e.name)||(i.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:i}=this.context,s=i.findIndex(n=>n.name===e.name);s>=0&&(i.splice(s,1),this._defaultShaderModulesChanged=!0)}_handleError(e,i,s){s.raiseError(i,`${e} of ${s}`)}_updateLayers(e,i){const s={};for(const u of e)s[u.id]?qi.warn(`Multiple old layers with same id ${u.id}`)():s[u.id]=u;if(this._defaultShaderModulesChanged){for(const u of e)u.setNeedsUpdate(),u.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const n=[];this._updateSublayersRecursively(i,s,n),this._finalizeOldLayers(s);let a=!1;for(const u of n)if(u.hasUniformTransition()){a=`Uniform transition in ${u}`;break}this._needsUpdate=a,this.layers=n}_updateSublayersRecursively(e,i,s){for(const n of e){n.context=this.context;const a=i[n.id];a===null&&qi.warn(`Multiple new layers with same id ${n.id}`)(),i[n.id]=null;let u=null;try{this._debug&&a!==n&&n.validateProps(),a?(this._transferLayerState(a,n),this._updateLayer(n)):this._initializeLayer(n),s.push(n),u=n.isComposite?n.getSubLayers():null}catch(c){this._handleError("matching",c,n)}u&&this._updateSublayersRecursively(u,i,s)}}_finalizeOldLayers(e){for(const i in e){const s=e[i];s&&this._finalizeLayer(s)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=af.INITIALIZED}catch(i){this._handleError("initialization",i,e)}}_transferLayerState(e,i){i._transferState(e),i.lifecycle=af.MATCHED,i!==e&&(e.lifecycle=af.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(i){this._handleError("update",i,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=af.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=af.FINALIZED}catch(i){this._handleError("finalization",i,e)}}}function Kr(t,e,i){if(t===e)return!0;if(!i||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let s=0;si.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(i=>{e[i.id]=i}),e}getView(e){return this.views.find(i=>i.id===e)}getViewState(e){const i=typeof e=="string"?this.getView(e):e,s=i&&this.viewState[i.getViewStateId()]||this.viewState;return i?i.filterViewState(s):s}getViewport(e){return this._viewportMap[e]}unproject(e,i){const s=this.getViewports(),n={x:e[0],y:e[1]};for(let a=s.length-1;a>=0;--a){const u=s[a];if(u.containsPixel(n)){const c=e.slice();return c[0]-=u.x,c[1]-=u.y,u.unproject(c,i)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,i){(e!==this.width||i!==this.height)&&(this.width=e,this.height=i,this.setNeedsUpdate("Size changed"))}_setViews(e){e=yg(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Kr(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):qi.warn("missing `viewState` or `initialViewState`")()}_createController(e,i){const s=i.type;return new s({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:a=>{var u;return(u=this.getView(e.id))==null?void 0:u.makeViewport({viewState:a,width:this.width,height:this.height})}})}_updateController(e,i,s,n){const a=e.controller;if(a&&s){const u={...i,...a,id:e.id,x:s.x,y:s.y,width:s.width,height:s.height};return(!n||n.constructor!==a.type)&&(n=this._createController(e,u)),n&&n.setProps(u),n}return null}_rebuildViewports(){const{views:e}=this,i=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let n=e.length;n--;){const a=e[n],u=this.getViewState(a),c=a.makeViewport({viewState:u,width:this.width,height:this.height});let _=i[a.id];const w=!!a.controller;w&&!_&&(s=!0),(s||!w)&&_&&(_.finalize(),_=null),this.controllers[a.id]=this._updateController(a,u,c,_),c&&this._viewports.unshift(c)}for(const n in i){const a=i[n];a&&!this.controllers[n]&&a.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,i){return e.length!==i.length?!0:e.some((s,n)=>!e[n].equals(i[n]))}}const e$=/([0-9]+\.?[0-9]*)(%|px)/;function $l(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=e$.exec(t);if(e&&e.length>=3){const i=e[2]==="%",s=parseFloat(e[1]);return{position:i?s/100:s,relative:i}}default:throw new Error(`Could not parse position string ${t}`)}}function Hl(t,e){return t.relative?Math.round(t.position*e):t.position}class t${constructor(e){const{id:i,x:s=0,y:n=0,width:a="100%",height:u="100%",padding:c=null}=e;this.id=i||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=$l(s),this._y=$l(n),this._width=$l(a),this._height=$l(u),this._padding=c&&{left:$l(c.left||0),right:$l(c.right||0),top:$l(c.top||0),bottom:$l(c.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.ViewportType===e.ViewportType&&Kr(this.props,e.props,2)}makeViewport({width:e,height:i,viewState:s}){s=this.filterViewState(s);const n=this.getDimensions({width:e,height:i});return!n.height||!n.width?null:new this.ViewportType({...s,...this.props,...n})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const i={...e};for(const s in this.props.viewState)s!=="id"&&(i[s]=this.props.viewState[s]);return i}return e}getDimensions({width:e,height:i}){const s={x:Hl(this._x,e),y:Hl(this._y,i),width:Hl(this._width,e),height:Hl(this._height,i)};return this._padding&&(s.padding={left:Hl(this._padding.left,e),top:Hl(this._padding.top,i),right:Hl(this._padding.right,e),bottom:Hl(this._padding.bottom,i)}),s}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class E0{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var i,s;this.cancel(),this.settings=e,this._inProgress=!0,(s=(i=this.settings).onStart)==null||s.call(i,this)}end(){var e,i;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(i=(e=this.settings).onEnd)==null||i.call(e,this))}cancel(){var e,i;this._inProgress&&((i=(e=this.settings).onInterrupt)==null||i.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,i;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:s,settings:n}=this;this._handle=s.addChannel({delay:s.getTime(),duration:n.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(i=(e=this.settings).onUpdate)==null||i.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const SI=()=>{},Nw={BREAK:1,SNAP_TO_END:2,IGNORE:3},i$=t=>t,s$=Nw.BREAK;class n${constructor(e){this._onTransitionUpdate=i=>{const{time:s,settings:{interpolator:n,startProps:a,endProps:u,duration:c,easing:_}}=i,w=_(s/c),S=n.interpolateProps(a,u,w);this.propsInTransition=this.getControllerState({...this.props,...S}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new E0(e.timeline),this.onViewStateChange=e.onViewStateChange||SI,this.onStateChange=e.onStateChange||SI}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let i=!1;const s=this.props;if(this.props=e,!s||this._shouldIgnoreViewportChange(s,e))return!1;if(this._isTransitionEnabled(e)){let n=s;if(this.transition.inProgress){const{interruption:a,endProps:u}=this.transition.settings;n={...s,...a===Nw.SNAP_TO_END?u:this.propsInTransition||s}}this._triggerTransition(n,e),i=!0}else this.transition.cancel();return i}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:i,transitionInterpolator:s}=e;return(i>0||i==="auto")&&!!s}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,i){return this.transition.inProgress?this.transition.settings.interruption===Nw.IGNORE||this._isUpdateDueToCurrentTransition(i):this._isTransitionEnabled(i)?i.transitionInterpolator.arePropsEqual(e,i):!0}_triggerTransition(e,i){const s=this.getControllerState(e),n=this.getControllerState(i).shortestPathFrom(s),a=i.transitionInterpolator,u=a.getDuration?a.getDuration(e,i):i.transitionDuration;if(u===0)return;const c=a.initializeProps(e,n);this.propsInTransition={};const _={duration:u,easing:i.transitionEasing||i$,interpolator:a,interruption:i.transitionInterruption||s$,startProps:c.start,endProps:c.end,onStart:i.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(i.onTransitionInterrupt),onEnd:this._onTransitionEnd(i.onTransitionEnd)};this.transition.start(_),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return i=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(i)}}}function Ys(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class r${constructor(e){const{compare:i,extract:s,required:n}=e;this._propsToCompare=i,this._propsToExtract=s||i,this._requiredProps=n}arePropsEqual(e,i){for(const s of this._propsToCompare)if(!(s in e)||!(s in i)||!pg(e[s],i[s]))return!1;return!0}initializeProps(e,i){const s={},n={};for(const a of this._propsToExtract)(a in e||a in i)&&(s[a]=e[a],n[a]=i[a]);return this._checkRequiredProps(s),this._checkRequiredProps(n),{start:s,end:n}}getDuration(e,i){return i.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(i=>{const s=e[i];Ys(Number.isFinite(s)||Array.isArray(s),`${i} is required for transition`)})}}const o$=["longitude","latitude","zoom","bearing","pitch"],a$=["longitude","latitude","zoom"];class QR extends r${constructor(e={}){const i=Array.isArray(e)?e:e.transitionProps,s=Array.isArray(e)?{}:e;s.transitionProps=Array.isArray(i)?{compare:i,required:i}:i||{compare:o$,required:a$},super(s.transitionProps),this.opts=s}initializeProps(e,i){const s=super.initializeProps(e,i),{makeViewport:n,around:a}=this.opts;if(n&&a){const u=n(e),c=n(i),_=u.unproject(a);s.start.around=a,Object.assign(s.end,{around:c.project(_),aroundPosition:_,width:i.width,height:i.height})}return s}interpolateProps(e,i,s){const n={};for(const a of this._propsToExtract)n[a]=Ty(e[a]||0,i[a]||0,s);if(i.aroundPosition&&this.opts.makeViewport){const a=this.opts.makeViewport({...i,...n});Object.assign(n,a.panByPosition(i.aroundPosition,Ty(e.around,i.around,s)))}return n}}const Wl={transitionDuration:0},l$=300,T_=t=>1-(1-t)*(1-t),Qh={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]},lu={};class c${constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new n$({...e,getControllerState:i=>new this.ControllerState(i),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const i in this._events)this._events[i]&&((e=this.eventManager)==null||e.off(i,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const i=this._eventStartBlocked;switch(e.type){case"panstart":return i?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return i?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return i?!1:this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:i,y:s}=this.props,{offsetCenter:n}=e;return[n.x-i,n.y-s]}isPointInBounds(e,i){const{width:s,height:n}=this.props;if(i&&i.handled)return!1;const a=e[0]>=0&&e[0]<=s&&e[1]>=0&&e[1]<=n;return a&&i&&i.stopPropagation(),a}isFunctionKeyPressed(e){const{srcEvent:i}=e;return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const i=setTimeout(()=>{this._eventStartBlocked===i&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=i}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:i}=e;this.inertia=Number.isFinite(i)?i:i===!0?l$:0;const{scrollZoom:s=!0,dragPan:n=!0,dragRotate:a=!0,doubleClickZoom:u=!0,touchZoom:c=!0,touchRotate:_=!1,keyboard:w=!0}=e,S=!!this.onViewStateChange;this.toggleEvents(Qh.WHEEL,S&&s),this.toggleEvents(Qh.PAN,S),this.toggleEvents(Qh.PINCH,S&&(c||_)),this.toggleEvents(Qh.TRIPLE_PAN,S&&_),this.toggleEvents(Qh.DOUBLE_TAP,S&&u),this.toggleEvents(Qh.KEYBOARD,S&&w),this.scrollZoom=s,this.dragPan=n,this.dragRotate=a,this.doubleClickZoom=u,this.touchZoom=c,this.touchRotate=_,this.keyboard=w}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,i){this.eventManager&&e.forEach(s=>{this._events[s]!==i&&(this._events[s]=i,i?this.eventManager.on(s,this.handleEvent):this.eventManager.off(s,this.handleEvent))})}updateViewport(e,i=null,s={}){const n={...e.getViewportProps(),...i},a=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(s),a){const u=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:u,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;let s=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(s=!s);const n=this.controllerState[s?"panStart":"rotateStart"]({pos:i});return this._panMove=s,this.updateViewport(n,Wl,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const i=this.getCenter(e),s=this.controllerState.pan({pos:i});return this.updateViewport(s,Wl,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:i}=this;if(this.dragPan&&i&&e.velocity){const s=this.getCenter(e),n=[s[0]+e.velocityX*i/2,s[1]+e.velocityY*i/2],a=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:T_},{isDragging:!1,isPanning:!0})}else{const s=this.controllerState.panEnd();this.updateViewport(s,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const i=this.getCenter(e),s=this.controllerState.rotate({pos:i});return this.updateViewport(s,Wl,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:i}=this;if(this.dragRotate&&i&&e.velocity){const s=this.getCenter(e),n=[s[0]+e.velocityX*i/2,s[1]+e.velocityY*i/2],a=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:T_},{isDragging:!1,isRotating:!0})}else{const s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;e.srcEvent.preventDefault();const{speed:s=.01,smooth:n=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:a}=e;let u=2/(1+Math.exp(-Math.abs(a*s)));a<0&&u!==0&&(u=1/u);const c=this.controllerState.zoom({pos:i,scale:u});return this.updateViewport(c,{...this._getTransitionProps({around:i}),transitionDuration:n?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.controllerState.rotateStart({pos:i});return this.updateViewport(s,Wl,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const i=this.getCenter(e);i[0]-=e.deltaX;const s=this.controllerState.rotate({pos:i});return this.updateViewport(s,Wl,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:i}=this;if(this.touchRotate&&i&&e.velocityY){const s=this.getCenter(e),n=[s[0],s[1]+=e.velocityY*i/2],a=this.controllerState.rotate({pos:n});this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:i,transitionEasing:T_},{isDragging:!1,isRotating:!0}),this.blockEvents(i)}else{const s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.controllerState.zoomStart({pos:i}).rotateStart({pos:i});return lu._startPinchRotation=e.rotation,lu._lastPinchEvent=e,this.updateViewport(s,Wl,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let i=this.controllerState;if(this.touchZoom){const{scale:s}=e,n=this.getCenter(e);i=i.zoom({pos:n,scale:s})}if(this.touchRotate){const{rotation:s}=e;i=i.rotate({deltaAngleX:lu._startPinchRotation-s})}return this.updateViewport(i,Wl,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),lu._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:i}=this,{_lastPinchEvent:s}=lu;if(this.touchZoom&&i&&s&&e.scale!==s.scale){const n=this.getCenter(e);let a=this.controllerState.rotateEnd();const u=Math.log2(e.scale),c=(u-Math.log2(s.scale))/(e.deltaTime-s.deltaTime),_=Math.pow(2,u+c*i/2);a=a.zoom({pos:n,scale:_}).zoomEnd(),this.updateViewport(a,{...this._getTransitionProps({around:n}),transitionDuration:i,transitionEasing:T_},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(i)}else{const n=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(n,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return lu._startPinchRotation=null,lu._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const i=this.getCenter(e);if(!this.isPointInBounds(i,e))return!1;const s=this.isFunctionKeyPressed(e),n=this.controllerState.zoom({pos:i,scale:s?.5:2});return this.updateViewport(n,this._getTransitionProps({around:i}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const i=this.isFunctionKeyPressed(e),{zoomSpeed:s,moveSpeed:n,rotateSpeedX:a,rotateSpeedY:u}=this.keyboard===!0?{}:this.keyboard,{controllerState:c}=this;let _;const w={};switch(e.srcEvent.code){case"Minus":_=i?c.zoomOut(s).zoomOut(s):c.zoomOut(s),w.isZooming=!0;break;case"Equal":_=i?c.zoomIn(s).zoomIn(s):c.zoomIn(s),w.isZooming=!0;break;case"ArrowLeft":i?(_=c.rotateLeft(a),w.isRotating=!0):(_=c.moveLeft(n),w.isPanning=!0);break;case"ArrowRight":i?(_=c.rotateRight(a),w.isRotating=!0):(_=c.moveRight(n),w.isPanning=!0);break;case"ArrowUp":i?(_=c.rotateUp(u),w.isRotating=!0):(_=c.moveUp(n),w.isPanning=!0);break;case"ArrowDown":i?(_=c.rotateDown(u),w.isRotating=!0):(_=c.moveDown(n),w.isPanning=!0);break;default:return!1}return this.updateViewport(_,this._getTransitionProps(),w),!0}_getTransitionProps(e){const{transition:i}=this;return!i||!i.transitionInterpolator?Wl:e?{...i,transitionInterpolator:new QR({...e,...i.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:i}}class u${constructor(e,i){this._viewportProps=this.applyConstraints(e),this._state=i}getViewportProps(){return this._viewportProps}getState(){return this._state}}const EI=5,h$=1.2;class f$ extends u${constructor(e){const{width:i,height:s,latitude:n,longitude:a,zoom:u,bearing:c=0,pitch:_=0,altitude:w=1.5,position:S=[0,0,0],maxZoom:A=20,minZoom:P=0,maxPitch:D=60,minPitch:U=0,startPanLngLat:L,startZoomLngLat:W,startRotatePos:ee,startBearing:G,startPitch:se,startZoom:fe,normalize:Se=!0}=e;Ys(Number.isFinite(a)),Ys(Number.isFinite(n)),Ys(Number.isFinite(u)),super({width:i,height:s,latitude:n,longitude:a,zoom:u,bearing:c,pitch:_,altitude:w,maxZoom:A,minZoom:P,maxPitch:D,minPitch:U,normalize:Se,position:S},{startPanLngLat:L,startZoomLngLat:W,startRotatePos:ee,startBearing:G,startPitch:se,startZoom:fe}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:i}){const s=this.getState().startPanLngLat||this._unproject(i);if(!s)return this;const a=this.makeViewport(this.getViewportProps()).panByPosition(s,e);return this._getUpdatedState(a)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:i=0,deltaAngleY:s=0}){const{startRotatePos:n,startBearing:a,startPitch:u}=this.getState();if(!n||a===void 0||u===void 0)return this;let c;return e?c=this._getNewRotation(e,n,u,a):c={bearing:a+i,pitch:u+s},this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:i,scale:s}){let{startZoom:n,startZoomLngLat:a}=this.getState();if(a||(n=this.getViewportProps().zoom,a=this._unproject(i)||this._unproject(e)),!a)return this;const{maxZoom:u,minZoom:c}=this.getViewportProps();let _=n+Math.log2(s);_=ic(_,c,u);const w=this.makeViewport({...this.getViewportProps(),zoom:_});return this._getUpdatedState({zoom:_,...w.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const i=e.getViewportProps(),s={...this.getViewportProps()},{bearing:n,longitude:a}=s;return Math.abs(n-i.bearing)>180&&(s.bearing=n<0?n+360:n-360),Math.abs(a-i.longitude)>180&&(s.longitude=a<0?a+360:a-360),s}applyConstraints(e){const{maxZoom:i,minZoom:s,zoom:n}=e;e.zoom=ic(n,s,i);const{maxPitch:a,minPitch:u,pitch:c}=e;e.pitch=ic(c,u,a);const{normalize:_=!0}=e;return _&&Object.assign(e,W8(e)),e}_zoomFromCenter(e){const{width:i,height:s}=this.getViewportProps();return this.zoom({pos:[i/2,s/2],scale:e})}_panFromCenter(e){const{width:i,height:s}=this.getViewportProps();return this.pan({startPos:[i/2,s/2],pos:[i/2+e[0],s/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const i=this.makeViewport(this.getViewportProps());return e&&i.unproject(e)}_getNewRotation(e,i,s,n){const a=e[0]-i[0],u=e[1]-i[1],c=e[1],_=i[1],{width:w,height:S}=this.getViewportProps(),A=a/w;let P=0;u>0?Math.abs(S-_)>EI&&(P=u/(_-S)*h$):u<0&&_>EI&&(P=1-c/_),P=ic(P,-1,1);const{minPitch:D,maxPitch:U}=this.getViewportProps(),L=n+180*A;let W=s;return P>0?W=s+P*(U-s):P<0&&(W=s-P*(D-s)),{pitch:W,bearing:L}}}class d$ extends c${constructor(){super(...arguments),this.ControllerState=f$,this.transition={transitionDuration:300,transitionInterpolator:new QR({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const i=this.props;super.setProps(e),(!i||i.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}class Z1 extends t${constructor(e={}){super(e)}get ViewportType(){return Du}get ControllerType(){return d$}}Z1.displayName="MapView";const p$=new ZR;function g$(t,e){const i=t.order??1/0,s=e.order??1/0;return i-s}class m${constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const i=this._defaultEffects;if(!i.find(s=>s.id===e.id)){const s=i.findIndex(n=>g$(n,e)>0);s<0?i.push(e):i.splice(s,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Kr(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const i=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),i}getEffects(){return this._resolvedEffects}_setEffects(e){const i={};for(const n of this.effects)i[n.id]=n;const s=[];for(const n of e){const a=i[n.id];let u=n;a&&a!==n?a.setProps?(a.setProps(n.props),u=a):a.cleanup(this._context):a||n.setup(this._context),s.push(u),delete i[n.id]}for(const n in i)i[n].cleanup(this._context);this.effects=s,this._resolvedEffects=s.concat(this._defaultEffects),e.some(n=>n instanceof ZR)||this._resolvedEffects.push(p$),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class _$ extends X1{shouldDrawLayer(e){const{operation:i}=e.props;return i.includes("draw")||i.includes("terrain")}}const y$="deckRenderer.renderLayers";class b${constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new _$(e),this.pickLayersPass=new JR(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const i=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,s={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};s.effects&&this._preRender(s.effects,s);const n=this.lastPostProcessEffect?this.renderBuffers[0]:s.target;this.lastPostProcessEffect&&(s.clearColor=[0,0,0,0],s.clearCanvas=!0);const a=i.render({...s,target:n});s.effects&&this._postRender(s.effects,s),this.renderCount++,nr(y$,this,a,e)}needsRedraw(e={clearRedrawFlags:!1}){const i=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),i}finalize(){const{renderBuffers:e}=this;for(const i of e)i.delete();e.length=0}_preRender(e,i){this.lastPostProcessEffect=null,i.preRenderStats=i.preRenderStats||{};for(const s of e)i.preRenderStats[s.id]=s.preRender(i),s.postRender&&(this.lastPostProcessEffect=s.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,i=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(s=>{const n=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${s}`,colorAttachments:[n]}))});for(const s of e)s.resize(i)}_postRender(e,i){const{renderBuffers:s}=this,n={...i,inputBuffer:s[0],swapBuffer:s[1]};for(const a of e)if(a.postRender){n.target=a.id===this.lastPostProcessEffect?i.target:void 0;const u=a.postRender(n);n.inputBuffer=u,n.swapBuffer=u===s[0]?s[1]:s[0]}}}const v$={pickedColor:null,pickedObjectIndex:-1};function x$({pickedColors:t,decodePickingColor:e,deviceX:i,deviceY:s,deviceRadius:n,deviceRect:a}){const{x:u,y:c,width:_,height:w}=a;let S=n*n,A=-1,P=0;for(let D=0;DS)P+=4*_;else for(let W=0;W<_;W++){if(t[P+3]-1>=0){const G=W+u-i,se=G*G+L;se<=S&&(S=se,A=P)}P+=4}}if(A>=0){const D=t.slice(A,A+4),U=e(D);if(U){const L=Math.floor(A/4/_),W=A/4-L*_;return{...U,pickedColor:D,pickedX:u+W,pickedY:c+L}}qi.error("Picked non-existent layer. Is picking buffer corrupt?")()}return v$}function w$({pickedColors:t,decodePickingColor:e}){const i=new Map;if(t){for(let s=0;s=0){const a=t.slice(s,s+4),u=a.join(",");if(!i.has(u)){const c=e(a);c?i.set(u,{...c,color:a}):qi.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}function ek({pickInfo:t,viewports:e,pixelRatio:i,x:s,y:n,z:a}){let u=e[0];e.length>1&&(u=S$((t==null?void 0:t.pickedViewports)||e,{x:s,y:n}));let c;if(u){const _=[s-u.x,n-u.y];a!==void 0&&(_[2]=a),c=u.unproject(_)}return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:s,y:n,pixel:[s,n],coordinate:c,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:i}}function T$(t){const{pickInfo:e,lastPickedInfo:i,mode:s,layers:n}=t,{pickedColor:a,pickedLayer:u,pickedObjectIndex:c}=e,_=u?[u]:[];if(s==="hover"){const A=i.index,P=i.layerId,D=u?u.props.id:null;if(D!==P||c!==A){if(D!==P){const U=n.find(L=>L.props.id===P);U&&_.unshift(U)}i.layerId=D,i.index=c,i.info=null}}const w=ek(t),S=new Map;return S.set(null,w),_.forEach(A=>{let P={...w};A===u&&(P.color=a,P.index=c,P.picked=!0),P=tk({layer:A,info:P,mode:s});const D=P.layer;A===u&&s==="hover"&&(i.info=P),S.set(D.id,P),s==="hover"&&D.updateAutoHighlight(P)}),S}function tk({layer:t,info:e,mode:i}){for(;t&&e;){const s=e.layer||null;e.sourceLayer=s,e.layer=t,e=t.getPickingInfo({info:e,mode:i,sourceLayer:s}),t=t.parent}return e}function S$(t,e){for(let i=t.length-1;i>=0;i--){const s=t[i];if(s.containsPixel(e))return s}return t[0]}class E${constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new JR(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:i,layers:s,viewports:n},a=this.lastPickedInfo.info){const u=a&&a.layer&&a.layer.id,c=a&&a.viewport&&a.viewport.id,_=u?s.find(P=>P.id===u):null,w=c&&n.find(P=>P.id===c)||n[0],S=w&&w.unproject([e-w.x,i-w.y]);return{...a,...{x:e,y:i,viewport:w,coordinate:S,layer:_}}}_resizeBuffer(){var i,s;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const n=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=n}const{canvas:e}=this.device.getCanvasContext();(i=this.pickingFBO)==null||i.resize({width:e.width,height:e.height}),(s=this.depthFBO)==null||s.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const i=e.filter(s=>this.pickLayersPass.shouldDrawLayer(s)&&!s.isComposite);return i.length?i:null}_pickClosestObject({layers:e,views:i,viewports:s,x:n,y:a,radius:u=0,depth:c=1,mode:_="query",unproject3D:w,onViewportActive:S,effects:A}){const P=this.device.canvasContext.cssToDeviceRatio(),D=this._getPickable(e);if(!D||s.length===0)return{result:[],emptyInfo:ek({viewports:s,x:n,y:a,pixelRatio:P})};this._resizeBuffer();const U=this.device.canvasContext.cssToDevicePixels([n,a],!0),L=[U.x+Math.floor(U.width/2),U.y+Math.floor(U.height/2)],W=Math.round(u*P),{width:ee,height:G}=this.pickingFBO,se=this._getPickingRect({deviceX:L[0],deviceY:L[1],deviceRadius:W,deviceWidth:ee,deviceHeight:G}),fe={x:n-u,y:a-u,width:u*2+1,height:u*2+1};let Se;const Te=[],Fe=new Set;for(let Ne=0;Ne=w);Je++){const Xe=Te[Je];let qe={color:Xe.pickedColor,layer:null,index:Xe.pickedObjectIndex,picked:!0,x:n,y:a,pixelRatio:D};qe=tk({layer:Xe.pickedLayer,info:qe,mode:_});const ht=qe.layer.id;Fe.has(ht)||Fe.set(ht,new Set);const _t=Fe.get(ht),Dt=qe.object??qe.index;_t.has(Dt)||(_t.add(Dt),Ne.push(qe))}return Ne}_drawAndSample({layers:e,views:i,viewports:s,onViewportActive:n,deviceRect:a,cullRect:u,effects:c,pass:_},w=!1){const S=w?this.depthFBO:this.pickingFBO,A={layers:e,layerFilter:this.layerFilter,views:i,viewports:s,onViewportActive:n,pickingFBO:S,deviceRect:a,cullRect:u,effects:c,pass:_,pickZ:w,preRenderStats:{}};for(const G of c)G.useInPicking&&(A.preRenderStats[G.id]=G.preRender(A));const{decodePickingColor:P}=this.pickLayersPass.render(A),{x:D,y:U,width:L,height:W}=a,ee=new(w?Float32Array:Uint8Array)(L*W*4);return this.device.readPixelsToArrayWebGL(S,{sourceX:D,sourceY:U,sourceWidth:L,sourceHeight:W,target:ee}),{pickedColors:ee,decodePickingColor:P}}_getPickingRect({deviceX:e,deviceY:i,deviceRadius:s,deviceWidth:n,deviceHeight:a}){const u=Math.max(0,e-s),c=Math.max(0,i-s),_=Math.min(n,e+s+1)-u,w=Math.min(a,i+s+1)-c;return _<=0||w<=0?null:{x:u,y:c,width:_,height:w}}}const A$={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},I$="top-left",AI="__root";class C${constructor({deck:e,parentElement:i}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=i}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Kr(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(i=>i.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const i={};for(const s of this.resolvedWidgets)i[s.id]=s;this.resolvedWidgets.length=0;for(const s of this.defaultWidgets)i[s.id]=null,this.resolvedWidgets.push(s);for(let s of e){const n=i[s.id];n?n.viewId!==s.viewId||n.placement!==s.placement?(this._remove(n),this._add(s)):s!==n&&(n.setProps(s.props),s=n):this._add(s),i[s.id]=null,this.resolvedWidgets.push(s)}for(const s in i){const n=i[s];n&&this._remove(n)}this.widgets=e}_add(e){const{viewId:i=null,placement:s=I$}=e,n=e.onAdd({deck:this.deck,viewId:i});n&&this._getContainer(i,s).append(n),e._element=n}_remove(e){e.onRemove(),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,i){var u;const s=e||AI;let n=this.containers[s];n||(n=document.createElement("div"),n.style.pointerEvents="none",n.style.position="absolute",n.style.overflow="hidden",(u=this.parentElement)==null||u.append(n),this.containers[s]=n);let a=n.querySelector(`.${i}`);return a||(a=document.createElement("div"),a.className=i,a.style.position="absolute",a.style.zIndex="2",Object.assign(a.style,A$[i]),n.append(a)),a}_updateContainers(){const e=this.deck.width,i=this.deck.height;for(const s in this.containers){const n=this.lastViewports[s]||null,a=s===AI||n,u=this.containers[s];a?(u.style.display="block",u.style.left=`${n?n.x:0}px`,u.style.top=`${n?n.y:0}px`,u.style.width=`${n?n.width:e}px`,u.style.height=`${n?n.height:i}px`):u.style.display="none"}}onRedraw({viewports:e,layers:i}){var a,u;const s=e.reduce((c,_)=>(c[_.id]=_,c),{}),{lastViewports:n}=this;for(const c of this.getWidgets()){const{viewId:_}=c;if(_){const w=s[_];w&&(c.onViewportChange&&!w.equals(n[_])&&c.onViewportChange(w),(a=c.onRedraw)==null||a.call(c,{viewports:[w],layers:i}))}else{if(c.onViewportChange)for(const w of e)w.equals(n[w.id])||c.onViewportChange(w);(u=c.onRedraw)==null||u.call(c,{viewports:e,layers:i})}}this.lastViewports=s,this._updateContainers()}onHover(e,i){var s,n;for(const a of this.getWidgets()){const{viewId:u}=a;(!u||u===((s=e.viewport)==null?void 0:s.id))&&((n=a.onHover)==null||n.call(a,e,i))}}onEvent(e,i){var n,a;const s=Mw[i.type];if(s)for(const u of this.getWidgets()){const{viewId:c}=u;(!c||c===((n=e.viewport)==null?void 0:n.id))&&((a=u[s.handler])==null||a.call(u,e,i))}}}const P$={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class M${constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const i=document.createElement("div");return i.className="deck-tooltip",Object.assign(i.style,P$),this.deck=e,this.element=i,i}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var i;this.isVisible&&e.id===((i=this.lastViewport)==null?void 0:i.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:i}=this,s=i&&i.props.getTooltip;if(!s)return;const n=s(e);this.lastViewport=e.viewport,this.setTooltip(n,e.x,e.y)}setTooltip(e,i,s){const n=this.element;if(n){if(typeof e=="string")n.innerText=e;else if(e)e.text&&(n.innerText=e.text),e.html&&(n.innerHTML=e.html),e.className&&(n.className=e.className);else{this.isVisible=!1,n.style.display="none";return}this.isVisible=!0,n.style.display="block",n.style.transform=`translate(${i}px, ${s}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(n.style,e.style)}}}var cf;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(cf||(cf={}));const Y1={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Us=(t,e,i)=>e?t.enable(i):t.disable(i),II=(t,e,i)=>t.hint(i,e),Wr=(t,e,i)=>t.pixelStorei(i,e),CI=(t,e,i)=>{const s=i===36006?36009:36008;return t.bindFramebuffer(s,e)},Ip=(t,e,i)=>{const n={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[i];t.bindBuffer(n,e)};function bx(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const R$={3042:Us,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:Us,2885:(t,e)=>t.cullFace(e),2929:Us,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:Us,35723:II,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var i;return(i=t.bindTransformFeedback)==null?void 0:i.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:CI,36010:CI,34964:Ip,36662:Ip,36663:Ip,35053:Ip,35055:Ip,2886:(t,e)=>t.frontFace(e),33170:II,2849:(t,e)=>t.lineWidth(e),32823:Us,32824:"polygonOffset",10752:"polygonOffset",35977:Us,32926:Us,32928:Us,32938:"sampleCoverage",32939:"sampleCoverage",3089:Us,3088:(t,e)=>t.scissor(...e),2960:Us,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:Us,10754:Us,12288:Us,12289:Us,12290:Us,12291:Us,12292:Us,12293:Us,12294:Us,12295:Us,3333:Wr,3317:Wr,37440:Wr,37441:Wr,37443:Wr,3330:Wr,3332:Wr,3331:Wr,3314:Wr,32878:Wr,3316:Wr,3315:Wr,32877:Wr,framebuffer:(t,e)=>{const i=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,i)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const i=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...i)},blendFunc:(t,e)=>{const i=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...i)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=bx(e)?e:[e,e];const[i,s]=e;t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,s)},stencilFunc:(t,e)=>{e=bx(e)&&e.length===3?[...e,...e]:e;const[i,s,n,a,u,c]=e;t.stencilFuncSeparate(1028,i,s,n),t.stencilFuncSeparate(1029,a,u,c)},stencilOp:(t,e)=>{e=bx(e)&&e.length===3?[...e,...e]:e;const[i,s,n,a,u,c]=e;t.stencilOpSeparate(1028,i,s,n),t.stencilOpSeparate(1029,a,u,c)},viewport:(t,e)=>t.viewport(...e)};function As(t,e,i){return e[t]!==void 0?e[t]:i[t]}const k$={blendEquation:(t,e,i)=>t.blendEquationSeparate(As(32777,e,i),As(34877,e,i)),blendFunc:(t,e,i)=>t.blendFuncSeparate(As(32969,e,i),As(32968,e,i),As(32971,e,i),As(32970,e,i)),polygonOffset:(t,e,i)=>t.polygonOffset(As(32824,e,i),As(10752,e,i)),sampleCoverage:(t,e,i)=>t.sampleCoverage(As(32938,e,i),As(32939,e,i)),stencilFuncFront:(t,e,i)=>t.stencilFuncSeparate(1028,As(2962,e,i),As(2967,e,i),As(2963,e,i)),stencilFuncBack:(t,e,i)=>t.stencilFuncSeparate(1029,As(34816,e,i),As(36003,e,i),As(36004,e,i)),stencilOpFront:(t,e,i)=>t.stencilOpSeparate(1028,As(2964,e,i),As(2965,e,i),As(2966,e,i)),stencilOpBack:(t,e,i)=>t.stencilOpSeparate(1029,As(34817,e,i),As(34818,e,i),As(34819,e,i))},PI={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,i)=>t({[e]:i}),hint:(t,e,i)=>t({[e]:i}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,i)=>t({36007:i}),bindTransformFeedback:(t,e,i)=>t({36389:i}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,i)=>{switch(e){case 36160:return t({36006:i,36010:i});case 36009:return t({36006:i});case 36008:return t({36010:i});default:return null}},bindBuffer:(t,e,i)=>{const s={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return s?t({[s]:i}):{valueChanged:!0}},blendColor:(t,e,i,s,n)=>t({32773:new Float32Array([e,i,s,n])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,i)=>t({32777:e,34877:i}),blendFunc:(t,e,i)=>t({32969:e,32968:i,32971:e,32970:i}),blendFuncSeparate:(t,e,i,s,n)=>t({32969:e,32968:i,32971:s,32970:n}),clearColor:(t,e,i,s,n)=>t({3106:new Float32Array([e,i,s,n])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,i,s,n)=>t({3107:[e,i,s,n]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,i)=>t({2928:new Float32Array([e,i])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,i)=>t({32824:e,10752:i}),sampleCoverage:(t,e,i)=>t({32938:e,32939:i}),scissor:(t,e,i,s,n)=>t({3088:new Int32Array([e,i,s,n])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,i)=>t({[e===1028?2968:36005]:i}),stencilFunc:(t,e,i,s)=>t({2962:e,2967:i,2963:s,34816:e,36003:i,36004:s}),stencilFuncSeparate:(t,e,i,s,n)=>t({[e===1028?2962:34816]:i,[e===1028?2967:36003]:s,[e===1028?2963:36004]:n}),stencilOp:(t,e,i,s)=>t({2964:e,2965:i,2966:s,34817:e,34818:i,34819:s}),stencilOpSeparate:(t,e,i,s,n)=>t({[e===1028?2964:34817]:i,[e===1028?2965:34818]:s,[e===1028?2966:34819]:n}),viewport:(t,e,i,s,n)=>t({2978:[e,i,s,n]})},Qo=(t,e)=>t.isEnabled(e),MI={3042:Qo,2884:Qo,2929:Qo,3024:Qo,32823:Qo,32926:Qo,32928:Qo,3089:Qo,2960:Qo,35977:Qo},O$=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Gf(t,e){if(F$(e))return;const i={};for(const n in e){const a=Number(n),u=R$[n];u&&(typeof u=="string"?i[u]=!0:u(t,e[n],a))}const s=t.state&&t.state.cache;if(s)for(const n in i){const a=k$[n];a(t,e,s)}}function ik(t,e=Y1){if(typeof e=="number"){const n=e,a=MI[n];return a?a(t,n):t.getParameter(n)}const i=Array.isArray(e)?e:Object.keys(e),s={};for(const n of i){const a=MI[n];s[n]=a?a(t,Number(n)):t.getParameter(Number(n))}return s}function D$(t){Gf(t,Y1)}function F$(t){for(const e in t)return!1;return!0}function N$(t,e){if(t===e)return!0;const i=Array.isArray(t)||ArrayBuffer.isView(t),s=Array.isArray(e)||ArrayBuffer.isView(e);if(i&&s&&t.length===e.length){for(let n=0;n{}}={}){K(this,"gl");K(this,"program",null);K(this,"stateStack",[]);K(this,"enable",!0);K(this,"cache");K(this,"log");this.gl=e,this.cache=i?ik(e):Object.assign({},Y1),this.log=s,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){is(this.stateStack.length>0);const e=this.stateStack[this.stateStack.length-1];Gf(this.gl,e),this.stateStack.pop()}_updateCache(e){let i=!1,s;const n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const a in e){is(a!==void 0);const u=e[a],c=this.cache[a];N$(u,c)||(i=!0,s=c,n&&!(a in n)&&(n[a]=c),this.cache[a]=u)}return{valueChanged:i,oldValue:s}}}function Nu(t){return t.state}function sk(t,e){const{enable:i=!0,copyState:s}=e;if(is(s!==void 0),!t.state){t.state=new B$(t,{copyState:s}),z$(t);for(const a in PI){const u=PI[a];L$(t,a,u)}RI(t,"getParameter"),RI(t,"isEnabled")}const n=Nu(t);return n.enable=i,t}function A0(t){let e=Nu(t);e||(sk(t,{copyState:!1}),e=Nu(t)),e.push()}function bg(t){const e=Nu(t);is(e),e.pop()}function RI(t,e){const i=t[e].bind(t);t[e]=function(n){if(n===void 0||O$.has(n))return i(n);const a=Nu(t);return n in a.cache||(a.cache[n]=i(n)),a.enable?a.cache[n]:i(n)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function L$(t,e,i){if(!t[e])return;const s=t[e].bind(t);t[e]=function(...a){const u=Nu(t),{valueChanged:c,oldValue:_}=i(u._updateCache,...a);return c&&s(...a),_},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function z$(t){const e=t.useProgram.bind(t);t.useProgram=function(s){const n=Nu(t);n.program!==s&&(e(s),n.program=s)}}const U$={powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function V$(t,e){e={...U$,...e};let i=null;const s=a=>i=a.statusMessage||i;t.addEventListener("webglcontextcreationerror",s,!1);let n=null;if(n||(n=t.getContext("webgl2",e)),t.removeEventListener("webglcontextcreationerror",s,!1),!n)throw new Error(`Failed to create WebGL context: ${i||"Unknown error"}`);if(e.onContextLost){const{onContextLost:a}=e;t.addEventListener("webglcontextlost",u=>a(u),!1)}if(e.onContextRestored){const{onContextRestored:a}=e;t.addEventListener("webglcontextrestored",u=>a(u),!1)}return n}function pc(t,e,i){return i[e]===void 0&&(i[e]=t.getExtension(e)||null),i[e]}function j$(t,e){const i=t.getParameter(7936),s=t.getParameter(7937);pc(t,"WEBGL_debug_renderer_info",e);const n=e.WEBGL_debug_renderer_info,a=t.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),u=t.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),c=a||i,_=u||s,w=t.getParameter(7938),S=nk(c,_),A=$$(c,_),P=H$(c,_);return{type:"webgl",gpu:S,gpuType:P,gpuBackend:A,vendor:c,renderer:_,version:w,shadingLanguage:"glsl",shadingLanguageVersion:300}}function nk(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function $$(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function H$(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(nk(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function rk(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Bn="texture-compression-bc",Hi="texture-compression-astc",ea="texture-compression-etc2",W$="texture-compression-etc1-webgl",S_="texture-compression-pvrtc-webgl",vx="texture-compression-atc-webgl",Cp="float32-renderable-webgl",xx="float16-renderable-webgl",q$="rgb9e5ufloat_renderable-webgl",wx="snorm8-renderable-webgl",Pp="norm16-renderable-webgl",Tx="snorm16-renderable-webgl",E_="float32-filterable",kI="float16-filterable-webgl",zp="WEBGL_compressed_texture_s3tc",Up="WEBGL_compressed_texture_s3tc_srgb",uf="EXT_texture_compression_rgtc",hf="EXT_texture_compression_bptc",X$="WEBGL_compressed_texture_etc",Z$="WEBGL_compressed_texture_astc",Y$="WEBGL_compressed_texture_etc1",K$="WEBGL_compressed_texture_pvrtc",J$="WEBGL_compressed_texture_atc",OI="EXT_texture_norm16",DI="EXT_render_snorm",G$="EXT_color_buffer_float",K1={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat_renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[DI],"norm16-renderable-webgl":[OI],"snorm16-renderable-webgl":[OI,DI],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[zp,Up,uf,hf],"texture-compression-bc5-webgl":[uf],"texture-compression-bc7-webgl":[hf],"texture-compression-etc2":[X$],"texture-compression-astc":[Z$],"texture-compression-etc1-webgl":[Y$],"texture-compression-pvrtc-webgl":[K$],"texture-compression-atc-webgl":[J$]};function Q$(t){return t in K1}function e9(t,e,i){return(K1[e]||[]).every(n=>pc(t,n,i))}const I0={"rgb8unorm-unsized":{gl:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,rb:!0},r8snorm:{gl:36756,b:1,c:1,render:wx},r8uint:{gl:33330,b:1,c:1,rb:!0},r8sint:{gl:33329,b:1,c:1,rb:!0},rg8unorm:{gl:33323,b:2,c:2,rb:!0},rg8snorm:{gl:36757,b:2,c:2,render:wx},rg8uint:{gl:33336,b:2,c:2,rb:!0},rg8sint:{gl:33335,b:2,c:2,rb:!0},r16uint:{gl:33332,b:2,c:1,rb:!0},r16sint:{gl:33331,b:2,c:1,rb:!0},r16float:{gl:33325,b:2,c:1,render:xx,filter:"float16-filterable-webgl",rb:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:Pp,rb:!0},"r16snorm-webgl":{gl:36760,b:2,c:1,f:Tx},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,rb:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,rb:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,rb:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,b:4,c:4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4,render:wx},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:xx,filter:kI,rb:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,render:Pp},"rg16snorm-webgl":{gl:36761,b:2,c:2,render:Tx},r32uint:{gl:33334,b:4,c:1,bpp:4,rb:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,rb:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:Cp,filter:E_},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:q$},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:Cp,rb:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,rb:!0},"rgb10a2uint-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,rb:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:Pp},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:Pp},rg32uint:{gl:33340,b:8,c:2,rb:!0},rg32sint:{gl:33339,b:8,c:2,rb:!0},rg32float:{gl:33328,b:8,c:2,render:Cp,filter:E_,rb:!0},rgba16uint:{gl:36214,b:8,c:4,rb:!0},rgba16sint:{gl:36232,b:8,c:4,rb:!0},rgba16float:{gl:34842,b:8,c:4,render:xx,filter:kI},"rgba16unorm-webgl":{gl:32859,b:2,c:4,render:Pp,rb:!0},"rgba16snorm-webgl":{gl:36763,b:2,c:4,render:Tx},"rgb32float-webgl":{gl:34837,render:Cp,filter:E_,gl2ext:G$,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,rb:!0},rgba32sint:{gl:36226,b:16,c:4,rb:!0},rgba32float:{gl:34836,b:16,c:4,render:Cp,filter:E_,rb:!0},stencil8:{gl:36168,b:1,c:1,attachment:36128,rb:!0},depth16unorm:{gl:33189,b:2,c:1,attachment:36096,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096,dataFormat:6402,types:[5125]},depth32float:{gl:36012,b:4,c:1,attachment:36096,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,dataFormat:34041,types:[34042],rb:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:zp,f:Bn},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:Up,f:Bn},"bc1-rgba-unorm":{gl:33777,x:zp,f:Bn},"bc1-rgba-unorm-srgb":{gl:35916,x:Up,f:Bn},"bc2-rgba-unorm":{gl:33778,x:zp,f:Bn},"bc2-rgba-unorm-srgb":{gl:35918,x:Up,f:Bn},"bc3-rgba-unorm":{gl:33779,x:zp,f:Bn},"bc3-rgba-unorm-srgb":{gl:35919,x:Up,f:Bn},"bc4-r-unorm":{gl:36283,x:uf,f:Bn},"bc4-r-snorm":{gl:36284,x:uf,f:Bn},"bc5-rg-unorm":{gl:36285,x:uf,f:Bn},"bc5-rg-snorm":{gl:36286,x:uf,f:Bn},"bc6h-rgb-ufloat":{gl:36495,x:hf,f:Bn},"bc6h-rgb-float":{gl:36494,x:hf,f:Bn},"bc7-rgba-unorm":{gl:36492,x:hf,f:Bn},"bc7-rgba-unorm-srgb":{gl:36493,x:hf,f:Bn},"etc2-rgb8unorm":{gl:37492,f:ea},"etc2-rgb8unorm-srgb":{gl:37494,f:ea},"etc2-rgb8a1unorm":{gl:37496,f:ea},"etc2-rgb8a1unorm-srgb":{gl:37497,f:ea},"etc2-rgba8unorm":{gl:37493,f:ea},"etc2-rgba8unorm-srgb":{gl:37495,f:ea},"eac-r11unorm":{gl:37488,f:ea},"eac-r11snorm":{gl:37489,f:ea},"eac-rg11unorm":{gl:37490,f:ea},"eac-rg11snorm":{gl:37491,f:ea},"astc-4x4-unorm":{gl:37808,f:Hi},"astc-4x4-unorm-srgb":{gl:37840,f:Hi},"astc-5x4-unorm":{gl:37809,f:Hi},"astc-5x4-unorm-srgb":{gl:37841,f:Hi},"astc-5x5-unorm":{gl:37810,f:Hi},"astc-5x5-unorm-srgb":{gl:37842,f:Hi},"astc-6x5-unorm":{gl:37811,f:Hi},"astc-6x5-unorm-srgb":{gl:37843,f:Hi},"astc-6x6-unorm":{gl:37812,f:Hi},"astc-6x6-unorm-srgb":{gl:37844,f:Hi},"astc-8x5-unorm":{gl:37813,f:Hi},"astc-8x5-unorm-srgb":{gl:37845,f:Hi},"astc-8x6-unorm":{gl:37814,f:Hi},"astc-8x6-unorm-srgb":{gl:37846,f:Hi},"astc-8x8-unorm":{gl:37815,f:Hi},"astc-8x8-unorm-srgb":{gl:37847,f:Hi},"astc-10x5-unorm":{gl:37819,f:Hi},"astc-10x5-unorm-srgb":{gl:37851,f:Hi},"astc-10x6-unorm":{gl:37817,f:Hi},"astc-10x6-unorm-srgb":{gl:37849,f:Hi},"astc-10x8-unorm":{gl:37818,f:Hi},"astc-10x8-unorm-srgb":{gl:37850,f:Hi},"astc-10x10-unorm":{gl:37819,f:Hi},"astc-10x10-unorm-srgb":{gl:37851,f:Hi},"astc-12x10-unorm":{gl:37820,f:Hi},"astc-12x10-unorm-srgb":{gl:37852,f:Hi},"astc-12x12-unorm":{gl:37821,f:Hi},"astc-12x12-unorm-srgb":{gl:37853,f:Hi},"pvrtc-rgb4unorm-webgl":{gl:35840,f:S_},"pvrtc-rgba4unorm-webgl":{gl:35842,f:S_},"pvrtc-rbg2unorm-webgl":{gl:35841,f:S_},"pvrtc-rgba2unorm-webgl":{gl:35843,f:S_},"etc1-rbg-unorm-webgl":{gl:36196,f:W$},"atc-rgb-unorm-webgl":{gl:35986,f:vx},"atc-rgba-unorm-webgl":{gl:35986,f:vx},"atc-rgbai-unorm-webgl":{gl:34798,f:vx}},t9={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},i9={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function J1(t,e,i){const s=I0[e];if(!s||s.gl===void 0)return!1;const n=s.x||s.gl2ext;return n?!!pc(t,n,i):!0}function ok(t){const e=I0[t],i=e==null?void 0:e.gl;if(i===void 0)throw new Error(`Unsupported texture format ${t}`);return i}function s9(t,e,i){if(!J1(t,e,i)||e.startsWith("depth")||e.startsWith("stencil"))return!1;try{if(gR(e).signed)return!1}catch{return!1}return e.endsWith("32float")?!!pc(t,"OES_texture_float_linear, extensions",i):e.endsWith("16float")?!!pc(t,"OES_texture_half_float_linear, extensions",i):!0}function n9(t,e,i){return!(!J1(t,e,i)||typeof e=="number")}function Py(t){var n;const e=I0[t],i=ok(t),s=gR(t);return{format:i,dataFormat:(e==null?void 0:e.dataFormat)||o9(s.format,s.integer,s.normalized,i),type:s.dataType?rk(s.dataType):((n=e==null?void 0:e.types)==null?void 0:n[0])||5121,compressed:s.compressed}}function r9(t){const e=I0[t];if(!(e!=null&&e.attachment))throw new Error(`${t} is not a depth stencil format`);return e.attachment}function FI(t){const e=Py(t),i=t9[e.dataFormat]||4,s=i9[e.type]||1;return i*s}function o9(t,e,i,s){if(s===6408||s===6407)return s;switch(t){case"r":return e&&!i?36244:6403;case"rg":return e&&!i?33320:33319;case"rgb":return e&&!i?36248:6407;case"rgba":return e&&!i?36249:6408;default:return 6408}}const NI={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class a9 extends UU{constructor(i,s,n){super([],n);K(this,"gl");K(this,"extensions");K(this,"testedFeatures",new Set);this.gl=i,this.extensions=s,pc(i,"EXT_color_buffer_float",s)}*[Symbol.iterator](){const i=this.getFeatures();for(const s of i)this.has(s)&&(yield s);return[]}has(i){return this.disabledFeatures[i]?!1:(this.testedFeatures.has(i)||(this.testedFeatures.add(i),Q$(i)&&e9(this.gl,i,this.extensions)&&this.features.add(i),this.getWebGLFeature(i)&&this.features.add(i)),this.features.has(i))}initializeFeatures(){const i=this.getFeatures().filter(s=>s!=="polygon-mode-webgl");for(const s of i)this.has(s)}getFeatures(){return[...Object.keys(NI),...Object.keys(K1)]}getWebGLFeature(i){const s=NI[i];return typeof s=="string"?!!pc(this.gl,s,this.extensions):!!s}}class l9 extends zU{constructor(i){super();K(this,"gl");K(this,"limits",{});this.gl=i}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(i){return this.limits[i]===void 0&&(this.limits[i]=this.gl.getParameter(i)),this.limits[i]}}function nc(t,e,i){if(c9(e))return i(t);const{nocatch:s=!0}=e;A0(t),Gf(t,e);let n;if(s)n=i(t),bg(t);else try{n=i(t)}finally{bg(t)}return n}function c9(t){for(const e in t)return!1;return!0}function u9(t,e,i,s){if(gy(e))return s(t);const n=t;A0(n.gl);try{return h9(t,e),Gf(n.gl,i),s(t)}finally{bg(n.gl)}}function h9(t,e){const i=t,{gl:s}=i;if(e.cullMode)switch(e.cullMode){case"none":s.disable(2884);break;case"front":s.enable(2884),s.cullFace(1028);break;case"back":s.enable(2884),s.cullFace(1029);break}if(e.frontFace&&s.frontFace(Pu("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&s.enable(34383),e.depthBias!==void 0&&(s.enable(32823),s.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const a=i.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,u=Pu("provokingVertex",e.provokingVertex,{first:36429,last:36430});a==null||a.provokingVertexWEBGL(u)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const a=i.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,u=Pu("polygonMode",e.polygonMode,{fill:6914,line:6913});a==null||a.polygonModeWEBGL(1028,u),a==null||a.polygonModeWEBGL(1029,u)}e.polygonOffsetLine&&s.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&s.enable(12288),e.clipDistance1&&s.enable(12289),e.clipDistance2&&s.enable(12290),e.clipDistance3&&s.enable(12291),e.clipDistance4&&s.enable(12292),e.clipDistance5&&s.enable(12293),e.clipDistance6&&s.enable(12294),e.clipDistance7&&s.enable(12295)),e.depthWriteEnabled!==void 0&&s.depthMask(d9("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?s.enable(2929):s.disable(2929),s.depthFunc(Bw("depthCompare",e.depthCompare))),e.stencilWriteMask){const n=e.stencilWriteMask;s.stencilMaskSeparate(1028,n),s.stencilMaskSeparate(1029,n)}if(e.stencilReadMask&&at.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const n=e.stencilReadMask||4294967295,a=Bw("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?s.enable(2960):s.disable(2960),s.stencilFuncSeparate(1028,a,0,n),s.stencilFuncSeparate(1029,a,0,n)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const n=Sx("stencilPassOperation",e.stencilPassOperation),a=Sx("stencilFailOperation",e.stencilFailOperation),u=Sx("stencilDepthFailOperation",e.stencilDepthFailOperation);s.stencilOpSeparate(1028,a,u,n),s.stencilOpSeparate(1029,a,u,n)}if(e.blendColorOperation||e.blendAlphaOperation){s.enable(3042);const n=BI("blendColorOperation",e.blendColorOperation||"add"),a=BI("blendAlphaOperation",e.blendAlphaOperation||"add");s.blendEquationSeparate(n,a);const u=A_("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=A_("blendColorDstFactor",e.blendColorDstFactor||"zero"),_=A_("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),w=A_("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");s.blendFuncSeparate(u,c,_,w)}}function Bw(t,e){return Pu(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function Sx(t,e){return Pu(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function BI(t,e){return Pu(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function A_(t,e){return Pu(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function f9(t,e){return`Illegal parameter ${e} for ${t}`}function Pu(t,e,i){if(!(e in i))throw new Error(f9(t,e));return i[e]}function d9(t,e){return e}function ak(t){const e={};return t.addressModeU&&(e[10242]=Ex(t.addressModeU)),t.addressModeV&&(e[10243]=Ex(t.addressModeV)),t.addressModeW&&(e[32882]=Ex(t.addressModeW)),t.magFilter&&(e[10240]=lk(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=p9(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=Bw("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function Ex(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function lk(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function p9(t,e){if(!e)return lk(t);switch(t){case"nearest":return e==="nearest"?9984:9986;case"linear":return e==="nearest"?9985:9987}}class oc extends Os{constructor(i,s={}){super(i,s);K(this,"device");K(this,"gl");K(this,"handle");K(this,"glTarget");K(this,"glUsage");K(this,"glIndexType",5123);K(this,"byteLength");K(this,"bytesUsed");this.device=i,this.gl=this.device.gl;const n=typeof s=="object"?s.handle:void 0;this.handle=n||this.gl.createBuffer(),i.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=g9(this.props.usage),this.glUsage=m9(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,s.data?this._initWithData(s.data,s.byteOffset,s.byteLength):this._initWithByteLength(s.byteLength||0)}_initWithData(i,s=0,n=i.byteLength+s){const a=this.glTarget;this.gl.bindBuffer(a,this.handle),this.gl.bufferData(a,n,this.glUsage),this.gl.bufferSubData(a,s,i),this.gl.bindBuffer(a,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(i,s,n),this.trackAllocatedMemory(n)}_initWithByteLength(i){is(i>=0);let s=i;i===0&&(s=new Float32Array(0));const n=this.glTarget;return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,s,this.glUsage),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(null,0,i),this.trackAllocatedMemory(i),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(i,s=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,s,i),this.gl.bindBuffer(36663,null),this._setDebugData(i,s,i.byteLength)}async readAsync(i=0,s){return this.readSyncWebGL(i,s)}readSyncWebGL(i=0,s){s=s??this.byteLength-i;const n=new Uint8Array(s),a=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,n,a,s),this.gl.bindBuffer(36662,null),this._setDebugData(n,i,s),n}}function g9(t){return t&Os.INDEX?34963:t&Os.VERTEX?34962:t&Os.UNIFORM?35345:34962}function m9(t){return t&Os.INDEX||t&Os.VERTEX?35044:t&Os.UNIFORM?35048:35044}class Lw extends yy{constructor(i,s){super(i,s);K(this,"device");K(this,"handle");K(this,"parameters");this.device=i,this.parameters=ak(s),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(i){for(const[s,n]of Object.entries(i)){const a=Number(s);switch(a){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,a,n);break;default:this.device.gl.samplerParameteri(this.handle,a,n);break}}}}class ff extends my{constructor(i,s){super(i,{...po.defaultProps,...s});K(this,"device");K(this,"gl");K(this,"handle");K(this,"texture");this.device=i,this.gl=this.device.gl,this.handle=null,this.texture=s.texture}}const _9={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},sg=class sg extends po{constructor(i,s){var n;super(i,{..._9,format:"rgba8unorm",...s});K(this,"MAX_ATTRIBUTES");K(this,"device");K(this,"gl");K(this,"handle");K(this,"sampler");K(this,"view");K(this,"glFormat");K(this,"type");K(this,"dataFormat");K(this,"mipmaps");K(this,"target");K(this,"textureUnit");K(this,"loaded",!1);K(this,"_video");this.device=i,this.gl=this.device.gl,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=y9(this.props),this.loaded=!1,typeof((n=this.props)==null?void 0:n.data)=="string"&&Object.assign(this.props,{data:I5(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}createView(i){return new ff(this.device,{...i,texture:this})}initialize(i={}){if(this.props.dimension==="cube")return this.initializeCube(i);let s=i.data;if(s instanceof Promise)return s.then(ee=>this.initialize(Object.assign({},i,{pixels:ee,data:ee}))),this;const n=typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement;if(n&&s.readyStatethis.initialize(i)),this;const{parameters:a={}}=i,{pixels:u=null,pixelStore:c={},textureUnit:_=void 0,mipmaps:w=!0}=i;s||(s=u);let{width:S,height:A,dataFormat:P,type:D,compressed:U=!1}=i;const{depth:L=0}=i,W=ok(i.format);return{width:S,height:A,compressed:U,dataFormat:P,type:D}=this._deduceParameters({format:i.format,type:D,dataFormat:P,compressed:U,data:s,width:S,height:A}),this.width=S,this.height=A,this.glFormat=W,this.type=D,this.dataFormat=P,this.textureUnit=_,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),this.mipmaps=w,this.setImageData({data:s,width:S,height:A,depth:L,format:i.format,type:D,dataFormat:P,parameters:c,compressed:U}),this.setSampler(i.sampler),this._setSamplerParameters(a),this.view=this.createView({...this.props,mipLevelCount:1,arrayLayerCount:1}),w&&this.device.isTextureFormatFilterable(i.format)&&this.generateMipmap(),n&&(this._video={video:s,parameters:a,lastTime:s.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?s.currentTime:-1}),this}initializeCube(i){const{mipmaps:s=!0,parameters:n={}}=i;return this.setCubeMapImageData(i).then(()=>{this.loaded=!0,s&&this.generateMipmap(i),this.setSampler(i.sampler),this._setSamplerParameters(n)}),this}setSampler(i={}){let s;i instanceof Lw?(this.sampler=i,s=i.props):(this.sampler=new Lw(this.device,i),s=i);const n=ak(s);return this._setSamplerParameters(n),this}resize(i){const{height:s,width:n,mipmaps:a=!1}=i;return n!==this.width||s!==this.height?this.initialize({width:n,height:s,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:a}):this}update(){if(this._video){const{video:i,parameters:s,lastTime:n}=this._video;if(n===i.currentTime||i.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this}setImageData(i){if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(i);this.trackDeallocatedMemory("Texture");const{target:s=this.target,pixels:n=null,level:a=0,glFormat:u=this.glFormat,offset:c=0,parameters:_={}}=i;let{data:w=null,type:S=this.type,width:A=this.width,height:P=this.height,dataFormat:D=this.dataFormat,compressed:U=!1}=i;w||(w=n),{type:S,dataFormat:D,compressed:U,width:A,height:P}=this._deduceParameters({format:this.props.format,type:S,dataFormat:D,compressed:U,data:w,width:A,height:P});const{gl:L}=this;L.bindTexture(this.target,this.handle);let W=null;if({data:w,dataType:W}=this._getDataType({data:w,compressed:U}),nc(this.gl,_,()=>{switch(W){case"null":L.texImage2D(s,a,u,A,P,0,D,S,w);break;case"typed-array":L.texImage2D(s,a,u,A,P,0,D,S,w,c);break;case"buffer":this.device.gl.bindBuffer(35052,w.handle||w),this.device.gl.texImage2D(s,a,u,A,P,0,D,S,c),this.device.gl.bindBuffer(35052,null);break;case"browser-object":L.texImage2D(s,a,u,A,P,0,D,S,w);break;case"compressed":for(const[ee,G]of w.entries())L.compressedTexImage2D(s,ee,G.format,G.width,G.height,0,G.data);break;default:is(!1,"Unknown image data type")}}),w&&w.byteLength)this.trackAllocatedMemory(w.byteLength,"Texture");else{const ee=FI(this.props.format);this.trackAllocatedMemory(this.width*this.height*ee,"Texture")}return this.loaded=!0,this}setSubImageData({target:i=this.target,pixels:s=null,data:n=null,x:a=0,y:u=0,width:c=this.width,height:_=this.height,level:w=0,glFormat:S=this.glFormat,type:A=this.type,dataFormat:P=this.dataFormat,compressed:D=!1,offset:U=0,parameters:L={}}){if({type:A,dataFormat:P,compressed:D,width:c,height:_}=this._deduceParameters({format:this.props.format,type:A,dataFormat:P,compressed:D,data:n,width:c,height:_}),is(this.depth===1,"texSubImage not supported for 3D textures"),n||(n=s),n&&n.data){const W=n;n=W.data,c=W.shape[0],_=W.shape[1]}n instanceof oc&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,L,()=>{D?this.gl.compressedTexSubImage2D(i,w,a,u,c,_,S,n):n===null?this.gl.texSubImage2D(i,w,a,u,c,_,P,A,null):ArrayBuffer.isView(n)?this.gl.texSubImage2D(i,w,a,u,c,_,P,A,n,U):typeof WebGLBuffer<"u"&&n instanceof WebGLBuffer?(this.device.gl.bindBuffer(35052,n),this.device.gl.texSubImage2D(i,w,a,u,c,_,P,A,U),this.device.gl.bindBuffer(35052,null)):this.device.gl.texSubImage2D(i,w,a,u,c,_,P,A,n)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(i={}){return at.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(i=this.textureUnit){const{gl:s}=this;return i!==void 0&&(this.textureUnit=i,s.activeTexture(33984+i)),s.bindTexture(this.target,this.handle),i}unbind(i=this.textureUnit){const{gl:s}=this;return i!==void 0&&(this.textureUnit=i,s.activeTexture(33984+i)),s.bindTexture(this.target,null),i}_getDataType({data:i,compressed:s=!1}){return s?{data:i,dataType:"compressed"}:i===null?{data:i,dataType:"null"}:ArrayBuffer.isView(i)?{data:i,dataType:"typed-array"}:i instanceof oc?{data:i.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&i instanceof WebGLBuffer?{data:i,dataType:"buffer"}:{data:i,dataType:"browser-object"}}_deduceParameters(i){const{format:s,data:n}=i;let{width:a,height:u,dataFormat:c,type:_,compressed:w}=i;const S=Py(s);return c=c||S.dataFormat,_=_||S.type,w=w||S.compressed,{width:a,height:u}=this._deduceImageSize(n,a,u),{dataFormat:c,type:_,compressed:w,width:a,height:u,format:s,data:n}}_deduceImageSize(i,s,n){let a;return typeof ImageData<"u"&&i instanceof ImageData?a={width:i.width,height:i.height}:typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement?a={width:i.naturalWidth,height:i.naturalHeight}:typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement?a={width:i.width,height:i.height}:typeof ImageBitmap<"u"&&i instanceof ImageBitmap?a={width:i.width,height:i.height}:typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?a={width:i.videoWidth,height:i.videoHeight}:i?a={width:s,height:n}:a={width:s>=0?s:1,height:n>=0?n:1},is(a,"Could not deduced texture size"),is(s===void 0||a.width===s,"Deduced texture width does not match supplied width"),is(n===void 0||a.height===n,"Deduced texture height does not match supplied height"),a}async setCubeMapImageData(i){const{gl:s}=this,{width:n,height:a,pixels:u,data:c,format:_=6408,type:w=5121}=i,S=u||c,A=await Promise.all(sg.FACES.map(P=>{const D=S[P];return Promise.all(Array.isArray(D)?D:[D])}));this.bind(),sg.FACES.forEach((P,D)=>{A[D].length>1&&this.props.mipmaps!==!1&&at.warn(`${this.id} has mipmap and multiple LODs.`)(),A[D].forEach((U,L)=>{n&&a?s.texImage2D(P,L,_,n,a,0,_,w,U):s.texImage2D(P,L,_,_,w,U)})}),this.unbind()}setImageDataForFace(i){const{face:s,width:n,height:a,pixels:u,data:c,format:_=6408,type:w=5121}=i,{gl:S}=this,A=u||c;return this.bind(),A instanceof Promise?A.then(P=>this.setImageDataForFace(Object.assign({},i,{face:s,data:P,pixels:P}))):this.width||this.height?S.texImage2D(s,0,_,n,a,0,_,w,A):S.texImage2D(s,0,_,_,w,A),this}setImageData3D(i){const{level:s=0,dataFormat:n,format:a,type:u,width:c,height:_,depth:w=1,offset:S=0,data:A,parameters:P={}}=i;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);const D=Py(a);if(nc(this.gl,P,()=>{ArrayBuffer.isView(A)&&this.gl.texImage3D(this.target,s,D.format,c,_,w,0,D.dataFormat,D.type,A),A instanceof oc&&(this.gl.bindBuffer(35052,A.handle),this.gl.texImage3D(this.target,s,n,c,_,w,0,a,u,S))}),A&&A.byteLength)this.trackAllocatedMemory(A.byteLength,"Texture");else{const U=FI(this.props.format);this.trackAllocatedMemory(this.width*this.height*this.depth*U,"Texture")}return this.loaded=!0,this}_setSamplerParameters(i){if(!gy(i)){b9(i),this.gl.bindTexture(this.target,this.handle);for(const[s,n]of Object.entries(i)){const a=Number(s),u=n;switch(a){case 33082:case 33083:this.gl.texParameterf(this.target,a,u);break;default:this.gl.texParameteri(this.target,a,u);break}}this.gl.bindTexture(this.target,null)}}};K(sg,"FACES",[34069,34070,34071,34072,34073,34074]);let ua=sg;function y9(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(t.dimension)}}function b9(t){at.log(1,"texture sampler parameters",t)()}class Kp extends by{constructor(i,s){super(i,s);K(this,"device");K(this,"gl");K(this,"handle");const n=s.handle===null;if(this.device=i,this.gl=i.gl,this.handle=this.props.handle||n?this.props.handle:this.gl.createFramebuffer(),!n){i.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures();const a=this.gl.bindFramebuffer(36160,this.handle);for(let u=0;uat.info("Spector capture started:",e)()),Wi==null||Wi.onCapture.add(e=>{at.info("Spector capture complete:",e)(),Wi==null||Wi.getResultUI(),Wi==null||Wi.resultView.display(),Wi==null||Wi.resultView.addCapture(e)})),t!=null&&t.canvas){if(typeof t.spector=="string"&&t.spector!==t.canvas.id)return Wi;Wi==null||Wi.startCapture(t==null?void 0:t.canvas,500),new Promise(e=>setTimeout(e,2e3)).then(e=>{at.info("Spector capture stopped after 2 seconds")(),Wi==null||Wi.stopCapture()})}return Wi}const C9="https://unpkg.com/webgl-debug@2.0.1/index.js";function ck(t){return t.luma=t.luma||{},t.luma}async function P9(){Tc()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await TR(C9))}function M9(t,e={}){return t?e.debug?k9(t,e):R9(t):null}function R9(t){const e=ck(t);return e.realContext?e.realContext:t}function k9(t,e){if(!globalThis.WebGLDebugUtils)return at.warn("webgl-debug not loaded")(),t;const i=ck(t);if(i.debugContext)return i.debugContext;globalThis.WebGLDebugUtils.init({...cf,...t});const s=globalThis.WebGLDebugUtils.makeDebugContext(t,O9.bind(null,e),D9.bind(null,e));for(const u in cf)!(u in s)&&typeof cf[u]=="number"&&(s[u]=cf[u]);class n{}Object.setPrototypeOf(s,Object.getPrototypeOf(t)),Object.setPrototypeOf(n,s);const a=Object.create(n);return i.realContext=t,i.debugContext=a,a.debug=!0,a}function Ax(t,e){e=Array.from(e).map(s=>s===void 0?"undefined":s);let i=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return i=`${i.slice(0,100)}${i.length>100?"...":""}`,`gl.${t}(${i})`}function O9(t,e,i,s){s=Array.from(s).map(c=>c===void 0?"undefined":c);const n=globalThis.WebGLDebugUtils.glEnumToString(e),a=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,s),u=`${n} in gl.${i}(${a})`;at.error(u)();debugger;if(t.throwOnError)throw new Error(u)}function D9(t,e,i){let s="";if(at.level>=1&&(s=Ax(e,i),at.log(1,s)()),t.break&&t.break.length>0&&(s=s||Ax(e,i),t.break.every(a=>s.indexOf(a)!==-1)))debugger;for(const n of i)if(n===void 0){if(s=s||Ax(e,i),t.throwOnError)throw new Error(`Undefined argument: ${s}`);at.error(`Undefined argument: ${s}`)();debugger}}function F9(t){const e=t.split(/\r?\n/),i=[];for(const s of e){if(s.length<=1)continue;const n=s.split(":");if(n.length===2){const[A,P]=n;i.push({message:P.trim(),type:zI(A),lineNum:0,linePos:0});continue}const[a,u,c,..._]=n;let w=parseInt(c,10);isNaN(w)&&(w=0);let S=parseInt(u,10);isNaN(S)&&(S=0),i.push({message:_.join(":").trim(),type:zI(a),lineNum:w,linePos:S})}return i}function zI(t){const e=["warning","error","info"],i=t.toLowerCase();return e.includes(i)?i:"info"}class N9 extends _y{constructor(i,s){super(i,s);K(this,"device");K(this,"handle");switch(this.device=i,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const i=this.device.gl.getShaderInfoLog(this.handle);return F9(i)}getTranslatedSource(){const s=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return s==null?void 0:s.getTranslatedShaderSource(this.handle)}async _compile(i){i=(a=>a.startsWith("#version ")?a:`#version 100 +${a}`)(i);const{gl:n}=this.device;if(n.shaderSource(this.handle,i),n.compileShader(this.handle),at.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}at.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),at.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const i=async a=>await new Promise(u=>setTimeout(u,a));if(!this.device.features.has("compilation-status-async-webgl")){await i(10);return}const{gl:n}=this.device;for(;;){if(n.getShaderParameter(this.handle,37297))return;await i(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}const B9=256,L9=1024,z9=16384,Ix=6144,U9=[1,2,4,8];class V9 extends yw{constructor(i,s){super(i,s);K(this,"device");K(this,"glParameters");this.device=i,A0(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){bg(this.device.gl)}pushDebugGroup(i){}popDebugGroup(){}insertDebugMarker(i){}setParameters(i={}){const s={...this.glParameters};this.props.framebuffer&&(s.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(s.depthMask=!this.props.depthReadOnly),s.stencilMask=this.props.stencilReadOnly?0:1,s[35977]=this.props.discard,i.viewport&&(i.viewport.length>=6?(s.viewport=i.viewport.slice(0,4),s.depthRange=[i.viewport[4],i.viewport[5]]):s.viewport=i.viewport),i.scissorRect&&(s.scissorTest=!0,s.scissor=i.scissorRect),i.blendConstant&&(s.blendColor=i.blendConstant),i.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),i[2967]=i.stencilReference),i.colorMask&&(s.colorMask=U9.map(n=>!!(n&i.colorMask))),this.glParameters=s,Gf(this.device.gl,s)}beginOcclusionQuery(i){const s=this.props.occlusionQuerySet;s==null||s.beginOcclusionQuery()}endOcclusionQuery(){const i=this.props.occlusionQuerySet;i==null||i.endOcclusionQuery()}clear(){const i={...this.glParameters};let s=0;this.props.clearColor!==!1&&(s|=z9,i.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(s|=B9,i.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(s|=L9,i.clearStencil=this.props.clearStencil),s!==0&&nc(this.device.gl,i,()=>{this.device.gl.clear(s)})}clearColorBuffer(i=0,s=[0,0,0,0]){nc(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(s.constructor){case Int32Array:this.device.gl.clearBufferiv(Ix,i,s);break;case Uint32Array:this.device.gl.clearBufferuiv(Ix,i,s);break;case Float32Array:default:this.device.gl.clearBufferfv(Ix,i,s);break}})}}const j9="Failed to deduce GL constant from typed array";function $9(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(j9)}}function zw(t,e){const{clamped:i=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return i?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}const H9={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},W9={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class Jp{constructor(...e){K(this,"offset");K(this,"stride");K(this,"type");K(this,"size");K(this,"divisor");K(this,"normalized");K(this,"integer");K(this,"buffer");K(this,"index");e.forEach(i=>this._assign(i)),Object.freeze(this)}static getBytesPerElement(e){return zw(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return is(e.size),zw(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Jp(H9,...e)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Jp.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Jp.getBytesPerVertex(this)}_assign(e={}){return e=E5("Accessor",e,W9),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}}function q9(t){return X9.includes(t)}const X9=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],uk={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2","float32x2"],35665:[5126,3,"vec3","vec3","float32x3"],35666:[5126,4,"vec4","vec4","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2","sint32x2"],35668:[5124,3,"ivec3","vec3","sint32x3"],35669:[5124,4,"ivec4","vec4","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2","uint32x2"],36295:[5125,3,"uvec3","vec3","uint32x3"],36296:[5125,4,"uvec4","vec4","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2","float32x2"],35672:[5126,3,"bvec3","vec3","float32x3"],35673:[5126,4,"bvec4","vec4","float32x4"],35674:[5126,8,"mat2","mat2x2"],35685:[5126,8,"mat2x3","mat2x3"],35686:[5126,8,"mat2x4","mat2x4"],35687:[5126,12,"mat3x2","mat3x2"],35675:[5126,12,"mat3","mat3x3"],35688:[5126,12,"mat3x4","mat3x4"],35689:[5126,16,"mat4x2","mat4x2"],35690:[5126,16,"mat4x3","mat4x3"],35676:[5126,16,"mat4","mat4x4"]};function hk(t){const e=uk[t];if(!e)throw new Error("uniform");const[i,s,,n]=e;return{format:n,components:s,glType:i}}function Z9(t){const e=uk[t];if(!e)throw new Error("attribute");const[,i,,s,n]=e;return{attributeType:s,vertexFormat:n,components:i}}function Y9(t,e){const i={attributes:[],bindings:[]};i.attributes=K9(t,e);const s=Q9(t,e);for(const c of s){const _=c.uniforms.map(w=>({name:w.name,format:w.format,byteOffset:w.byteOffset,byteStride:w.byteStride,arrayLength:w.arrayLength}));i.bindings.push({type:"uniform",name:c.name,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:_})}const n=G9(t,e);let a=0;for(const c of n)if(q9(c.type)){const{viewDimension:_,sampleType:w}=tH(c.type);i.bindings.push({type:"texture",name:c.name,location:a,viewDimension:_,sampleType:w}),c.textureUnit=a,a+=1}n.length&&(i.uniforms=n);const u=J9(t,e);return u!=null&&u.length&&(i.varyings=u),i}function K9(t,e){const i=[],s=t.getProgramParameter(e,35721);for(let n=0;n=0){const{attributeType:w}=Z9(c),S=/instance/i.test(u)?"instance":"vertex";i.push({name:u,location:_,stepMode:S,type:w})}}return i.sort((n,a)=>n.location-a.location),i}function J9(t,e){const i=[],s=t.getProgramParameter(e,35971);for(let n=0;nn.location-a.location),i}function G9(t,e){const i=[],s=t.getProgramParameter(e,35718);for(let n=0;n1)for(let D=0;Dt.getActiveUniformBlockParameter(e,a,u),s=[],n=t.getProgramParameter(e,35382);for(let a=0;aa.location-u.location),s}const eH={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function tH(t){const e=eH[t];if(!e)throw new Error("sampler");const[i,s]=e;return{viewDimension:i,sampleType:s}}function iH(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const i=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!i||i.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:i[1],length:i[2]?1:0,isArray:!!i[2]}}function sH(t,e,i,s){const n=t;let a=s;a===!0&&(a=1),a===!1&&(a=0);const u=typeof a=="number"?[a]:a;switch(i){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof s!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,s);case 5126:return t.uniform1fv(e,u);case 35664:return t.uniform2fv(e,u);case 35665:return t.uniform3fv(e,u);case 35666:return t.uniform4fv(e,u);case 5124:return t.uniform1iv(e,u);case 35667:return t.uniform2iv(e,u);case 35668:return t.uniform3iv(e,u);case 35669:return t.uniform4iv(e,u);case 35670:return t.uniform1iv(e,u);case 35671:return t.uniform2iv(e,u);case 35672:return t.uniform3iv(e,u);case 35673:return t.uniform4iv(e,u);case 5125:return n.uniform1uiv(e,u,1);case 36294:return n.uniform2uiv(e,u,2);case 36295:return n.uniform3uiv(e,u,3);case 36296:return n.uniform4uiv(e,u,4);case 35674:return t.uniformMatrix2fv(e,!1,u);case 35675:return t.uniformMatrix3fv(e,!1,u);case 35676:return t.uniformMatrix4fv(e,!1,u);case 35685:return n.uniformMatrix2x3fv(e,!1,u);case 35686:return n.uniformMatrix2x4fv(e,!1,u);case 35687:return n.uniformMatrix3x2fv(e,!1,u);case 35688:return n.uniformMatrix3x4fv(e,!1,u);case 35689:return n.uniformMatrix4x2fv(e,!1,u);case 35690:return n.uniformMatrix4x3fv(e,!1,u)}throw new Error("Illegal uniform")}function nH(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function rH(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}const UI=4;class oH extends Bf{constructor(i,s){super(i,s);K(this,"device");K(this,"handle");K(this,"vs");K(this,"fs");K(this,"introspectedLayout");K(this,"uniforms",{});K(this,"bindings",{});K(this,"varyings",null);K(this,"_uniformCount",0);K(this,"_uniformSetters",{});this.device=i,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=s.vs,this.fs=s.fs;const{varyings:n,bufferMode:a=35981}=s;switch(n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,a)),this._linkShaders(),at.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Y9(this.device.gl,this.handle),at.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=f5(this.introspectedLayout,s.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":at.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(i,s){for(const[n,a]of Object.entries(i)){const u=this.shaderLayout.bindings.find(c=>c.name===n)||this.shaderLayout.bindings.find(c=>c.name===`${n}Uniforms`);if(!u){const c=this.shaderLayout.bindings.map(_=>`"${_.name}"`).join(", ");s!=null&&s.disableWarnings||at.warn(`Unknown binding "${n}" in render pipeline "${this.id}", expected one of ${c}`)();continue}switch(a||at.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),u.type){case"uniform":if(!(a instanceof oc)&&!(a.buffer instanceof oc))throw new Error("buffer value");break;case"texture":if(!(a instanceof ff||a instanceof ua||a instanceof Kp))throw new Error("texture value");break;case"sampler":at.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(u.type)}this.bindings[n]=a}}draw(i){var W;const{renderPass:s,parameters:n=this.props.parameters,topology:a=this.props.topology,vertexArray:u,vertexCount:c,instanceCount:_,isInstanced:w=!1,firstVertex:S=0,transformFeedback:A}=i,P=nH(a),D=!!u.indexBuffer,U=(W=u.indexBuffer)==null?void 0:W.glIndexType;if(this.linkStatus!=="success")return at.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||c===0)return at.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(c===0)return at.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),u.bindBeforeRender(s),A&&A.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const L=s;return u9(this.device,n,L.glParameters,()=>{D&&w?this.device.gl.drawElementsInstanced(P,c||0,U,S,_||0):D?this.device.gl.drawElements(P,c||0,U,S):w?this.device.gl.drawArraysInstanced(P,S,c||0,_||0):this.device.gl.drawArrays(P,S,c||0),A&&A.end()}),u.unbindAfterRender(s),!0}setUniformsWebGL(i){const{bindings:s}=j1(i);Object.keys(s).forEach(n=>{at.warn(`Unsupported value "${JSON.stringify(s[n])}" used in setUniforms() for key ${n}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,i)}async _linkShaders(){const{gl:i}=this.device;if(i.attachShader(this.handle,this.vs.handle),i.attachShader(this.handle,this.fs.handle),at.time(UI,`linkProgram for ${this.id}`)(),i.linkProgram(this.handle),at.timeEnd(UI,`linkProgram for ${this.id}`)(),at.level,!this.device.features.has("compilation-status-async-webgl")){const n=this._getLinkStatus();this._reportLinkStatus(n);return}at.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),at.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const s=this._getLinkStatus();this._reportLinkStatus(s)}_reportLinkStatus(i){var s;switch(i){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):((s=this.fs)==null?void 0:s.compilationStatus)==="error"?(this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${i}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){const{gl:i}=this.device;return i.getProgramParameter(this.handle,35714)?(i.validateProgram(this.handle),i.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const i=async a=>await new Promise(u=>setTimeout(u,a));if(!this.device.features.has("compilation-status-async-webgl")){await i(10);return}const{gl:n}=this.device;for(;;){if(n.getProgramParameter(this.handle,37297))return;await i(10)}}_areTexturesRenderable(){let i=!0;for(const[,s]of Object.entries(this.bindings))s instanceof ua&&(s.update(),i=i&&s.loaded);return i}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:i}=this.device;i.useProgram(this.handle);let s=0,n=0;for(const a of this.shaderLayout.bindings){const u=this.bindings[a.name]||this.bindings[a.name.replace(/Uniforms$/,"")];if(!u)throw new Error(`No value for binding ${a.name} in ${this.id}`);switch(a.type){case"uniform":const{name:c}=a,_=i.getUniformBlockIndex(this.handle,c);if(_===4294967295)throw new Error(`Invalid uniform block name ${c}`);i.uniformBlockBinding(this.handle,n,_),u instanceof oc?i.bindBufferBase(35345,n,u.handle):i.bindBufferRange(35345,n,u.buffer.handle,u.offset||0,u.size||u.buffer.byteLength-u.offset),n+=1;break;case"texture":if(!(u instanceof ff||u instanceof ua||u instanceof Kp))throw new Error("texture");let w;if(u instanceof ff)w=u.texture;else if(u instanceof ua)w=u;else if(u instanceof Kp&&u.colorAttachments[0]instanceof ff)at.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),w=u.colorAttachments[0].texture;else throw new Error("No texture");i.activeTexture(33984+s),i.bindTexture(w.target,w.handle),s+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${a.type}' not supported in WebGL`)}}}_applyUniforms(){for(const i of this.shaderLayout.uniforms||[]){const{name:s,location:n,type:a,textureUnit:u}=i,c=this.uniforms[s]??u;c!==void 0&&sH(this.device.gl,n,a,c)}}}class aH extends vw{constructor(i){super(i,{});K(this,"device");K(this,"commands",[]);this.device=i}submitCommands(i=this.commands){for(const s of i)switch(s.name){case"copy-buffer-to-buffer":lH(this.device,s.options);break;case"copy-buffer-to-texture":cH(this.device,s.options);break;case"copy-texture-to-buffer":uH(this.device,s.options);break;case"copy-texture-to-texture":hH(this.device,s.options);break}}}function lH(t,e){const i=e.source,s=e.destination;t.gl.bindBuffer(36662,i.handle),t.gl.bindBuffer(36663,s.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function cH(t,e){throw new Error("Not implemented")}function uH(t,e){const{source:i,mipLevel:s=0,aspect:n="all",width:a=e.source.width,height:u=e.source.height,depthOrArrayLayers:c=0,origin:_=[0,0],destination:w,byteOffset:S=0,bytesPerRow:A,rowsPerImage:P}=e;if(n!=="all")throw new Error("not supported");if(s!==0||c!==0||A||P)throw new Error("not implemented");const{framebuffer:D,destroyFramebuffer:U}=fk(i);let L;try{const W=w,ee=a||D.width,G=u||D.height,se=Py(D.texture.props.format),fe=se.dataFormat,Se=se.type;t.gl.bindBuffer(35051,W.handle),L=t.gl.bindFramebuffer(36160,D.handle),t.gl.readPixels(_[0],_[1],ee,G,fe,Se,S)}finally{t.gl.bindBuffer(35051,null),L!==void 0&&t.gl.bindFramebuffer(36160,L),U&&D.destroy()}}function hH(t,e){const{source:i,destinationMipLevel:s=0,origin:n=[0,0],destinationOrigin:a=[0,0],destination:u}=e;let{width:c=e.destination.width,height:_=e.destination.height}=e;const{framebuffer:w,destroyFramebuffer:S}=fk(i),[A,P]=n,[D,U,L]=a,W=t.gl.bindFramebuffer(36160,w.handle);let ee=null,G;if(u instanceof ua)ee=u,c=Number.isFinite(c)?c:ee.width,_=Number.isFinite(_)?_:ee.height,ee.bind(0),G=ee.target;else throw new Error("invalid destination");switch(G){case 3553:case 34067:t.gl.copyTexSubImage2D(G,s,D,U,A,P,c,_);break;case 35866:case 32879:t.gl.copyTexSubImage3D(G,s,D,U,L,A,P,c,_);break}ee&&ee.unbind(),t.gl.bindFramebuffer(36160,W),S&&w.destroy()}function fk(t){if(t instanceof po){const{width:e,height:i,id:s}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${s}`,width:e,height:i,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class fH extends bw{constructor(i,s){super(i,s);K(this,"device");K(this,"commandBuffer");this.device=i,this.commandBuffer=new aH(i)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(i){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:i})}copyBufferToTexture(i){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:i})}copyTextureToBuffer(i){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:i})}copyTextureToTexture(i){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:i})}pushDebugGroup(i){}popDebugGroup(){}insertDebugMarker(i){}resolveQuerySet(i,s,n){}}class G1 extends xw{constructor(i,s){super(i,s);K(this,"device");K(this,"handle");K(this,"buffer",null);K(this,"bufferValue",null);this.device=i,this.handle=this.device.gl.createVertexArray()}get[Symbol.toStringTag](){return"VertexArray"}static isConstantAttributeZeroSupported(i){return Rz()==="Chrome"}destroy(){var i;super.destroy(),this.buffer&&((i=this.buffer)==null||i.destroy()),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(i){const s=i;if(s&&s.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,s?s.handle:null),this.indexBuffer=s,this.device.gl.bindVertexArray(null)}setBuffer(i,s){const n=s;if(n.glTarget===34963)throw new Error("Use .setIndexBuffer()");const{size:a,type:u,stride:c,offset:_,normalized:w,integer:S,divisor:A}=this._getAccessor(i);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),S?this.device.gl.vertexAttribIPointer(i,a,u,c,_):this.device.gl.vertexAttribPointer(i,a,u,w,c,_),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(i),this.device.gl.vertexAttribDivisor(i,A||0),this.attributes[i]=n,this.device.gl.bindVertexArray(null)}setConstantWebGL(i,s){this._enable(i,!1),this.attributes[i]=s}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let i=0;i{for(const s in i)this.setBuffer(s,i[s])})}setBuffer(i,s){const n=this._getVaryingIndex(i),{buffer:a,byteLength:u,byteOffset:c}=this._getBufferRange(s);if(n<0){this.unusedBuffers[i]=a,at.warn(`${this.id} unusedBuffers varying buffer ${i}`)();return}this.buffers[n]={buffer:a,byteLength:u,byteOffset:c},this.bindOnUse||this._bindBuffer(n,a,c,u)}getBuffer(i){if(VI(i))return this.buffers[i]||null;const s=this._getVaryingIndex(i);return s>=0?this.buffers[s]:null}bind(i=this.handle){if(typeof i!="function")return this.gl.bindTransformFeedback(36386,i),this;let s;return this._bound?s=i():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,s=i(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),s}unbind(){this.bind(null)}_getBufferRange(i){if(i instanceof oc)return{buffer:i,byteOffset:0,byteLength:i.byteLength};const{buffer:s,byteOffset:n=0,byteLength:a=i.buffer.byteLength}=i;return{buffer:s,byteOffset:n,byteLength:a}}_getVaryingIndex(i){if(VI(i))return Number(i);for(const s of this.layout.varyings)if(i===s.name)return s.location;return-1}_bindBuffers(){for(const i in this.buffers){const{buffer:s,byteLength:n,byteOffset:a}=this._getBufferRange(this.buffers[i]);this._bindBuffer(Number(i),s,a,n)}}_unbindBuffers(){for(const i in this.buffers)this.gl.bindBufferBase(35982,Number(i),null)}_bindBuffer(i,s,n=0,a){const u=s&&s.handle;!u||a===void 0?this.gl.bindBufferBase(35982,i,u):this.gl.bindBufferRange(35982,i,u,n,a)}}function VI(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class mH extends Tw{constructor(i,s){super(i,s);K(this,"device");K(this,"handle");K(this,"target",null);K(this,"_queryPending",!1);K(this,"_pollingPromise",null);if(this.device=i,s.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(i){return this._begin(i!=null&&i.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(i){this._queryPending||(this.target=i,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const i=this.device.gl.getQueryParameter(this.handle,34919);return i&&(this._queryPending=!1),i}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(i=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let s=0;return this._pollingPromise=new Promise((n,a)=>{const u=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):s++>i?(a("Timed out"),this._pollingPromise=null):requestAnimationFrame(u)};requestAnimationFrame(u)}),this._pollingPromise}}function dk(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return is(!1),0}}function _H(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return is(!1),0}}function yH(t,e){var W,ee;const{sourceX:i=0,sourceY:s=0,sourceFormat:n=6408,sourceAttachment:a=36064}=e||{};let{target:u=null,sourceWidth:c,sourceHeight:_,sourceType:w}=e||{};const{framebuffer:S,deleteFramebuffer:A}=pk(t);is(S);const{gl:P,handle:D}=S;c=c||S.width,_=_||S.height;const U=a-36064;w=w||((ee=(W=S.colorAttachments[U])==null?void 0:W.texture)==null?void 0:ee.type)||5121,u=xH(u,w,n,c,_),w=w||$9(u);const L=P.bindFramebuffer(36160,D);return P.readPixels(i,s,c,_,n,w,u),P.bindFramebuffer(36160,L||null),A&&S.destroy(),u}function bH(t,e){const{target:i,sourceX:s=0,sourceY:n=0,sourceFormat:a=6408,targetByteOffset:u=0}=e||{};let{sourceWidth:c,sourceHeight:_,sourceType:w}=e||{};const{framebuffer:S,deleteFramebuffer:A}=pk(t);is(S),c=c||S.width,_=_||S.height;const P=S;w=w||5121;let D=i;if(!D){const L=dk(a),W=_H(w),ee=u+c*_*L*W;D=P.device.createBuffer({byteLength:ee})}const U=t.device.createCommandEncoder();return U.copyTextureToBuffer({source:t,width:c,height:_,origin:[s,n],destination:D,byteOffset:u}),U.destroy(),A&&S.destroy(),D}function pk(t){return t instanceof by?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:vH(t),deleteFramebuffer:!0}}function vH(t,e){const{device:i,width:s,height:n,id:a}=t;return i.createFramebuffer({...e,id:`framebuffer-for-${a}`,width:s,height:n,colorAttachments:[t]})}function xH(t,e,i,s,n){if(t)return t;e=e||5121;const a=zw(e,{clamped:!1}),u=dk(i);return new a(s*n*u)}const wH=256,TH=1024,SH=16384,EH="clear: bad arguments";function AH(t,e){const{framebuffer:i=null,color:s=null,depth:n=null,stencil:a=null}=e||{},u={};i&&(u.framebuffer=i);let c=0;s&&(c|=SH,s!==!0&&(u.clearColor=s)),n&&(c|=wH,n!==!0&&(u.clearDepth=n)),a&&(c|=TH,n!==!0&&(u.clearStencil=n)),is(c!==0,EH);const _=t.gl;nc(_,u,()=>{_.clear(c)})}const Mp=1,_u=class _u extends Nf{constructor(i){var _,w;super({...i,id:i.id||$u("webgl-device")});K(this,"type","webgl");K(this,"handle");K(this,"features");K(this,"limits");K(this,"info");K(this,"canvasContext");K(this,"lost");K(this,"_resolveContextLost");K(this,"renderPass",null);K(this,"gl");K(this,"debug",!1);K(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});K(this,"_extensions",{});K(this,"_polyfilled",!1);K(this,"spectorJS");K(this,"_constants");const s=(_=i.gl)==null?void 0:_.device;if(s)throw new Error(`WebGL context already attached to device ${s.id}`);const n=((w=i.gl)==null?void 0:w.canvas)||i.canvas;this.canvasContext=new w9(this,{...i,canvas:n}),this.lost=new Promise(S=>{this._resolveContextLost=S});let a=i.gl||null;if(a||(a=V$(this.canvasContext.canvas,{...i,onContextLost:S=>{var A;return(A=this._resolveContextLost)==null?void 0:A.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}})),!a)throw new Error("WebGL context creation failed");this.handle=a,this.gl=a,this.gl.device=this,this.gl._version=2,i.spector&&(this.spectorJS=I9({...this.props,canvas:this.handle.canvas})),this.info=j$(this.gl,this._extensions),this.limits=new l9(this.gl),this.features=new a9(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();const{enable:u=!0,copyState:c=!1}=i;sk(this.gl,{enable:u,copyState:c,log:(...S)=>at.log(1,...S)()}),i.debug&&(this.gl=M9(this.gl,{...i,throwOnError:!0}),this.debug=!0,at.level=Math.max(at.level,1),at.warn("WebGL debug mode activated. Performance reduced.")())}static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(i){if(i instanceof _u)return i;if((i==null?void 0:i.device)instanceof Nf)return i.device;if(!IH(i))throw new Error("Invalid WebGL2RenderingContext");return new _u({gl:i})}static async create(i={}){var c;at.groupCollapsed(Mp,"WebGLDevice created")();const s=[];i.debug&&s.push(P9()),i.spector&&s.push(A9()),typeof i.canvas=="string"&&s.push(V1.pageLoaded);const n=await Promise.allSettled(s);for(const _ of n)_.status==="rejected"&&at.error(`Failed to initialize debug libraries ${_.reason}`)();if(at.probe(Mp+1,"DOM is loaded")(),(c=i.gl)!=null&&c.device)return at.warn("reattaching existing device")(),_u.attach(i.gl);const a=new _u(i),u=`Created ${a.type}${a.debug?" debug":""} context: ${a.info.vendor}, ${a.info.renderer} for canvas: ${a.canvasContext.id}`;return at.probe(Mp,u)(),at.table(Mp,a.info)(),at.groupEnd(Mp)(),a}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(i){return J1(this.gl,i,this._extensions)}isTextureFormatFilterable(i){return s9(this.gl,i,this._extensions)}isTextureFormatRenderable(i){return n9(this.gl,i,this._extensions)}createCanvasContext(i){throw new Error("WebGL only supports a single canvas")}createBuffer(i){const s=this._getBufferProps(i);return new oc(this,s)}_createTexture(i){return new ua(this,i)}createExternalTexture(i){throw new Error("createExternalTexture() not implemented")}createSampler(i){return new Lw(this,i)}createShader(i){return new N9(this,i)}createFramebuffer(i){return new Kp(this,i)}createVertexArray(i){return new G1(this,i)}createTransformFeedback(i){return new gH(this,i)}createQuerySet(i){return new mH(this,i)}createRenderPipeline(i){return new oH(this,i)}beginRenderPass(i){return new V9(this,i)}createComputePipeline(i){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(i){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(i){return new fH(this,i)}submit(){var i;(i=this.renderPass)==null||i.end(),this.renderPass=null}readPixelsToArrayWebGL(i,s){return yH(i,s)}readPixelsToBufferWebGL(i,s){return bH(i,s)}setParametersWebGL(i){Gf(this.gl,i)}getParametersWebGL(i){return ik(this.gl,i)}withParametersWebGL(i,s){return nc(this.gl,i,s)}clearWebGL(i){AH(this,i)}resetWebGL(){at.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),D$(this.gl)}loseDevice(){var a;let i=!1;const n=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return n&&(i=!0,n.loseContext()),(a=this._resolveContextLost)==null||a.call(this,{reason:"destroyed",message:"Application triggered context loss"}),i}pushState(){A0(this.gl)}popState(){bg(this.gl)}setSpectorMetadata(i,s){i.__SPECTOR_Metadata=s}getGLKey(i,s){s=s||this.gl2||this.gl;const n=Number(i);for(const a in s)if(s[a]===n)return`GL.${a}`;return String(i)}setConstantAttributeWebGL(i,s){const n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);const a=this._constants[i];switch(a&&RH(a,s)&&at.info(1,`setConstantAttributeWebGL(${i}) could have been skipped, value unchanged`)(),this._constants[i]=s,s.constructor){case Float32Array:CH(this,i,s);break;case Int32Array:PH(this,i,s);break;case Uint32Array:MH(this,i,s);break;default:is(!1)}}getExtension(i){return pc(this.gl,i,this._extensions),this._extensions}};K(_u,"type","webgl");let Gp=_u;function IH(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}function CH(t,e,i){switch(i.length){case 1:t.gl.vertexAttrib1fv(e,i);break;case 2:t.gl.vertexAttrib2fv(e,i);break;case 3:t.gl.vertexAttrib3fv(e,i);break;case 4:t.gl.vertexAttrib4fv(e,i);break;default:is(!1)}}function PH(t,e,i){t.gl.vertexAttribI4iv(e,i)}function MH(t,e,i){t.gl.vertexAttribI4uiv(e,i)}function RH(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ii=e.console&&(e.console.warn||e.console.log);return ii&&ii.call(e.console,Ne,xt),X.apply(this,arguments)}}var L;typeof Object.assign!="function"?L=function(Q){if(Q===n||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var me=Object(Q),Ne=1;Ne-1}function Qe(X){return X.trim().split(/\s+/g)}function He(X,Q,me){if(X.indexOf&&!me)return X.indexOf(Q);for(var Ne=0;Neqs[Q]}),Ne}function yt(X,Q){for(var me,Ne,Ge=Q[0].toUpperCase()+Q.slice(1),xt=0;xt1&&!me.firstMultiple?me.firstMultiple=Kt(Q):Ge===1&&(me.firstMultiple=!1);var xt=me.firstInput,ii=me.firstMultiple,xs=ii?ii.center:xt.center,ws=Q.center=je(Ne);Q.timeStamp=S(),Q.deltaTime=Q.timeStamp-xt.timeStamp,Q.angle=Cs(xs,ws),Q.distance=Mi(xs,ws),St(me,Q),Q.offsetDirection=ri(Q.deltaX,Q.deltaY);var qs=Gt(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=qs.x,Q.overallVelocityY=qs.y,Q.overallVelocity=w(qs.x)>w(qs.y)?qs.x:qs.y,Q.scale=ii?Wt(ii.pointers,Ne):1,Q.rotation=ii?ot(ii.pointers,Ne):0,Q.maxPointers=me.prevInput?Q.pointers.length>me.prevInput.maxPointers?Q.pointers.length:me.prevInput.maxPointers:Q.pointers.length,$t(me,Q);var Ps=X.element;Fe(Q.srcEvent.target,Ps)&&(Ps=Q.srcEvent.target),Q.target=Ps}function St(X,Q){var me=Q.center,Ne=X.offsetDelta||{},Ge=X.prevDelta||{},xt=X.prevInput||{};(Q.eventType===hi||xt.eventType===gi)&&(Ge=X.prevDelta={x:xt.deltaX||0,y:xt.deltaY||0},Ne=X.offsetDelta={x:me.x,y:me.y}),Q.deltaX=Ge.x+(me.x-Ne.x),Q.deltaY=Ge.y+(me.y-Ne.y)}function $t(X,Q){var me=X.lastInterval||Q,Ne=Q.timeStamp-me.timeStamp,Ge,xt,ii,xs;if(Q.eventType!=Ii&&(Ne>In||me.velocity===n)){var ws=Q.deltaX-me.deltaX,qs=Q.deltaY-me.deltaY,Ps=Gt(Ne,ws,qs);xt=Ps.x,ii=Ps.y,Ge=w(Ps.x)>w(Ps.y)?Ps.x:Ps.y,xs=ri(ws,qs),X.lastInterval=Q}else Ge=me.velocity,xt=me.velocityX,ii=me.velocityY,xs=me.direction;Q.velocity=Ge,Q.velocityX=xt,Q.velocityY=ii,Q.direction=xs}function Kt(X){for(var Q=[],me=0;me=w(Q)?X<0?Bs:pe:Q<0?xe:Ue}function Mi(X,Q,me){me||(me=Ze);var Ne=Q[me[0]]-X[me[0]],Ge=Q[me[1]]-X[me[1]];return Math.sqrt(Ne*Ne+Ge*Ge)}function Cs(X,Q,me){me||(me=Ze);var Ne=Q[me[0]]-X[me[0]],Ge=Q[me[1]]-X[me[1]];return Math.atan2(Ge,Ne)*180/Math.PI}function ot(X,Q){return Cs(Q[1],Q[0],Ke)+Cs(X[1],X[0],Ke)}function Wt(X,Q){return Mi(Q[0],Q[1],Ke)/Mi(X[0],X[1],Ke)}var Ot={mousedown:hi,mousemove:as,mouseup:gi},vi="mousedown",Qi="mousemove mouseup";function Bt(){this.evEl=vi,this.evWin=Qi,this.pressed=!1,st.apply(this,arguments)}G(Bt,st,{handler:function(Q){var me=Ot[Q.type];me&hi&&Q.button===0&&(this.pressed=!0),me&as&&Q.which!==1&&(me=gi),this.pressed&&(me&gi&&(this.pressed=!1),this.callback(this.manager,me,{pointers:[Q],changedPointers:[Q],pointerType:En,srcEvent:Q}))}});var cr={pointerdown:hi,pointermove:as,pointerup:gi,pointercancel:Ii,pointerout:Ii},Cr={2:mi,3:Hs,4:En,5:An},Pr="pointerdown",Hn="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Pr="MSPointerDown",Hn="MSPointerMove MSPointerUp MSPointerCancel");function ce(){this.evEl=Pr,this.evWin=Hn,st.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}G(ce,st,{handler:function(Q){var me=this.store,Ne=!1,Ge=Q.type.toLowerCase().replace("ms",""),xt=cr[Ge],ii=Cr[Q.pointerType]||Q.pointerType,xs=ii==mi,ws=He(me,Q.pointerId,"pointerId");xt&hi&&(Q.button===0||xs)?ws<0&&(me.push(Q),ws=me.length-1):xt&(gi|Ii)&&(Ne=!0),!(ws<0)&&(me[ws]=Q,this.callback(this.manager,xt,{pointers:me,changedPointers:[Q],pointerType:ii,srcEvent:Q}),Ne&&me.splice(ws,1))}});var V={touchstart:hi,touchmove:as,touchend:gi,touchcancel:Ii},U="touchstart",Y="touchstart touchmove touchend touchcancel";function re(){this.evTarget=U,this.evWin=Y,this.started=!1,st.apply(this,arguments)}G(re,st,{handler:function(Q){var me=V[Q.type];if(me===hi&&(this.started=!0),!!this.started){var Ne=ye.call(this,Q,me);me&(gi|Ii)&&Ne[0].length-Ne[1].length===0&&(this.started=!1),this.callback(this.manager,me,{pointers:Ne[0],changedPointers:Ne[1],pointerType:mi,srcEvent:Q})}}});function ye(X,Q){var me=Xe(X.touches),Ne=Xe(X.changedTouches);return Q&(gi|Ii)&&(me=dt(me.concat(Ne),"identifier")),[me,Ne]}var Te={touchstart:hi,touchmove:as,touchend:gi,touchcancel:Ii},Ce="touchstart touchmove touchend touchcancel";function fe(){this.evTarget=Ce,this.targetIds={},st.apply(this,arguments)}G(fe,st,{handler:function(Q){var me=Te[Q.type],Ne=ze.call(this,Q,me);Ne&&this.callback(this.manager,me,{pointers:Ne[0],changedPointers:Ne[1],pointerType:mi,srcEvent:Q})}});function ze(X,Q){var me=Xe(X.touches),Ne=this.targetIds;if(Q&(hi|as)&&me.length===1)return Ne[me[0].identifier]=!0,[me,me];var Ge,xt,ii=Xe(X.changedTouches),xs=[],ws=this.target;if(xt=me.filter(function(qs){return Fe(qs.target,ws)}),Q===hi)for(Ge=0;Ge-1&&Ne.splice(xt,1)};setTimeout(Ge,We)}}function Xt(X){for(var Q=X.srcEvent.clientX,me=X.srcEvent.clientY,Ne=0;Ne-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(X){return!!this.simultaneous[X.id]},emit:function(X){var Q=this,me=this.state;function Ne(Ge){Q.manager.emit(Ge,X)}me=ds&&Ne(Q.options.event+Ta(me))},tryEmit:function(X){if(this.canEmit())return this.emit(X);this.state=is},canEmit:function(){for(var X=0;XQ.threshold&&Ge&Q.direction},attrTest:function(X){return _s.prototype.attrTest.call(this,X)&&(this.state&Gs||!(this.state&Gs)&&this.directionTest(X))},emit:function(X){this.pX=X.deltaX,this.pY=X.deltaY;var Q=No(X.direction);Q&&(X.additionalEvent=this.options.event+Q),this._super.emit.call(this,X)}});function Yi(){_s.apply(this,arguments)}G(Yi,_s,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Zt]},attrTest:function(X){return this._super.attrTest.call(this,X)&&(Math.abs(X.scale-1)>this.options.threshold||this.state&Gs)},emit:function(X){if(X.scale!==1){var Q=X.scale<1?"in":"out";X.additionalEvent=this.options.event+Q}this._super.emit.call(this,X)}});function Bo(){Bi.apply(this,arguments),this._timer=null,this._input=null}G(Bo,Bi,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ni]},process:function(X){var Q=this.options,me=X.pointers.length===Q.pointers,Ne=X.distanceQ.time;if(this._input=X,!Ne||!me||X.eventType&(gi|Ii)&&!Ge)this.reset();else if(X.eventType&hi)this.reset(),this._timer=C(function(){this.state=ls,this.tryEmit()},Q.time,this);else if(X.eventType&gi)return ls;return is},reset:function(){clearTimeout(this._timer)},emit:function(X){this.state===ls&&(X&&X.eventType&gi?this.manager.emit(this.options.event+"up",X):(this._input.timeStamp=S(),this.manager.emit(this.options.event,this._input)))}});function Qs(){_s.apply(this,arguments)}G(Qs,_s,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Zt]},attrTest:function(X){return this._super.attrTest.call(this,X)&&(Math.abs(X.rotation)>this.options.threshold||this.state&Gs)}});function bo(){_s.apply(this,arguments)}G(bo,_s,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:he|qe,pointers:1},getTouchAction:function(){return ur.prototype.getTouchAction.call(this)},attrTest:function(X){var Q=this.options.direction,me;return Q&(he|qe)?me=X.overallVelocity:Q&he?me=X.overallVelocityX:Q&qe&&(me=X.overallVelocityY),this._super.attrTest.call(this,X)&&Q&X.offsetDirection&&X.distance>this.options.threshold&&X.maxPointers==this.options.pointers&&w(me)>this.options.velocity&&X.eventType&gi},emit:function(X){var Q=No(X.offsetDirection);Q&&this.manager.emit(this.options.event+Q,X),this.manager.emit(this.options.event,X)}});function qn(){Bi.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}G(qn,Bi,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[es]},process:function(X){var Q=this.options,me=X.pointers.length===Q.pointers,Ne=X.distance0&&s.type==="pointerdown"&&(RW(n,a=>a.pointerId===s.pointerId)||n.push(s)),e.call(this,s)}}function kW(t){t.prototype.handler=function(i){let s=PW[i.type];s&pk&&i.button>=0&&(this.pressed=!0),s&mk&&i.buttons===0&&(s=Mw),this.pressed&&(s&Mw&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[i],changedPointers:[i],pointerType:"mouse",srcEvent:i}))}}MW(Om.PointerEventInput);kW(Om.MouseInput);const OW=Om.Manager;class M0{constructor(e,i,s){this.element=e,this.callback=i,this.options={enable:!0,...s}}}const DW=Jo?[[Jo.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[Jo.Rotate,{enable:!1}],[Jo.Pinch,{enable:!1}],[Jo.Swipe,{enable:!1}],[Jo.Pan,{threshold:0,enable:!1}],[Jo.Press,{enable:!1}],[Jo.Tap,{event:"doubletap",taps:2,enable:!1}],[Jo.Tap,{event:"anytap",enable:!1}],[Jo.Tap,{enable:!1}]]:null,jI={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},FW={doubletap:["tap"]},NW={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},G1={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},BW={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},$I={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},LW=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Zh=typeof window<"u"?window:global;let kw=!1;try{const t={get passive(){return kw=!0,!0}};Zh.addEventListener("test",null,t),Zh.removeEventListener("test",null)}catch{kw=!1}const zW=LW.indexOf("firefox")!==-1,{WHEEL_EVENTS:UW}=G1,WI="wheel",HI=4.000244140625,VW=40,jW=.25;class $W extends M0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{if(!this.options.enable)return;let a=n.deltaY;Zh.WheelEvent&&(zW&&n.deltaMode===Zh.WheelEvent.DOM_DELTA_PIXEL&&(a/=Zh.devicePixelRatio),n.deltaMode===Zh.WheelEvent.DOM_DELTA_LINE&&(a*=VW)),a!==0&&a%HI===0&&(a=Math.floor(a/HI)),n.shiftKey&&a&&(a=a*jW),this.callback({type:WI,center:{x:n.clientX,y:n.clientY},delta:-a,srcEvent:n,pointerType:"mouse",target:n.target})},this.events=(this.options.events||[]).concat(UW),this.events.forEach(n=>e.addEventListener(n,this.handleEvent,kw?{passive:!1}:!1))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===WI&&(this.options.enable=i)}}const{MOUSE_EVENTS:WW}=G1,qI="pointermove",XI="pointerover",ZI="pointerout",KI="pointerenter",YI="pointerleave";class HW extends M0{constructor(e,i,s){super(e,i,s),this.handleEvent=a=>{this.handleOverEvent(a),this.handleOutEvent(a),this.handleEnterEvent(a),this.handleLeaveEvent(a),this.handleMoveEvent(a)},this.pressed=!1;const{enable:n}=this.options;this.enableMoveEvent=n,this.enableLeaveEvent=n,this.enableEnterEvent=n,this.enableOutEvent=n,this.enableOverEvent=n,this.events=(this.options.events||[]).concat(WW),this.events.forEach(a=>e.addEventListener(a,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===qI&&(this.enableMoveEvent=i),e===XI&&(this.enableOverEvent=i),e===ZI&&(this.enableOutEvent=i),e===KI&&(this.enableEnterEvent=i),e===YI&&(this.enableLeaveEvent=i)}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit(XI,e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit(ZI,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit(KI,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit(YI,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(qI,e);break;case"mouseup":this.pressed=!1;break}}_emit(e,i){this.callback({type:e,center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})}}const{KEY_EVENTS:qW}=G1,JI="keydown",GI="keyup";class XW extends M0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{const a=n.target||n.srcElement;a.tagName==="INPUT"&&a.type==="text"||a.tagName==="TEXTAREA"||(this.enableDownEvent&&n.type==="keydown"&&this.callback({type:JI,srcEvent:n,key:n.key,target:n.target}),this.enableUpEvent&&n.type==="keyup"&&this.callback({type:GI,srcEvent:n,key:n.key,target:n.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(qW),e.tabIndex=this.options.tabIndex||0,e.style.outline="none",this.events.forEach(n=>e.addEventListener(n,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===JI&&(this.enableDownEvent=i),e===GI&&(this.enableUpEvent=i)}}const QI="contextmenu";class ZW extends M0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{this.options.enable&&this.callback({type:QI,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,i){e===QI&&(this.options.enable=i)}}const eC=1,Ow=2,tC=4,KW={pointerdown:eC,pointermove:Ow,pointerup:tC,mousedown:eC,mousemove:Ow,mouseup:tC},YW=0,JW=1,GW=2,QW=1,e7=2,t7=4;function i7(t){const e=KW[t.srcEvent.type];if(!e)return null;const{buttons:i,button:s}=t.srcEvent;let n=!1,a=!1,u=!1;return e===Ow?(n=!!(i&QW),a=!!(i&t7),u=!!(i&e7)):(n=s===YW,a=s===JW,u=s===GW),{leftButton:n,middleButton:a,rightButton:u}}function s7(t,e){const i=t.center;if(!i)return null;const s=e.getBoundingClientRect(),n=s.width/e.offsetWidth||1,a=s.height/e.offsetHeight||1,u={x:(i.x-s.left-e.clientLeft)/n,y:(i.y-s.top-e.clientTop)/a};return{center:i,offsetCenter:u}}const vx={srcElement:"root",priority:0};class n7{constructor(e){this.handleEvent=i=>{if(this.isEmpty())return;const s=this._normalizeEvent(i);let n=i.srcEvent.target;for(;n&&n!==s.rootElement;){if(this._emit(s,n),s.handled)return;n=n.parentNode}this._emit(s,"root")},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,i,s,n=!1,a=!1){const{handlers:u,handlersByElement:c}=this;let _=vx;typeof s=="string"||s&&s.addEventListener?_={...vx,srcElement:s}:s&&(_={...vx,...s});let w=c.get(_.srcElement);w||(w=[],c.set(_.srcElement,w));const S={type:e,handler:i,srcElement:_.srcElement,priority:_.priority};n&&(S.once=!0),a&&(S.passive=!0),u.push(S),this._active=this._active||!S.passive;let C=w.length-1;for(;C>=0&&!(w[C].priority>=S.priority);)C--;w.splice(C+1,0,S)}remove(e,i){const{handlers:s,handlersByElement:n}=this;for(let a=s.length-1;a>=0;a--){const u=s[a];if(u.type===e&&u.handler===i){s.splice(a,1);const c=n.get(u.srcElement);c.splice(c.indexOf(u),1),c.length===0&&n.delete(u.srcElement)}}this._active=s.some(a=>!a.passive)}_emit(e,i){const s=this.handlersByElement.get(i);if(s){let n=!1;const a=()=>{e.handled=!0},u=()=>{e.handled=!0,n=!0},c=[];for(let _=0;_{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:i}}}const r7={events:null,recognizers:null,recognizerOptions:{},Manager:OW,touchAction:"none",tabIndex:0};class o7{constructor(e=null,i){this._onBasicInput=n=>{const{srcEvent:a}=n,u=NW[a.type];u&&this.manager.emit(u,n)},this._onOtherEvent=n=>{this.manager.emit(n.type,n)},this.options={...r7,...i},this.events=new Map,this.setElement(e);const{events:s}=this.options;s&&this.on(s)}getElement(){return this.element}setElement(e){if(this.element&&this.destroy(),this.element=e,!e)return;const{options:i}=this,s=i.Manager;this.manager=new s(e,{touchAction:i.touchAction,recognizers:i.recognizers||DW}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(jI).forEach(n=>{const a=this.manager.get(n);a&&jI[n].forEach(u=>{a.recognizeWith(u)})});for(const n in i.recognizerOptions){const a=this.manager.get(n);if(a){const u=i.recognizerOptions[n];delete u.enable,a.set(u)}}this.wheelInput=new $W(e,this._onOtherEvent,{enable:!1}),this.moveInput=new HW(e,this._onOtherEvent,{enable:!1}),this.keyInput=new XW(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new ZW(e,this._onOtherEvent,{enable:!1});for(const[n,a]of this.events)a.isEmpty()||(this._toggleRecognizer(a.recognizerName,!0),this.manager.on(n,a.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,i,s){this._addEventHandler(e,i,s,!1)}once(e,i,s){this._addEventHandler(e,i,s,!0)}watch(e,i,s){this._addEventHandler(e,i,s,!1,!0)}off(e,i){this._removeEventHandler(e,i)}_toggleRecognizer(e,i){const{manager:s}=this;if(!s)return;const n=s.get(e);if(n&&n.options.enable!==i){n.set({enable:i});const a=FW[e];a&&!this.options.recognizers&&a.forEach(u=>{const c=s.get(u);i?(c.requireFailure(e),n.dropRequireFailure(u)):c.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,i),this.moveInput.enableEventType(e,i),this.keyInput.enableEventType(e,i),this.contextmenuInput.enableEventType(e,i)}_addEventHandler(e,i,s,n,a){if(typeof e!="string"){s=i;for(const S in e)this._addEventHandler(S,e[S],s,n,a);return}const{manager:u,events:c}=this,_=$I[e]||e;let w=c.get(_);w||(w=new n7(this),c.set(_,w),w.recognizerName=BW[_]||_,u&&u.on(_,w.handleEvent)),w.add(e,i,s,n,a),w.isEmpty()||this._toggleRecognizer(w.recognizerName,!0)}_removeEventHandler(e,i){if(typeof e!="string"){for(const u in e)this._removeEventHandler(u,e[u]);return}const{events:s}=this,n=$I[e]||e,a=s.get(n);if(a&&(a.remove(e,i),a.isEmpty())){const{recognizerName:u}=a;let c=!1;for(const _ of s.values())if(_.recognizerName===u&&!_.isEmpty()){c=!0;break}c||this._toggleRecognizer(u,!1)}}}function Ol(){}const a7=({isDragging:t})=>t?"grabbing":"grab",iC={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,glOptions:{},canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:Ol,onWebGLInitialized:Ol,onResize:Ol,onViewStateChange:Ol,onInteractionStateChange:Ol,onBeforeRender:Ol,onAfterRender:Ol,onLoad:Ol,onError:t=>Xi.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:a7,getTooltip:null,debug:!1,drawPickingColors:!1},s0=class s0{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new S0({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=s=>{const{_pickRequest:n}=this;if(s.type==="pointerleave")n.x=-1,n.y=-1,n.radius=0;else{if(s.leftButton||s.rightButton)return;{const a=s.offsetCenter;if(!a)return;n.x=a.x,n.y=a.y,n.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:n.x,y:n.y}),n.event=s},this._onEvent=s=>{const n=xw[s.type],a=s.offsetCenter;if(!n||!a||!this.layerManager)return;const u=this.layerManager.getLayers(),c=this.deckPicker.getLastPickedObject({x:a.x,y:a.y,layers:u,viewports:this.getViewports(a)},this._lastPointerDownInfo),{layer:_}=c,w=_&&(_[n.handler]||_.props[n.handler]),S=this.props[n.handler];let C=!1;w&&(C=w.call(_,c,s)),C||(S==null||S(c,s),this.widgetManager.onEvent(c,s))},this._onPointerDown=s=>{const n=s.offsetCenter,a=this._pick("pickObject","pickObject Time",{x:n.x,y:n.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=a.result[0]||a.emptyInfo},this.props={...iC,...e},e=this.props,e.viewState&&e.initialViewState&&Xi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device?this.device=e.device:e.gl&&(e.gl instanceof WebGLRenderingContext&&Xi.error("WebGL1 context not supported.")(),this.device=Wp.attach(e.gl));let i=this.device;i||(ld.registerDevices([Wp]),i=ld.createDevice({...e.deviceProps,canvas:this._createCanvas(e)})),this.animationLoop=this._createAnimationLoop(i,e),this.setProps(e),e._typedArrayManagerProps&&om.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,i,s,n,a,u,c,_,w,S;(e=this.animationLoop)==null||e.stop(),(i=this.animationLoop)==null||i.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(s=this.layerManager)==null||s.finalize(),this.layerManager=null,(n=this.viewManager)==null||n.finalize(),this.viewManager=null,(a=this.effectManager)==null||a.finalize(),this.effectManager=null,(u=this.deckRenderer)==null||u.finalize(),this.deckRenderer=null,(c=this.deckPicker)==null||c.finalize(),this.deckPicker=null,(_=this.eventManager)==null||_.destroy(),this.eventManager=null,(w=this.widgetManager)==null||w.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((S=this.canvas.parentElement)==null||S.removeChild(this.canvas),this.canvas=null)}setProps(e){var s;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Xi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Xi.removed("onLayerClick","onClick")(),e.initialViewState&&!Xr(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const i=Object.create(this.props);Object.assign(i,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(s=this.animationLoop)==null||s.setProps(i),this.layerManager&&(this.viewManager.setProps(i),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(i),this.effectManager.setProps(i),this.deckRenderer.setProps(i),this.deckPicker.setProps(i),this.widgetManager.setProps(i)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let i=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const s=this.viewManager.needsRedraw(e),n=this.layerManager.needsRedraw(e),a=this.effectManager.needsRedraw(e),u=this.deckRenderer.needsRedraw(e);return i=i||s||n||a||u,i}redraw(e){if(!this.layerManager)return;let i=this.needsRedraw({clearRedrawFlags:!0});i=e||i,i&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(i):this._drawLayers(i))}get isInitialized(){return this.viewManager!==null}getViews(){return Ks(this.viewManager),this.viewManager.views}getViewports(e){return Ks(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const i=this._pick("pickObject","pickObject Time",e).result;return i.length?i[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,i=!1){for(const s in e)this.layerManager.resourceManager.add({resourceId:s,data:e[s],forceUpdate:i})}_removeResources(e){for(const i of e)this.layerManager.resourceManager.remove(i)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var i;(i=this.layerManager)==null||i.removeDefaultShaderModule(e)}_pick(e,i,s){Ks(this.deckPicker);const{stats:n}=this;n.get("Pick Count").incrementCount(),n.get(i).timeStart();const a=this.deckPicker[e]({layers:this.layerManager.getLayers(s),views:this.viewManager.getViews(),viewports:this.getViewports(s),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...s});return n.get(i).timeEnd(),a}_createCanvas(e){let i=e.canvas;return typeof i=="string"&&(i=document.getElementById(i),Ks(i)),i||(i=document.createElement("canvas"),i.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(i)),Object.assign(i.style,e.style),i}_setCanvasSize(e){var n;if(!this.canvas)return;const{width:i,height:s}=e;if(i||i===0){const a=Number.isFinite(i)?`${i}px`:i;this.canvas.style.width=a}if(s||s===0){const a=Number.isFinite(s)?`${s}px`:s;this.canvas.style.position=((n=e.style)==null?void 0:n.position)||"absolute",this.canvas.style.height=a}}_updateCanvasSize(){var n,a;const{canvas:e}=this;if(!e)return;const i=e.clientWidth??e.width,s=e.clientHeight??e.height;(i!==this.width||s!==this.height)&&(this.width=i,this.height=s,(n=this.viewManager)==null||n.setProps({width:i,height:s}),(a=this.layerManager)==null||a.activateViewport(this.getViewports()[0]),this.props.onResize({width:i,height:s}))}_createAnimationLoop(e,i){const{gl:s,onError:n,useDevicePixels:a}=i;return new Pj({device:e,useDevicePixels:a,autoResizeDrawingBuffer:!s,autoResizeViewport:!1,onInitialize:u=>this._setDevice(u.device),onRender:this._onRenderFrame.bind(this),onError:n})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,i=Array.isArray(e)?e:e?[e]:[new Sy({id:"default-view"})];return i.length&&this.props.controller&&(i[0].props.controller=this.props.controller),i}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var i,s,n;const{_pickRequest:e}=this;if(e.event){const{result:a,emptyInfo:u}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=a.length>0;let c=u,_=!1;for(const w of a)c=w,_=((i=w.layer)==null?void 0:i.onHover(w,e.event))||_;_||((n=(s=this.props).onHover)==null||n.call(s,c,e.event),this.widgetManager.onHover(c,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var n,a;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(n=this.device.canvasContext)==null?void 0:n.canvas),this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Wp&&this.props.onWebGLInitialized(this.device.gl);const i=new XM;i.play(),this.animationLoop.attachTimeline(i),this.eventManager=new o7(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const u in xw)this.eventManager.on(u,this._onEvent);this.viewManager=new Zj({timeline:i,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const s=this.viewManager.getViewports()[0];this.layerManager=new Xj(this.device,{deck:this,stats:this.stats,viewport:s,timeline:i}),this.effectManager=new h$({deck:this,device:this.device}),this.deckRenderer=new p$(this.device),this.deckPicker=new v$(this.device),this.widgetManager=new T$({deck:this,parentElement:(a=this.canvas)==null?void 0:a.parentElement}),this.widgetManager.addDefault(new E$),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,i){var u;const{device:s,gl:n}=this.layerManager.context;this.props.onBeforeRender({device:s,gl:n});const a={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...i};(u=this.deckRenderer)==null||u.renderLayers(a),a.pass==="screen"&&this.widgetManager.onRedraw({viewports:a.viewports,layers:a.layers}),this.props.onAfterRender({device:s,gl:n})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),Xi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const i=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:i},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const i=this.animationLoop.stats;e.get("GPU Time").addTime(i.get("GPU Time").lastTiming),e.get("CPU Time").addTime(i.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:i}=this;e.fps=i.get("frameRate").getHz(),e.setPropsTime=i.get("setProps Time").time,e.updateAttributesTime=i.get("Update Attributes").time,e.framesRedrawn=i.get("Redraw Count").count,e.pickTime=i.get("pickObject Time").time+i.get("pickMultipleObjects Time").time+i.get("pickObjects Time").time,e.pickCount=i.get("Pick Count").count,e.gpuTime=i.get("GPU Time").time,e.cpuTime=i.get("CPU Time").time,e.gpuTimePerFrame=i.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=i.get("CPU Time").getAverageTime();const s=ld.stats.get("Memory Usage");e.bufferMemory=s.get("Buffer Memory").count,e.textureMemory=s.get("Texture Memory").count,e.renderbufferMemory=s.get("Renderbuffer Memory").count,e.gpuMemory=s.get("GPU Memory").count}};s0.defaultProps=iC,s0.VERSION=X6;let hm=s0;function l7(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return bM(t)}}const c7=yM;function T_(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function uu(t){return t.stride||t.size*t.bytesPerElement}function u7(t,e){return t.type===e.type&&t.size===e.size&&uu(t)===uu(e)&&(t.offset||0)===(e.offset||0)}function Dw(t,e){e.offset&&Xi.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const i=uu(t),s=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,n=e.elementOffset||0,a=s*i+n*t.bytesPerElement+(t.offset||0);return{...e,offset:a,stride:i}}function h7(t,e){const i=Dw(t,e);return{high:i,low:{...i,offset:i.offset+t.size*4}}}class d7{constructor(e,i,s){this._buffer=null,this.device=e,this.id=i.id||"",this.size=i.size||1;const n=i.logicalType||i.type,a=n==="float64";let{defaultValue:u}=i;u=Number.isFinite(u)?[u]:u||new Array(this.size).fill(0);let c;a?c="float32":!n&&i.isIndexed?c="uint32":c=n||"float32";let _=l7(n||c);this.doublePrecision=a,a&&i.fp64===!1&&(_=Float32Array),this.value=null,this.settings={...i,defaultType:_,defaultValue:u,logicalType:n,type:c,normalized:c.includes("norm"),size:this.size,bytesPerElement:_.BYTES_PER_ELEMENT},this.state={...s,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*uu(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),om.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,i=null){const s={};if(this.state.constant){const n=this.value;if(i){const a=Dw(this.getAccessor(),i),u=a.offset/n.BYTES_PER_ELEMENT,c=a.size||this.size;s[e]=n.subarray(u,u+c)}else s[e]=n}else s[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?s[`${e}64Low`]=s[e]:s[`${e}64Low`]=new Float32Array(this.size)),s}_getBufferLayout(e=this.id,i=null){const s=this.getAccessor(),n=[],a={name:this.id,byteStride:uu(s),attributes:n};if(this.doublePrecision){const u=h7(s,i||{});n.push(T_(e,{...s,...u.high}),T_(`${e}64Low`,{...s,...u.low}))}else if(i){const u=Dw(s,i);n.push(T_(e,{...s,...u}))}else n.push(T_(e,s));return a}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const i=Array.from(this.value);e=[i,i]}else{const{value:i,numInstances:s,size:n}=this,a=s*n;if(i&&a&&i.length>=a){const u=new Array(n).fill(1/0),c=new Array(n).fill(-1/0);for(let _=0;_c[w]&&(c[w]=S)}e=[u,c]}}return this.state.bounds=e,e}setData(e){const{state:i}=this;let s;ArrayBuffer.isView(e)?s={value:e}:e instanceof Ns?s={buffer:e}:s=e;const n={...this.settings,...s};if(ArrayBuffer.isView(s.value)){if(!s.type)if(this.doublePrecision&&s.value instanceof Float64Array)n.type="float32";else{const u=c7(s.value);n.type=n.normalized?u.replace("int","norm"):u}n.bytesPerElement=s.value.BYTES_PER_ELEMENT,n.stride=uu(n)}if(i.bounds=null,s.constant){let a=s.value;if(a=this._normalizeValue(a,[],0),this.settings.normalized&&(a=this.normalizeConstant(a)),!(!i.constant||!this._areValuesEqual(a,this.value)))return!1;i.externalBuffer=null,i.constant=!0,this.value=ArrayBuffer.isView(a)?a:new Float32Array(a)}else if(s.buffer){const a=s.buffer;i.externalBuffer=a,i.constant=!1,this.value=s.value||null}else if(s.value){this._checkExternalBuffer(s);let a=s.value;i.externalBuffer=null,i.constant=!1,this.value=a;let{buffer:u}=this;const c=uu(n),_=(n.vertexOffset||0)*c;if(this.doublePrecision&&a instanceof Float64Array&&(a=ax(a,n)),this.settings.isIndexed){const S=this.settings.defaultType;a.constructor!==S&&(a=new S(a))}const w=a.byteLength+_+c*2;(!u||u.byteLength(i+128)/255*2-1);case"snorm16":return new Float32Array(e).map(i=>(i+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(i=>i/255);case"unorm16":return new Float32Array(e).map(i=>i/65535);default:return e}}_normalizeValue(e,i,s){const{defaultValue:n,size:a}=this.settings;if(Number.isFinite(e))return i[s]=e,i;if(!e){let u=a;for(;--u>=0;)i[s+u]=n[u];return i}switch(a){case 4:i[s+3]=Number.isFinite(e[3])?e[3]:n[3];case 3:i[s+2]=Number.isFinite(e[2])?e[2]:n[2];case 2:i[s+1]=Number.isFinite(e[1])?e[1]:n[1];case 1:i[s+0]=Number.isFinite(e[0])?e[0]:n[0];break;default:let u=a;for(;--u>=0;)i[s+u]=Number.isFinite(e[u])?e[u]:n[u]}return i}_areValuesEqual(e,i){if(!e||!i)return!1;const{size:s}=this;for(let n=0;n0&&(nC.length=t.length,s=nC):s=sC,(e>0||Number.isFinite(i))&&(s=(Array.isArray(s)?s:Array.from(s)).slice(e,i),n.index=e-1),{iterable:s,objectInfo:n}}function gk(t){return t&&t[Symbol.asyncIterator]}function p7(t,e){const{size:i,stride:s,offset:n,startIndices:a,nested:u}=e,c=t.BYTES_PER_ELEMENT,_=s?s/c:i,w=n?n/c:0,S=Math.floor((t.length-w)/_);return(C,{index:P,target:D})=>{if(!a){const te=P*_+w;for(let G=0;G=e[1]))return t;const i=[],s=t.length;let n=0;for(let a=0;ae[1]?i.push(u):e=[Math.min(u[0],e[0]),Math.max(u[1],e[1])]}return i.splice(n,0,e),i}const _7={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function _k(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const i=t.type||"interpolation";return{..._7[i],...e,...t,type:i}}class yk extends d7{constructor(e,i){super(e,i,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:U_}),this.constant=!1,this.settings.update=i.update||(i.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const i=this.state.needsRedraw;return this.state.needsRedraw=i&&!e,i}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var i;(i=this.state).layoutChanged||(i.layoutChanged=!u7(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:i}=this.settings,s=this.settings.transition,n=Array.isArray(i)?e[i.find(a=>e[a])]:e[i];return _k(n,s)}setNeedsUpdate(e=this.id,i){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),i){const{startRow:s=0,endRow:n=1/0}=i;this.state.updateRanges=g7(this.state.updateRanges,[s,n])}else this.state.updateRanges=U_}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=m7}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:i,settings:s}=this;return s.noAlloc?!1:s.update?(super.allocate(e,i.updateRanges!==U_),!0):!1}updateBuffer({numInstances:e,data:i,props:s,context:n}){if(!this.needsUpdate())return!1;const{state:{updateRanges:a},settings:{update:u,noAlloc:c}}=this;let _=!0;if(u){for(const[w,S]of a)u.call(n,this,{data:i,startRow:w,endRow:S,props:s,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLengthS?w.set(se,L):(e._normalizeValue(se,te.target,0),jj({target:w,source:te.target,start:L,count:ve}));L+=ve*S}else e._normalizeValue(se,w,L),L+=S}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,i=Math.min(4,this.size);if(e&&e.length>=i){let s=!0;switch(i){case 4:s=s&&Number.isFinite(e[3]);case 3:s=s&&Number.isFinite(e[2]);case 2:s=s&&Number.isFinite(e[1]);case 1:s=s&&Number.isFinite(e[0]);break;default:s=!1}if(!s)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function xx(t){const{source:e,target:i,start:s=0,size:n,getData:a}=t,u=t.end||i.length,c=e.length,_=u-s;if(c>_){i.set(e.subarray(0,_),s);return}if(i.set(e,s),!a)return;let w=c;for(;w<_;){const S=a(w,e);for(let C=0;Cs(S+c,C)),w=Math.min(n.length,a.length);for(let S=1;Sc}){const c=i.doublePrecision&&i.value instanceof Float64Array?2:1,_=i.size*c,w=i.byteOffset,S=i.settings.bytesPerElement<4?w/i.settings.bytesPerElement*4:w,C=i.startIndices,P=a&&C,D=i.isConstant;if(!P&&e&&s>=n)return e;const j=i.value instanceof Float64Array?Float32Array:i.value.constructor,L=D?i.value:new j(i.getBuffer().readSyncWebGL(w,n*j.BYTES_PER_ELEMENT).buffer);if(i.settings.normalized&&!D){const se=u;u=(ve,Se)=>i.normalizeConstant(se(ve,Se))}const H=D?(se,ve)=>u(L,ve):(se,ve)=>u(L.subarray(se+w,se+w+_),ve),te=e?new Float32Array(e.readSyncWebGL(S,s*4).buffer):new Float32Array(0),G=new Float32Array(n);return y7({source:te,target:G,sourceStartIndices:a,targetStartIndices:C,size:_,getData:H}),(!e||e.byteLength\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ii=e.console&&(e.console.warn||e.console.log);return ii&&ii.call(e.console,Be,vt),X.apply(this,arguments)}}var L;typeof Object.assign!="function"?L=function(Q){if(Q===n||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var me=Object(Q),Be=1;Be-1}function Je(X){return X.trim().split(/\s+/g)}function Xe(X,Q,me){if(X.indexOf&&!me)return X.indexOf(Q);for(var Be=0;Beqs[Q]}),Be}function _t(X,Q){for(var me,Be,tt=Q[0].toUpperCase()+Q.slice(1),vt=0;vt1&&!me.firstMultiple?me.firstMultiple=Kt(Q):tt===1&&(me.firstMultiple=!1);var vt=me.firstInput,ii=me.firstMultiple,Ts=ii?ii.center:vt.center,Ss=Q.center=je(Be);Q.timeStamp=S(),Q.deltaTime=Q.timeStamp-vt.timeStamp,Q.angle=Gi(Ts,Ss),Q.distance=_i(Ts,Ss),wt(me,Q),Q.offsetDirection=mi(Q.deltaX,Q.deltaY);var qs=Jt(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=qs.x,Q.overallVelocityY=qs.y,Q.overallVelocity=w(qs.x)>w(qs.y)?qs.x:qs.y,Q.scale=ii?$t(ii.pointers,Be):1,Q.rotation=ii?et(ii.pointers,Be):0,Q.maxPointers=me.prevInput?Q.pointers.length>me.prevInput.maxPointers?Q.pointers.length:me.prevInput.maxPointers:Q.pointers.length,Lt(me,Q);var Ns=X.element;Ne(Q.srcEvent.target,Ns)&&(Ns=Q.srcEvent.target),Q.target=Ns}function wt(X,Q){var me=Q.center,Be=X.offsetDelta||{},tt=X.prevDelta||{},vt=X.prevInput||{};(Q.eventType===hi||vt.eventType===bi)&&(tt=X.prevDelta={x:vt.deltaX||0,y:vt.deltaY||0},Be=X.offsetDelta={x:me.x,y:me.y}),Q.deltaX=tt.x+(me.x-Be.x),Q.deltaY=tt.y+(me.y-Be.y)}function Lt(X,Q){var me=X.lastInterval||Q,Be=Q.timeStamp-me.timeStamp,tt,vt,ii,Ts;if(Q.eventType!=Mi&&(Be>Cn||me.velocity===n)){var Ss=Q.deltaX-me.deltaX,qs=Q.deltaY-me.deltaY,Ns=Jt(Be,Ss,qs);vt=Ns.x,ii=Ns.y,tt=w(Ns.x)>w(Ns.y)?Ns.x:Ns.y,Ts=mi(Ss,qs),X.lastInterval=Q}else tt=me.velocity,vt=me.velocityX,ii=me.velocityY,Ts=me.direction;Q.velocity=tt,Q.velocityX=vt,Q.velocityY=ii,Q.direction=Ts}function Kt(X){for(var Q=[],me=0;me=w(Q)?X<0?Fs:ge:Q<0?ve:Ue}function _i(X,Q,me){me||(me=Ze);var Be=Q[me[0]]-X[me[0]],tt=Q[me[1]]-X[me[1]];return Math.sqrt(Be*Be+tt*tt)}function Gi(X,Q,me){me||(me=Ze);var Be=Q[me[0]]-X[me[0]],tt=Q[me[1]]-X[me[1]];return Math.atan2(tt,Be)*180/Math.PI}function et(X,Q){return Gi(Q[1],Q[0],Ye)+Gi(X[1],X[0],Ye)}function $t(X,Q){return _i(Q[0],Q[1],Ye)/_i(X[0],X[1],Ye)}var kt={mousedown:hi,mousemove:ns,mouseup:bi},wi="mousedown",Qi="mousemove mouseup";function Nt(){this.evEl=wi,this.evWin=Qi,this.pressed=!1,it.apply(this,arguments)}G(Nt,it,{handler:function(Q){var me=kt[Q.type];me&hi&&Q.button===0&&(this.pressed=!0),me&ns&&Q.which!==1&&(me=bi),this.pressed&&(me&bi&&(this.pressed=!1),this.callback(this.manager,me,{pointers:[Q],changedPointers:[Q],pointerType:An,srcEvent:Q}))}});var dr={pointerdown:hi,pointermove:ns,pointerup:bi,pointercancel:Mi,pointerout:Mi},Dr={2:gi,3:$s,4:An,5:In},Fr="pointerdown",Zn="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Fr="MSPointerDown",Zn="MSPointerMove MSPointerUp MSPointerCancel");function le(){this.evEl=Fr,this.evWin=Zn,it.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}G(le,it,{handler:function(Q){var me=this.store,Be=!1,tt=Q.type.toLowerCase().replace("ms",""),vt=dr[tt],ii=Dr[Q.pointerType]||Q.pointerType,Ts=ii==gi,Ss=Xe(me,Q.pointerId,"pointerId");vt&hi&&(Q.button===0||Ts)?Ss<0&&(me.push(Q),Ss=me.length-1):vt&(bi|Mi)&&(Be=!0),!(Ss<0)&&(me[Ss]=Q,this.callback(this.manager,vt,{pointers:me,changedPointers:[Q],pointerType:ii,srcEvent:Q}),Be&&me.splice(Ss,1))}});var j={touchstart:hi,touchmove:ns,touchend:bi,touchcancel:Mi},V="touchstart",Y="touchstart touchmove touchend touchcancel";function ne(){this.evTarget=V,this.evWin=Y,this.started=!1,it.apply(this,arguments)}G(ne,it,{handler:function(Q){var me=j[Q.type];if(me===hi&&(this.started=!0),!!this.started){var Be=ye.call(this,Q,me);me&(bi|Mi)&&Be[0].length-Be[1].length===0&&(this.started=!1),this.callback(this.manager,me,{pointers:Be[0],changedPointers:Be[1],pointerType:gi,srcEvent:Q})}}});function ye(X,Q){var me=qe(X.touches),Be=qe(X.changedTouches);return Q&(bi|Mi)&&(me=ht(me.concat(Be),"identifier")),[me,Be]}var we={touchstart:hi,touchmove:ns,touchend:bi,touchcancel:Mi},Pe="touchstart touchmove touchend touchcancel";function pe(){this.evTarget=Pe,this.targetIds={},it.apply(this,arguments)}G(pe,it,{handler:function(Q){var me=we[Q.type],Be=ze.call(this,Q,me);Be&&this.callback(this.manager,me,{pointers:Be[0],changedPointers:Be[1],pointerType:gi,srcEvent:Q})}});function ze(X,Q){var me=qe(X.touches),Be=this.targetIds;if(Q&(hi|ns)&&me.length===1)return Be[me[0].identifier]=!0,[me,me];var tt,vt,ii=qe(X.changedTouches),Ts=[],Ss=this.target;if(vt=me.filter(function(qs){return Ne(qs.target,Ss)}),Q===hi)for(tt=0;tt-1&&Be.splice(vt,1)};setTimeout(tt,He)}}function ai(X){for(var Q=X.srcEvent.clientX,me=X.srcEvent.clientY,Be=0;Be-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(X){return!!this.simultaneous[X.id]},emit:function(X){var Q=this,me=this.state;function Be(tt){Q.manager.emit(tt,X)}me=fs&&Be(Q.options.event+So(me))},tryEmit:function(X){if(this.canEmit())return this.emit(X);this.state=ls},canEmit:function(){for(var X=0;XQ.threshold&&tt&Q.direction},attrTest:function(X){return Ws.prototype.attrTest.call(this,X)&&(this.state&Js||!(this.state&Js)&&this.directionTest(X))},emit:function(X){this.pX=X.deltaX,this.pY=X.deltaY;var Q=so(X.direction);Q&&(X.additionalEvent=this.options.event+Q),this._super.emit.call(this,X)}});function Yi(){Ws.apply(this,arguments)}G(Yi,Ws,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[qt]},attrTest:function(X){return this._super.attrTest.call(this,X)&&(Math.abs(X.scale-1)>this.options.threshold||this.state&Js)},emit:function(X){if(X.scale!==1){var Q=X.scale<1?"in":"out";X.additionalEvent=this.options.event+Q}this._super.emit.call(this,X)}});function $o(){cs.apply(this,arguments),this._timer=null,this._input=null}G($o,cs,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[rs]},process:function(X){var Q=this.options,me=X.pointers.length===Q.pointers,Be=X.distanceQ.time;if(this._input=X,!Be||!me||X.eventType&(bi|Mi)&&!tt)this.reset();else if(X.eventType&hi)this.reset(),this._timer=A(function(){this.state=as,this.tryEmit()},Q.time,this);else if(X.eventType&bi)return as;return ls},reset:function(){clearTimeout(this._timer)},emit:function(X){this.state===as&&(X&&X.eventType&bi?this.manager.emit(this.options.event+"up",X):(this._input.timeStamp=S(),this.manager.emit(this.options.event,this._input)))}});function gn(){Ws.apply(this,arguments)}G(gn,Ws,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[qt]},attrTest:function(X){return this._super.attrTest.call(this,X)&&(Math.abs(X.rotation)>this.options.threshold||this.state&Js)}});function Pa(){Ws.apply(this,arguments)}G(Pa,Ws,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ce|We,pointers:1},getTouchAction:function(){return Gs.prototype.getTouchAction.call(this)},attrTest:function(X){var Q=this.options.direction,me;return Q&(ce|We)?me=X.overallVelocity:Q&ce?me=X.overallVelocityX:Q&We&&(me=X.overallVelocityY),this._super.attrTest.call(this,X)&&Q&X.offsetDirection&&X.distance>this.options.threshold&&X.maxPointers==this.options.pointers&&w(me)>this.options.velocity&&X.eventType&bi},emit:function(X){var Q=so(X.offsetDirection);Q&&this.manager.emit(this.options.event+Q,X),this.manager.emit(this.options.event,X)}});function Qs(){cs.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}G(Qs,cs,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Fi]},process:function(X){var Q=this.options,me=X.pointers.length===Q.pointers,Be=X.distance0&&s.type==="pointerdown"&&(FH(n,a=>a.pointerId===s.pointerId)||n.push(s)),e.call(this,s)}}function BH(t){t.prototype.handler=function(i){let s=DH[i.type];s&_k&&i.button>=0&&(this.pressed=!0),s&yk&&i.buttons===0&&(s=Uw),this.pressed&&(s&Uw&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[i],changedPointers:[i],pointerType:"mouse",srcEvent:i}))}}NH(Hg.PointerEventInput);BH(Hg.MouseInput);const LH=Hg.Manager;class C0{constructor(e,i,s){this.element=e,this.callback=i,this.options={enable:!0,...s}}}const zH=ta?[[ta.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ta.Rotate,{enable:!1}],[ta.Pinch,{enable:!1}],[ta.Swipe,{enable:!1}],[ta.Pan,{threshold:0,enable:!1}],[ta.Press,{enable:!1}],[ta.Tap,{event:"doubletap",taps:2,enable:!1}],[ta.Tap,{event:"anytap",enable:!1}],[ta.Tap,{enable:!1}]]:null,jI={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},UH={doubletap:["tap"]},VH={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},Q1={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},jH={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},$I={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},$H=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",df=typeof window<"u"?window:global;let Vw=!1;try{const t={get passive(){return Vw=!0,!0}};df.addEventListener("test",null,t),df.removeEventListener("test",null)}catch{Vw=!1}const HH=$H.indexOf("firefox")!==-1,{WHEEL_EVENTS:WH}=Q1,HI="wheel",WI=4.000244140625,qH=40,XH=.25;class ZH extends C0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{if(!this.options.enable)return;let a=n.deltaY;df.WheelEvent&&(HH&&n.deltaMode===df.WheelEvent.DOM_DELTA_PIXEL&&(a/=df.devicePixelRatio),n.deltaMode===df.WheelEvent.DOM_DELTA_LINE&&(a*=qH)),a!==0&&a%WI===0&&(a=Math.floor(a/WI)),n.shiftKey&&a&&(a=a*XH),this.callback({type:HI,center:{x:n.clientX,y:n.clientY},delta:-a,srcEvent:n,pointerType:"mouse",target:n.target})},this.events=(this.options.events||[]).concat(WH),this.events.forEach(n=>e.addEventListener(n,this.handleEvent,Vw?{passive:!1}:!1))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===HI&&(this.options.enable=i)}}const{MOUSE_EVENTS:YH}=Q1,qI="pointermove",XI="pointerover",ZI="pointerout",YI="pointerenter",KI="pointerleave";class KH extends C0{constructor(e,i,s){super(e,i,s),this.handleEvent=a=>{this.handleOverEvent(a),this.handleOutEvent(a),this.handleEnterEvent(a),this.handleLeaveEvent(a),this.handleMoveEvent(a)},this.pressed=!1;const{enable:n}=this.options;this.enableMoveEvent=n,this.enableLeaveEvent=n,this.enableEnterEvent=n,this.enableOutEvent=n,this.enableOverEvent=n,this.events=(this.options.events||[]).concat(YH),this.events.forEach(a=>e.addEventListener(a,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===qI&&(this.enableMoveEvent=i),e===XI&&(this.enableOverEvent=i),e===ZI&&(this.enableOutEvent=i),e===YI&&(this.enableEnterEvent=i),e===KI&&(this.enableLeaveEvent=i)}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit(XI,e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit(ZI,e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit(YI,e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit(KI,e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit(qI,e);break;case"mouseup":this.pressed=!1;break}}_emit(e,i){this.callback({type:e,center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})}}const{KEY_EVENTS:JH}=Q1,JI="keydown",GI="keyup";class GH extends C0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{const a=n.target||n.srcElement;a.tagName==="INPUT"&&a.type==="text"||a.tagName==="TEXTAREA"||(this.enableDownEvent&&n.type==="keydown"&&this.callback({type:JI,srcEvent:n,key:n.key,target:n.target}),this.enableUpEvent&&n.type==="keyup"&&this.callback({type:GI,srcEvent:n,key:n.key,target:n.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(JH),e.tabIndex=this.options.tabIndex||0,e.style.outline="none",this.events.forEach(n=>e.addEventListener(n,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,i){e===JI&&(this.enableDownEvent=i),e===GI&&(this.enableUpEvent=i)}}const QI="contextmenu";class QH extends C0{constructor(e,i,s){super(e,i,s),this.handleEvent=n=>{this.options.enable&&this.callback({type:QI,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,i){e===QI&&(this.options.enable=i)}}const eC=1,jw=2,tC=4,eW={pointerdown:eC,pointermove:jw,pointerup:tC,mousedown:eC,mousemove:jw,mouseup:tC},tW=0,iW=1,sW=2,nW=1,rW=2,oW=4;function aW(t){const e=eW[t.srcEvent.type];if(!e)return null;const{buttons:i,button:s}=t.srcEvent;let n=!1,a=!1,u=!1;return e===jw?(n=!!(i&nW),a=!!(i&oW),u=!!(i&rW)):(n=s===tW,a=s===iW,u=s===sW),{leftButton:n,middleButton:a,rightButton:u}}function lW(t,e){const i=t.center;if(!i)return null;const s=e.getBoundingClientRect(),n=s.width/e.offsetWidth||1,a=s.height/e.offsetHeight||1,u={x:(i.x-s.left-e.clientLeft)/n,y:(i.y-s.top-e.clientTop)/a};return{center:i,offsetCenter:u}}const Cx={srcElement:"root",priority:0};class cW{constructor(e){this.handleEvent=i=>{if(this.isEmpty())return;const s=this._normalizeEvent(i);let n=i.srcEvent.target;for(;n&&n!==s.rootElement;){if(this._emit(s,n),s.handled)return;n=n.parentNode}this._emit(s,"root")},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,i,s,n=!1,a=!1){const{handlers:u,handlersByElement:c}=this;let _=Cx;typeof s=="string"||s&&s.addEventListener?_={...Cx,srcElement:s}:s&&(_={...Cx,...s});let w=c.get(_.srcElement);w||(w=[],c.set(_.srcElement,w));const S={type:e,handler:i,srcElement:_.srcElement,priority:_.priority};n&&(S.once=!0),a&&(S.passive=!0),u.push(S),this._active=this._active||!S.passive;let A=w.length-1;for(;A>=0&&!(w[A].priority>=S.priority);)A--;w.splice(A+1,0,S)}remove(e,i){const{handlers:s,handlersByElement:n}=this;for(let a=s.length-1;a>=0;a--){const u=s[a];if(u.type===e&&u.handler===i){s.splice(a,1);const c=n.get(u.srcElement);c.splice(c.indexOf(u),1),c.length===0&&n.delete(u.srcElement)}}this._active=s.some(a=>!a.passive)}_emit(e,i){const s=this.handlersByElement.get(i);if(s){let n=!1;const a=()=>{e.handled=!0},u=()=>{e.handled=!0,n=!0},c=[];for(let _=0;_{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:i}}}const uW={events:null,recognizers:null,recognizerOptions:{},Manager:LH,touchAction:"none",tabIndex:0};class hW{constructor(e=null,i){this._onBasicInput=n=>{const{srcEvent:a}=n,u=VH[a.type];u&&this.manager.emit(u,n)},this._onOtherEvent=n=>{this.manager.emit(n.type,n)},this.options={...uW,...i},this.events=new Map,this.setElement(e);const{events:s}=this.options;s&&this.on(s)}getElement(){return this.element}setElement(e){if(this.element&&this.destroy(),this.element=e,!e)return;const{options:i}=this,s=i.Manager;this.manager=new s(e,{touchAction:i.touchAction,recognizers:i.recognizers||zH}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(jI).forEach(n=>{const a=this.manager.get(n);a&&jI[n].forEach(u=>{a.recognizeWith(u)})});for(const n in i.recognizerOptions){const a=this.manager.get(n);if(a){const u=i.recognizerOptions[n];delete u.enable,a.set(u)}}this.wheelInput=new ZH(e,this._onOtherEvent,{enable:!1}),this.moveInput=new KH(e,this._onOtherEvent,{enable:!1}),this.keyInput=new GH(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new QH(e,this._onOtherEvent,{enable:!1});for(const[n,a]of this.events)a.isEmpty()||(this._toggleRecognizer(a.recognizerName,!0),this.manager.on(n,a.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,i,s){this._addEventHandler(e,i,s,!1)}once(e,i,s){this._addEventHandler(e,i,s,!0)}watch(e,i,s){this._addEventHandler(e,i,s,!1,!0)}off(e,i){this._removeEventHandler(e,i)}_toggleRecognizer(e,i){const{manager:s}=this;if(!s)return;const n=s.get(e);if(n&&n.options.enable!==i){n.set({enable:i});const a=UH[e];a&&!this.options.recognizers&&a.forEach(u=>{const c=s.get(u);i?(c.requireFailure(e),n.dropRequireFailure(u)):c.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,i),this.moveInput.enableEventType(e,i),this.keyInput.enableEventType(e,i),this.contextmenuInput.enableEventType(e,i)}_addEventHandler(e,i,s,n,a){if(typeof e!="string"){s=i;for(const S in e)this._addEventHandler(S,e[S],s,n,a);return}const{manager:u,events:c}=this,_=$I[e]||e;let w=c.get(_);w||(w=new cW(this),c.set(_,w),w.recognizerName=jH[_]||_,u&&u.on(_,w.handleEvent)),w.add(e,i,s,n,a),w.isEmpty()||this._toggleRecognizer(w.recognizerName,!0)}_removeEventHandler(e,i){if(typeof e!="string"){for(const u in e)this._removeEventHandler(u,e[u]);return}const{events:s}=this,n=$I[e]||e,a=s.get(n);if(a&&(a.remove(e,i),a.isEmpty())){const{recognizerName:u}=a;let c=!1;for(const _ of s.values())if(_.recognizerName===u&&!_.isEmpty()){c=!0;break}c||this._toggleRecognizer(u,!1)}}}function ql(){}const fW=({isDragging:t})=>t?"grabbing":"grab",bk={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,glOptions:{},canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:ql,onWebGLInitialized:ql,onResize:ql,onViewStateChange:ql,onInteractionStateChange:ql,onBeforeRender:ql,onAfterRender:ql,onLoad:ql,onError:t=>qi.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:fW,getTooltip:null,debug:!1,drawPickingColors:!1};class vg{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new x0({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=s=>{const{_pickRequest:n}=this;if(s.type==="pointerleave")n.x=-1,n.y=-1,n.radius=0;else{if(s.leftButton||s.rightButton)return;{const a=s.offsetCenter;if(!a)return;n.x=a.x,n.y=a.y,n.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:n.x,y:n.y}),n.event=s},this._onEvent=s=>{const n=Mw[s.type],a=s.offsetCenter;if(!n||!a||!this.layerManager)return;const u=this.layerManager.getLayers(),c=this.deckPicker.getLastPickedObject({x:a.x,y:a.y,layers:u,viewports:this.getViewports(a)},this._lastPointerDownInfo),{layer:_}=c,w=_&&(_[n.handler]||_.props[n.handler]),S=this.props[n.handler];let A=!1;w&&(A=w.call(_,c,s)),A||(S==null||S(c,s),this.widgetManager.onEvent(c,s))},this._onPointerDown=s=>{const n=s.offsetCenter,a=this._pick("pickObject","pickObject Time",{x:n.x,y:n.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=a.result[0]||a.emptyInfo},this.props={...bk,...e},e=this.props,e.viewState&&e.initialViewState&&qi.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device?this.device=e.device:e.gl&&(e.gl instanceof WebGLRenderingContext&&qi.error("WebGL1 context not supported.")(),this.device=Gp.attach(e.gl));let i=this.device;i||(Cf.registerDevices([Gp]),i=Cf.createDevice({...e.deviceProps,canvas:this._createCanvas(e)})),this.animationLoop=this._createAnimationLoop(i,e),this.setProps(e),e._typedArrayManagerProps&&mg.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,i,s,n,a,u,c,_,w,S;(e=this.animationLoop)==null||e.stop(),(i=this.animationLoop)==null||i.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(s=this.layerManager)==null||s.finalize(),this.layerManager=null,(n=this.viewManager)==null||n.finalize(),this.viewManager=null,(a=this.effectManager)==null||a.finalize(),this.effectManager=null,(u=this.deckRenderer)==null||u.finalize(),this.deckRenderer=null,(c=this.deckPicker)==null||c.finalize(),this.deckPicker=null,(_=this.eventManager)==null||_.destroy(),this.eventManager=null,(w=this.widgetManager)==null||w.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((S=this.canvas.parentElement)==null||S.removeChild(this.canvas),this.canvas=null)}setProps(e){var s;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&qi.removed("onLayerHover","onHover")(),"onLayerClick"in e&&qi.removed("onLayerClick","onClick")(),e.initialViewState&&!Kr(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const i=Object.create(this.props);Object.assign(i,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(s=this.animationLoop)==null||s.setProps(i),this.layerManager&&(this.viewManager.setProps(i),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(i),this.effectManager.setProps(i),this.deckRenderer.setProps(i),this.deckPicker.setProps(i),this.widgetManager.setProps(i)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let i=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const s=this.viewManager.needsRedraw(e),n=this.layerManager.needsRedraw(e),a=this.effectManager.needsRedraw(e),u=this.deckRenderer.needsRedraw(e);return i=i||s||n||a||u,i}redraw(e){if(!this.layerManager)return;let i=this.needsRedraw({clearRedrawFlags:!0});i=e||i,i&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(i):this._drawLayers(i))}get isInitialized(){return this.viewManager!==null}getViews(){return Ys(this.viewManager),this.viewManager.views}getViewports(e){return Ys(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const i=this._pick("pickObject","pickObject Time",e).result;return i.length?i[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,i=!1){for(const s in e)this.layerManager.resourceManager.add({resourceId:s,data:e[s],forceUpdate:i})}_removeResources(e){for(const i of e)this.layerManager.resourceManager.remove(i)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var i;(i=this.layerManager)==null||i.removeDefaultShaderModule(e)}_pick(e,i,s){Ys(this.deckPicker);const{stats:n}=this;n.get("Pick Count").incrementCount(),n.get(i).timeStart();const a=this.deckPicker[e]({layers:this.layerManager.getLayers(s),views:this.viewManager.getViews(),viewports:this.getViewports(s),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...s});return n.get(i).timeEnd(),a}_createCanvas(e){let i=e.canvas;return typeof i=="string"&&(i=document.getElementById(i),Ys(i)),i||(i=document.createElement("canvas"),i.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(i)),Object.assign(i.style,e.style),i}_setCanvasSize(e){var n;if(!this.canvas)return;const{width:i,height:s}=e;if(i||i===0){const a=Number.isFinite(i)?`${i}px`:i;this.canvas.style.width=a}if(s||s===0){const a=Number.isFinite(s)?`${s}px`:s;this.canvas.style.position=((n=e.style)==null?void 0:n.position)||"absolute",this.canvas.style.height=a}}_updateCanvasSize(){var n,a;const{canvas:e}=this;if(!e)return;const i=e.clientWidth??e.width,s=e.clientHeight??e.height;(i!==this.width||s!==this.height)&&(this.width=i,this.height=s,(n=this.viewManager)==null||n.setProps({width:i,height:s}),(a=this.layerManager)==null||a.activateViewport(this.getViewports()[0]),this.props.onResize({width:i,height:s}))}_createAnimationLoop(e,i){const{gl:s,onError:n,useDevicePixels:a}=i;return new Dj({device:e,useDevicePixels:a,autoResizeDrawingBuffer:!s,autoResizeViewport:!1,onInitialize:u=>this._setDevice(u.device),onRender:this._onRenderFrame.bind(this),onError:n})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,i=Array.isArray(e)?e:e?[e]:[new Z1({id:"default-view"})];return i.length&&this.props.controller&&(i[0].props.controller=this.props.controller),i}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var i,s,n;const{_pickRequest:e}=this;if(e.event){const{result:a,emptyInfo:u}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=a.length>0;let c=u,_=!1;for(const w of a)c=w,_=((i=w.layer)==null?void 0:i.onHover(w,e.event))||_;_||((n=(s=this.props).onHover)==null||n.call(s,c,e.event),this.widgetManager.onHover(c,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var n,a;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(n=this.device.canvasContext)==null?void 0:n.canvas),this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Gp&&this.props.onWebGLInitialized(this.device.gl);const i=new KR;i.play(),this.animationLoop.attachTimeline(i),this.eventManager=new hW(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const u in Mw)this.eventManager.on(u,this._onEvent);this.viewManager=new Qj({timeline:i,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const s=this.viewManager.getViewports()[0];this.layerManager=new Gj(this.device,{deck:this,stats:this.stats,viewport:s,timeline:i}),this.effectManager=new m$({deck:this,device:this.device}),this.deckRenderer=new b$(this.device),this.deckPicker=new E$(this.device),this.widgetManager=new C$({deck:this,parentElement:(a=this.canvas)==null?void 0:a.parentElement}),this.widgetManager.addDefault(new M$),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,i){var u;const{device:s,gl:n}=this.layerManager.context;this.props.onBeforeRender({device:s,gl:n});const a={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...i};(u=this.deckRenderer)==null||u.renderLayers(a),a.pass==="screen"&&this.widgetManager.onRedraw({viewports:a.viewports,layers:a.layers}),this.props.onAfterRender({device:s,gl:n})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),qi.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const i=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:i},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const i=this.animationLoop.stats;e.get("GPU Time").addTime(i.get("GPU Time").lastTiming),e.get("CPU Time").addTime(i.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:i}=this;e.fps=i.get("frameRate").getHz(),e.setPropsTime=i.get("setProps Time").time,e.updateAttributesTime=i.get("Update Attributes").time,e.framesRedrawn=i.get("Redraw Count").count,e.pickTime=i.get("pickObject Time").time+i.get("pickMultipleObjects Time").time+i.get("pickObjects Time").time,e.pickCount=i.get("Pick Count").count,e.gpuTime=i.get("GPU Time").time,e.cpuTime=i.get("CPU Time").time,e.gpuTimePerFrame=i.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=i.get("CPU Time").getAverageTime();const s=Cf.stats.get("Memory Usage");e.bufferMemory=s.get("Buffer Memory").count,e.textureMemory=s.get("Texture Memory").count,e.renderbufferMemory=s.get("Renderbuffer Memory").count,e.gpuMemory=s.get("GPU Memory").count}}vg.defaultProps=bk;vg.VERSION=G6;function dW(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return wR(t)}}const pW=xR;function I_(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function vu(t){return t.stride||t.size*t.bytesPerElement}function gW(t,e){return t.type===e.type&&t.size===e.size&&vu(t)===vu(e)&&(t.offset||0)===(e.offset||0)}function $w(t,e){e.offset&&qi.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const i=vu(t),s=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,n=e.elementOffset||0,a=s*i+n*t.bytesPerElement+(t.offset||0);return{...e,offset:a,stride:i}}function mW(t,e){const i=$w(t,e);return{high:i,low:{...i,offset:i.offset+t.size*4}}}class _W{constructor(e,i,s){this._buffer=null,this.device=e,this.id=i.id||"",this.size=i.size||1;const n=i.logicalType||i.type,a=n==="float64";let{defaultValue:u}=i;u=Number.isFinite(u)?[u]:u||new Array(this.size).fill(0);let c;a?c="float32":!n&&i.isIndexed?c="uint32":c=n||"float32";let _=dW(n||c);this.doublePrecision=a,a&&i.fp64===!1&&(_=Float32Array),this.value=null,this.settings={...i,defaultType:_,defaultValue:u,logicalType:n,type:c,normalized:c.includes("norm"),size:this.size,bytesPerElement:_.BYTES_PER_ELEMENT},this.state={...s,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*vu(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),mg.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,i=null){const s={};if(this.state.constant){const n=this.value;if(i){const a=$w(this.getAccessor(),i),u=a.offset/n.BYTES_PER_ELEMENT,c=a.size||this.size;s[e]=n.subarray(u,u+c)}else s[e]=n}else s[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?s[`${e}64Low`]=s[e]:s[`${e}64Low`]=new Float32Array(this.size)),s}_getBufferLayout(e=this.id,i=null){const s=this.getAccessor(),n=[],a={name:this.id,byteStride:vu(s),attributes:n};if(this.doublePrecision){const u=mW(s,i||{});n.push(I_(e,{...s,...u.high}),I_(`${e}64Low`,{...s,...u.low}))}else if(i){const u=$w(s,i);n.push(I_(e,{...s,...u}))}else n.push(I_(e,s));return a}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const i=Array.from(this.value);e=[i,i]}else{const{value:i,numInstances:s,size:n}=this,a=s*n;if(i&&a&&i.length>=a){const u=new Array(n).fill(1/0),c=new Array(n).fill(-1/0);for(let _=0;_c[w]&&(c[w]=S)}e=[u,c]}}return this.state.bounds=e,e}setData(e){const{state:i}=this;let s;ArrayBuffer.isView(e)?s={value:e}:e instanceof Os?s={buffer:e}:s=e;const n={...this.settings,...s};if(ArrayBuffer.isView(s.value)){if(!s.type)if(this.doublePrecision&&s.value instanceof Float64Array)n.type="float32";else{const u=pW(s.value);n.type=n.normalized?u.replace("int","norm"):u}n.bytesPerElement=s.value.BYTES_PER_ELEMENT,n.stride=vu(n)}if(i.bounds=null,s.constant){let a=s.value;if(a=this._normalizeValue(a,[],0),this.settings.normalized&&(a=this.normalizeConstant(a)),!(!i.constant||!this._areValuesEqual(a,this.value)))return!1;i.externalBuffer=null,i.constant=!0,this.value=ArrayBuffer.isView(a)?a:new Float32Array(a)}else if(s.buffer){const a=s.buffer;i.externalBuffer=a,i.constant=!1,this.value=s.value||null}else if(s.value){this._checkExternalBuffer(s);let a=s.value;i.externalBuffer=null,i.constant=!1,this.value=a;let{buffer:u}=this;const c=vu(n),_=(n.vertexOffset||0)*c;if(this.doublePrecision&&a instanceof Float64Array&&(a=gx(a,n)),this.settings.isIndexed){const S=this.settings.defaultType;a.constructor!==S&&(a=new S(a))}const w=a.byteLength+_+c*2;(!u||u.byteLength(i+128)/255*2-1);case"snorm16":return new Float32Array(e).map(i=>(i+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(i=>i/255);case"unorm16":return new Float32Array(e).map(i=>i/65535);default:return e}}_normalizeValue(e,i,s){const{defaultValue:n,size:a}=this.settings;if(Number.isFinite(e))return i[s]=e,i;if(!e){let u=a;for(;--u>=0;)i[s+u]=n[u];return i}switch(a){case 4:i[s+3]=Number.isFinite(e[3])?e[3]:n[3];case 3:i[s+2]=Number.isFinite(e[2])?e[2]:n[2];case 2:i[s+1]=Number.isFinite(e[1])?e[1]:n[1];case 1:i[s+0]=Number.isFinite(e[0])?e[0]:n[0];break;default:let u=a;for(;--u>=0;)i[s+u]=Number.isFinite(e[u])?e[u]:n[u]}return i}_areValuesEqual(e,i){if(!e||!i)return!1;const{size:s}=this;for(let n=0;n0&&(sC.length=t.length,s=sC):s=iC,(e>0||Number.isFinite(i))&&(s=(Array.isArray(s)?s:Array.from(s)).slice(e,i),n.index=e-1),{iterable:s,objectInfo:n}}function vk(t){return t&&t[Symbol.asyncIterator]}function bW(t,e){const{size:i,stride:s,offset:n,startIndices:a,nested:u}=e,c=t.BYTES_PER_ELEMENT,_=s?s/c:i,w=n?n/c:0,S=Math.floor((t.length-w)/_);return(A,{index:P,target:D})=>{if(!a){const ee=P*_+w;for(let G=0;G=e[1]))return t;const i=[],s=t.length;let n=0;for(let a=0;ae[1]?i.push(u):e=[Math.min(u[0],e[0]),Math.max(u[1],e[1])]}return i.splice(n,0,e),i}const wW={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function xk(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const i=t.type||"interpolation";return{...wW[i],...e,...t,type:i}}class wk extends _W{constructor(e,i){super(e,i,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:q_}),this.constant=!1,this.settings.update=i.update||(i.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const i=this.state.needsRedraw;return this.state.needsRedraw=i&&!e,i}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var i;(i=this.state).layoutChanged||(i.layoutChanged=!gW(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:i}=this.settings,s=this.settings.transition,n=Array.isArray(i)?e[i.find(a=>e[a])]:e[i];return xk(n,s)}setNeedsUpdate(e=this.id,i){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),i){const{startRow:s=0,endRow:n=1/0}=i;this.state.updateRanges=xW(this.state.updateRanges,[s,n])}else this.state.updateRanges=q_}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=vW}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:i,settings:s}=this;return s.noAlloc?!1:s.update?(super.allocate(e,i.updateRanges!==q_),!0):!1}updateBuffer({numInstances:e,data:i,props:s,context:n}){if(!this.needsUpdate())return!1;const{state:{updateRanges:a},settings:{update:u,noAlloc:c}}=this;let _=!0;if(u){for(const[w,S]of a)u.call(n,this,{data:i,startRow:w,endRow:S,props:s,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLengthS?w.set(se,L):(e._normalizeValue(se,ee.target,0),Xj({target:w,source:ee.target,start:L,count:fe}));L+=fe*S}else e._normalizeValue(se,w,L),L+=S}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,i=Math.min(4,this.size);if(e&&e.length>=i){let s=!0;switch(i){case 4:s=s&&Number.isFinite(e[3]);case 3:s=s&&Number.isFinite(e[2]);case 2:s=s&&Number.isFinite(e[1]);case 1:s=s&&Number.isFinite(e[0]);break;default:s=!1}if(!s)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function Px(t){const{source:e,target:i,start:s=0,size:n,getData:a}=t,u=t.end||i.length,c=e.length,_=u-s;if(c>_){i.set(e.subarray(0,_),s);return}if(i.set(e,s),!a)return;let w=c;for(;w<_;){const S=a(w,e);for(let A=0;As(S+c,A)),w=Math.min(n.length,a.length);for(let S=1;Sc}){const c=i.doublePrecision&&i.value instanceof Float64Array?2:1,_=i.size*c,w=i.byteOffset,S=i.settings.bytesPerElement<4?w/i.settings.bytesPerElement*4:w,A=i.startIndices,P=a&&A,D=i.isConstant;if(!P&&e&&s>=n)return e;const U=i.value instanceof Float64Array?Float32Array:i.value.constructor,L=D?i.value:new U(i.getBuffer().readSyncWebGL(w,n*U.BYTES_PER_ELEMENT).buffer);if(i.settings.normalized&&!D){const se=u;u=(fe,Se)=>i.normalizeConstant(se(fe,Se))}const W=D?(se,fe)=>u(L,fe):(se,fe)=>u(L.subarray(se+w,se+w+_),fe),ee=e?new Float32Array(e.readSyncWebGL(S,s*4).buffer):new Float32Array(0),G=new Float32Array(n);return TW({source:ee,target:G,sourceStartIndices:a,targetStartIndices:A,size:_,getData:W}),(!e||e.byteLength0||n.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const A7=`#version 300 es +`;function Pk(t){return t.doublePrecision&&t.value instanceof Float64Array}function PW(t,e){const i=e.size,s=Tk(i),n=Sk(i),a=e.getBufferLayout();return Pk(e)?new _g(t,{vs:CW,bufferLayout:[{name:"aFrom",byteStride:8*i,attributes:[{attribute:"aFrom",format:n,byteOffset:0},{attribute:"aFrom64Low",format:n,byteOffset:4*i}]},{name:"aTo",byteStride:8*i,attributes:[{attribute:"aTo",format:n,byteOffset:0},{attribute:"aTo64Low",format:n,byteOffset:4*i}]}],modules:[EV],defines:{ATTRIBUTE_TYPE:s,ATTRIBUTE_SIZE:i},moduleSettings:{},varyings:["vCurrent","vCurrent64Low"],bufferMode:35980,disableWarnings:!0}):new _g(t,{vs:IW,bufferLayout:[{name:"aFrom",format:n},{name:"aTo",format:a.attributes[0].format}],defines:{ATTRIBUTE_TYPE:s},varyings:["vCurrent"],disableWarnings:!0})}class MW extends Ck{constructor({device:e,attribute:i,timeline:s}){super({device:e,attribute:i,timeline:s}),this.type="spring",this.texture=DW(e),this.framebuffer=FW(e,this.texture),this.transform=OW(e,i)}start(e,i){const s=this.currentLength,n=this.currentStartIndices;super.start(e,i);const{buffers:a,attribute:u}=this;for(let _=0;_<2;_++)a[_]=Ik({device:this.device,buffer:a[_],attribute:u,fromLength:s,toLength:this.currentLength,fromStartIndices:n,getData:e.enter});a[2]=Ak({device:this.device,source:a[0],target:a[2]}),this.setBuffer(a[1]);const{model:c}=this.transform;c.setVertexCount(Math.floor(this.currentLength/u.size)),u.isConstant?c.setConstantAttributes({aTo:u.value}):c.setAttributes({aTo:u.getBuffer()})}onUpdate(){const{buffers:e,transform:i,framebuffer:s,transition:n}=this,a=this.settings;i.model.setAttributes({aPrev:e[0],aCur:e[1]}),i.transformFeedback.setBuffers({vNext:e[2]}),i.model.setUniforms({stiffness:a.stiffness,damping:a.damping}),i.run({framebuffer:s,discard:!1,parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]}),Ek(e),this.setBuffer(e[1]),this.device.readPixelsToArrayWebGL(s)[0]>0||n.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const RW=`#version 300 es #define SHADER_NAME spring-transition-vertex-shader #define EPSILON 0.00001 @@ -845,7 +845,7 @@ void main(void) { gl_Position = vec4(0, 0, 0, 1); gl_PointSize = 100.0; } -`,I7=`#version 300 es +`,kW=`#version 300 es #define SHADER_NAME spring-transition-is-transitioning-fragment-shader in float vIsTransitioningFlag; @@ -857,7 +857,7 @@ void main(void) { discard; } fragColor = vec4(1.0); -}`;function C7(t,e){const i=bk(e.size),s=vk(e.size);return new lm(t,{vs:A7,fs:I7,bufferLayout:[{name:"aPrev",format:s},{name:"aCur",format:s},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],defines:{ATTRIBUTE_TYPE:i},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function P7(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function R7(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const M7={interpolation:x7,spring:E7};class k7{constructor(e,{id:i,timeline:s}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=i,this.device=e,this.timeline=s,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:i,numInstances:s}){this.numInstances=s||1;for(const n in e){const a=e[n],u=a.getTransitionSetting(i);u&&this._updateAttribute(n,a,u)}for(const n in this.transitions){const a=e[n];(!a||!a.getTransitionSetting(i))&&this._removeTransition(n)}}hasAttribute(e){const i=this.transitions[e];return i&&i.inProgress}getAttributes(){const e={};for(const i in this.transitions){const s=this.transitions[i];s.inProgress&&(e[i]=s.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const i in this.transitions)this.transitions[i].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,i,s){const n=this.transitions[e];let a=!n||n.type!==s.type;if(a){n&&this._removeTransition(e);const u=M7[s.type];u?this.transitions[e]=new u({attribute:i,timeline:this.timeline,device:this.device}):(Xi.error(`unsupported transition type '${s.type}'`)(),a=!1)}(a||i.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(s,this.numInstances))}}const rC="attributeManager.invalidate",O7="attributeManager.updateStart",D7="attributeManager.updateEnd",F7="attribute.updateStart",N7="attribute.allocate",B7="attribute.updateEnd";class L7{constructor(e,{id:i="attribute-manager",stats:s,timeline:n}={}){this.mergeBoundsMemoized=km(yj),this.id=i,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=s,this.attributeTransitionManager=new k7(e,{id:`${i}-transitions`,timeline:n}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const i=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,i&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const i of e)this.attributes[i]!==void 0&&(this.attributes[i].delete(),delete this.attributes[i])}invalidate(e,i){const s=this._invalidateTrigger(e,i);tr(rC,this,e,s)}invalidateAll(e){for(const i in this.attributes)this.attributes[i].setNeedsUpdate(i,e);tr(rC,this,"all")}update({data:e,numInstances:i,startIndices:s=null,transitions:n,props:a={},buffers:u={},context:c={}}){let _=!1;tr(O7,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const w in this.attributes){const S=this.attributes[w],C=S.settings.accessor;S.startIndices=s,S.numInstances=i,a[w]&&Xi.removed(`props.${w}`,`data.attributes.${w}`)(),S.setExternalBuffer(u[w])||S.setBinaryValue(typeof C=="string"?u[C]:void 0,e.startIndices)||typeof C=="string"&&!u[C]&&S.setConstantValue(a[C])||S.needsUpdate()&&(_=!0,this._updateAttribute({attribute:S,numInstances:i,data:e,props:a,context:c})),this.needsRedraw=this.needsRedraw||S.needsRedraw()}_&&tr(D7,this,i),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:i,transitions:n})}updateTransition(){const{attributeTransitionManager:e}=this,i=e.run();return this.needsRedraw=this.needsRedraw||i,i}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const i=e.map(s=>{var n;return(n=this.attributes[s])==null?void 0:n.getBounds()});return this.mergeBoundsMemoized(i)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:i,attributeTransitionManager:s}=this,n={...s.getAttributes()};for(const a in i){const u=i[a];u.needsRedraw(e)&&!s.hasAttribute(a)&&(n[a]=u)}return n}getBufferLayouts(e){return Object.values(this.getAttributes()).map(i=>i.getBufferLayout(e))}_add(e,i){for(const s in e){const n=e[s],a={...n,id:s,size:n.isIndexed&&1||n.size||1,...i};this.attributes[s]=new yk(this.device,a)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const i in this.attributes)this.attributes[i].getUpdateTriggers().forEach(n=>{e[n]||(e[n]=[]),e[n].push(i)});this.updateTriggers=e}_invalidateTrigger(e,i){const{attributes:s,updateTriggers:n}=this,a=n[e];return a&&a.forEach(u=>{const c=s[u];c&&c.setNeedsUpdate(c.id,i)}),a}_updateAttribute(e){const{attribute:i,numInstances:s}=e;if(tr(F7,i),i.constant){i.setConstantValue(i.value);return}i.allocate(s)&&tr(N7,i,s),i.updateBuffer(e)&&(this.needsRedraw=!0,tr(B7,i,s))}}class z7 extends C0{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:i,toValue:s,duration:n,easing:a}}=this,u=a(e/n);this._value=_y(i,s,u)}}const oC=1e-5;function aC(t,e,i,s,n){const a=e-t,c=(i-e)*n,_=-a*s;return c+_+a+e}function U7(t,e,i,s,n){if(Array.isArray(i)){const a=[];for(let u=0;u0}add(e,i,s,n){const{transitions:a}=this;if(a.has(e)){const _=a.get(e),{value:w=_.settings.fromValue}=_;i=w,this.remove(e)}if(n=_k(n),!n)return;const u=j7[n.type];if(!u){Xi.error(`unsupported transition type '${n.type}'`)();return}const c=new u(this.timeline);c.start({...n,fromValue:i,toValue:s}),a.set(e,c)}remove(e){const{transitions:i}=this;i.has(e)&&(i.get(e).cancel(),i.delete(e))}update(){const e={};for(const[i,s]of this.transitions)s.update(),e[i]=s.value,s.inProgress||this.remove(i);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function W7(t){const e=t[yu];for(const i in e){const s=e[i],{validate:n}=s;if(n&&!n(t[i],s))throw new Error(`Invalid prop ${i}: ${t[i]}`)}}function H7(t,e){const i=Ak({newProps:t,oldProps:e,propTypes:t[yu],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),s=X7(t,e);let n=!1;return s||(n=Z7(t,e)),{dataChanged:s,propsChanged:i,updateTriggersChanged:n,extensionsChanged:K7(t,e),transitionsChanged:q7(t,e)}}function q7(t,e){if(!t.transitions)return!1;const i={},s=t[yu];let n=!1;for(const a in t.transitions){const u=s[a],c=u&&u.type;(c==="number"||c==="color"||c==="array")&&Fw(t[a],e[a],u)&&(i[a]=!0,n=!0)}return n?i:!1}function Ak({newProps:t,oldProps:e,ignoreProps:i={},propTypes:s={},triggerName:n="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${n} changed shallowly`;if(typeof e!="object"||e===null)return`${n} changed shallowly`;for(const a of Object.keys(t))if(!(a in i)){if(!(a in e))return`${n}.${a} added`;const u=Fw(t[a],e[a],s[a]);if(u)return`${n}.${a} ${u}`}for(const a of Object.keys(e))if(!(a in i)){if(!(a in t))return`${n}.${a} dropped`;if(!Object.hasOwnProperty.call(t,a)){const u=Fw(t[a],e[a],s[a]);if(u)return`${n}.${a} ${u}`}}return!1}function Fw(t,e,i){let s=i&&i.equal;return s&&!s(t,e,i)||!s&&(s=t&&e&&t.equals,s&&!s.call(t,e))?"changed deeply":!s&&e!==t?"changed shallowly":null}function X7(t,e){if(e===null)return"oldProps is null, initial diff";let i=!1;const{dataComparator:s,_dataDiff:n}=t;return s?s(t.data,e.data)||(i="Data comparator detected a change"):t.data!==e.data&&(i="A new data container was supplied"),i&&n&&(i=n(t.data,e.data)||i),i}function Z7(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&cC(t,e,"all"))return{all:!0};const i={};let s=!1;for(const n in t.updateTriggers)n!=="all"&&cC(t,e,n)&&(i[n]=!0,s=!0);return s?i:!1}function K7(t,e){if(e===null)return!0;const i=e.extensions,{extensions:s}=t;if(s===i)return!1;if(!i||!s||s.length!==i.length)return!0;for(let n=0;ns.name==="project64"))){const s=i.modules.findIndex(n=>n.name==="project32");s>=0&&i.modules.splice(s,1)}if("inject"in e)if(!t.inject)i.inject=e.inject;else{const s={...t.inject};for(const n in e.inject)s[n]=(s[n]||"")+e.inject[n];i.inject=s}return i}const tH={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Nw={};function iH(t,e,i,s){if(i instanceof ao)return i;i.constructor&&i.constructor.name!=="Object"&&(i={data:i});let n=null;i.compressed&&(n={minFilter:"linear",mipmapFilter:i.data.length>1?"nearest":"linear"});const a=e.createTexture({...i,sampler:{...tH,...n,...s}});return Nw[a.id]=t,a}function sH(t,e){!e||!(e instanceof ao)||Nw[e.id]===t&&(e.delete(),delete Nw[e.id])}const nH={boolean:{validate(t,e){return!0},equal(t,e,i){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||Bw(t)&&(t.length===3||t.length===4)},equal(t,e,i){return Xr(t,e,1)}},accessor:{validate(t,e){const i=Ay(t);return i==="function"||i===Ay(e.value)},equal(t,e,i){return typeof e=="function"?!0:Xr(t,e,1)}},array:{validate(t,e){return e.optional&&!t||Bw(t)},equal(t,e,i){const{compare:s}=i,n=Number.isInteger(s)?s:s?1:0;return s?Xr(t,e,n):t===e}},object:{equal(t,e,i){if(i.ignore)return!0;const{compare:s}=i,n=Number.isInteger(s)?s:s?1:0;return s?Xr(t,e,n):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,i){return!i.compare&&i.ignore!==!1||t===e}},data:{transform:(t,e,i)=>{if(!t)return t;const{dataTransform:s}=i.props;return s?s(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,i)=>{const s=i.context;return!s||!s.device?null:iH(i.id,s.device,t,{...e.parameters,...i.props.textureParameters})},release:(t,e,i)=>{sH(i.id,t)}}};function rH(t){const e={},i={},s={};for(const[n,a]of Object.entries(t)){const u=a==null?void 0:a.deprecatedFor;if(u)s[n]=Array.isArray(u)?u:[u];else{const c=oH(n,a);e[n]=c,i[n]=c.value}}return{propTypes:e,defaultProps:i,deprecatedProps:s}}function oH(t,e){switch(Ay(e)){case"object":return wp(t,e);case"array":return wp(t,{type:"array",value:e,compare:!1});case"boolean":return wp(t,{type:"boolean",value:e});case"number":return wp(t,{type:"number",value:e});case"function":return wp(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function wp(t,e){return"type"in e?{name:t,...nH[e.type],...e}:"value"in e?{name:t,type:Ay(e.value),...e}:{name:t,type:"object",value:e}}function Bw(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Ay(t){return Bw(t)?"array":t===null?"null":typeof t}function aH(t,e){let i;for(let a=e.length-1;a>=0;a--){const u=e[a];"extensions"in u&&(i=u.extensions)}const s=Lw(t.constructor,i),n=Object.create(s);n[Ty]=t,n[Su]={},n[Hl]={};for(let a=0;a{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const i=this.asyncProps[e];i&&i.type&&i.type.release&&i.type.release(i.resolvedValue,i.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||gH}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const i=this.asyncProps[e];return i&&i.resolvedValue}isAsyncPropLoading(e){if(e){const i=this.asyncProps[e];return!!(i&&i.pendingLoadCount>0&&i.pendingLoadCount!==i.resolvedLoadCount)}for(const i in this.asyncProps)if(this.isAsyncPropLoading(i))return!0;return!1}reloadAsyncProp(e,i){this._watchPromise(e,Promise.resolve(i))}setAsyncProps(e){this.component=e[Ty]||this.component;const i=e[Hl]||{},s=e[Su]||e,n=e[hd]||{};for(const a in i){const u=i[a];this._createAsyncPropData(a,n[a]),this._updateAsyncProp(a,u),i[a]=this.getAsyncProp(a)}for(const a in s){const u=s[a];this._createAsyncPropData(a,n[a]),this._updateAsyncProp(a,u)}}_fetch(e,i){return null}_onResolve(e,i){}_onError(e,i){}_updateAsyncProp(e,i){if(this._didAsyncInputValueChange(e,i)){if(typeof i=="string"&&(i=this._fetch(e,i)),i instanceof Promise){this._watchPromise(e,i);return}if(gk(i)){this._resolveAsyncIterable(e,i);return}this._setPropValue(e,i)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,i){const s=this.asyncProps[e];return i===s.resolvedValue||i===s.lastValue?!1:(s.lastValue=i,!0)}_setPropValue(e,i){this._freezeAsyncOldProps();const s=this.asyncProps[e];s&&(i=this._postProcessValue(s,i),s.resolvedValue=i,s.pendingLoadCount++,s.resolvedLoadCount=s.pendingLoadCount)}_setAsyncPropValue(e,i,s){const n=this.asyncProps[e];n&&s>=n.resolvedLoadCount&&i!==void 0&&(this._freezeAsyncOldProps(),n.resolvedValue=i,n.resolvedLoadCount=s,this.onAsyncPropUpdated(e,i))}_watchPromise(e,i){const s=this.asyncProps[e];if(s){s.pendingLoadCount++;const n=s.pendingLoadCount;i.then(a=>{this.component&&(a=this._postProcessValue(s,a),this._setAsyncPropValue(e,a,n),this._onResolve(e,a))}).catch(a=>{this._onError(e,a)})}}async _resolveAsyncIterable(e,i){if(e!=="data"){this._setPropValue(e,i);return}const s=this.asyncProps[e];if(!s)return;s.pendingLoadCount++;const n=s.pendingLoadCount;let a=[],u=0;for await(const c of i){if(!this.component)return;const{dataTransform:_}=this.component.props;_?a=_(c,a):a=a.concat(c),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:u,endRow:a.length}]}),u=a.length,this._setAsyncPropValue(e,a,n)}this._onResolve(e,a)}_postProcessValue(e,i){const s=e.type;return s&&this.component&&(s.release&&s.release(e.resolvedValue,s,this.component),s.transform)?s.transform(i,s,this.component):i}_createAsyncPropData(e,i){if(!this.asyncProps[e]){const n=this.component&&this.component.props[yu];this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:i,pendingLoadCount:0,resolvedLoadCount:0}}}}class yH extends _H{constructor({attributeManager:e,layer:i}){super(i),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,i){const s=this.layer,n=s==null?void 0:s.props.fetch;return n?n(i,{propName:e,layer:s}):super._fetch(e,i)}_onResolve(e,i){const s=this.layer;if(s){const n=s.props.onDataLoad;e==="data"&&n&&n(i,{propName:e,layer:s})}}_onError(e,i){const s=this.layer;s&&s.raiseError(i,`loading ${e} of ${this.layer}`)}}const bH="layer.changeFlag",vH="layer.initialize",xH="layer.update",wH="layer.finalize",TH="layer.matched",hC=2**24-1,SH=Object.freeze([]),EH=km(({oldViewport:t,viewport:e})=>t.equals(e));let Go=new Uint8ClampedArray(0);const AH={data:{type:"data",value:SH,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:i,loaders:s,loadOptions:n,signal:a})=>{const{resourceManager:u}=i.context;n=n||i.getLoadOptions(),s=s||i.props.loaders,a&&(n={...n,fetch:{...n==null?void 0:n.fetch,signal:a}});let c=u.contains(t);return!c&&!n&&(u.add({resourceId:t,data:iw(t,s),persistent:!1}),c=!0),c?u.subscribe({resourceId:t,onChange:_=>{var w;return(w=i.internalState)==null?void 0:w.reloadAsyncProp(e,_)},consumerId:i.id,requestId:e}):iw(t,s,n)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:Fi.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},r0=class r0 extends zw{constructor(){super(...arguments),this.internalState=null,this.lifecycle=jh.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Ks(this.internalState);const i=this.internalState.viewport||this.context.viewport,s=qM(e,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,a,u]=$M(s,i.pixelProjectionMatrix);return e.length===2?[n,a]:[n,a,u]}unproject(e){return Ks(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,i){Ks(this.internalState);const s=this.internalState.viewport||this.context.viewport;return Sj(e,{viewport:s,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...i})}get isComposite(){return!1}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setModuleParameters(e){for(const i of this.getModels())i.updateModuleSettings(e)}setShaderModuleProps(...e){for(const i of this.getModels())i.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===Fi.DEFAULT||e===Fi.LNGLAT||e===Fi.CARTESIAN}onHover(e,i){return this.props.onHover&&this.props.onHover(e,i)||!1}onClick(e,i){return this.props.onClick&&this.props.onClick(e,i)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,i=[]){return i[0]=e+1&255,i[1]=e+1>>8&255,i[2]=e+1>>8>>8&255,i}decodePickingColor(e){Ks(e instanceof Uint8Array);const[i,s,n]=e;return i+s*256+n*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:G7(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=uC(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const i of this.props.extensions)e=uC(e,i.getShaders.call(this,i));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const i=this.getAttributeManager(),{dataChanged:s}=e.changeFlags;if(s&&i)if(Array.isArray(s))for(const n of s)i.invalidateAll(n);else i.invalidateAll();if(i){const{props:n}=e,a=this.internalState.hasPickingBuffer,u=Number.isInteger(n.highlightedObjectIndex)||n.pickable||n.extensions.some(c=>c.getNeedsPickingBuffer.call(this,c));if(a!==u){this.internalState.hasPickingBuffer=u;const{pickingColors:c,instancePickingColors:_}=i.attributes,w=c||_;w&&(u&&w.constant&&(w.constant=!1,i.invalidate(w.id)),!w.value&&!u&&(w.constant=!0,w.value=[0,0,0]))}}}finalizeState(e){for(const s of this.getModels())s.destroy();const i=this.getAttributeManager();i&&i.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const i of this.getModels())i.draw(e)}getPickingInfo({info:e,mode:i,sourceLayer:s}){const{index:n}=e;return n>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[n]),e}raiseError(e,i){var s,n,a,u;i&&(e=new Error(`${i}: ${e.message}`,{cause:e})),(n=(s=this.props).onError)!=null&&n.call(s,e)||(u=(a=this.context)==null?void 0:a.onError)==null||u.call(a,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const i=this.internalState.viewport;this.internalState.viewport=e,(!i||!EH({oldViewport:i,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const i=this.getAttributeManager();i&&(e==="all"?i.invalidateAll():i.invalidate(e))}updateAttributes(e){let i=!1;for(const s in e)e[s].layoutChanged()&&(i=!0);for(const s of this.getModels())this._setModelAttributes(s,e,i)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const i=this.props,s=this.getNumInstances(),n=this.getStartIndices();e.update({data:i.data,numInstances:s,startIndices:n,props:i,transitions:i.transitions,buffers:i.data.attributes,context:this});const a=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(a)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const i=e.update(),s=Object.create(this.props);for(const n in i)Object.defineProperty(s,n,{value:i[n]});return s}return this.props}calculateInstancePickingColors(e,{numInstances:i}){if(e.constant)return;const s=Math.floor(Go.length/4);if(this.internalState.usesPickingColorCache=!0,shC&&Xi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Go=om.allocate(Go,i,{size:4,copy:!0,maxCount:Math.max(i,hC)});const n=Math.floor(Go.length/4),a=[];for(let u=s;u(Xi.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new $7(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const i of this.props.extensions)i.initializeState.call(this,this.context,i);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){tr(TH,this,this===e);const{state:i,internalState:s}=e;this!==e&&(this.internalState=s,this.state=i,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(tr(xH,this,e),!e)return;const i=this.props,s=this.context,n=this.internalState,a=s.viewport,u=this._updateUniformTransition();n.propsInTransition=u,s.viewport=n.viewport||a,this.props=u;try{const c=this._getUpdateParams(),_=this.getModels();if(s.device)this.updateState(c);else try{this.updateState(c)}catch{}for(const S of this.props.extensions)S.updateState.call(this,c,S);const w=this.getModels()[0]!==_[0];this._postUpdate(c,w)}finally{s.viewport=a,this.props=i,this._clearChangeFlags(),n.needsUpdate=!1,n.resetOldProps()}}_finalize(){tr(wH,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,moduleParameters:i=null,uniforms:s={},parameters:n={}}){this._updateAttributeTransition();const a=this.props,u=this.context;this.props=this.internalState.propsInTransition||a;const c=this.props.opacity;s.opacity=Math.pow(c,1/2.2);try{if(i){const{isActive:S,isAttribute:C}=i.picking;this.setModuleParameters(i),this.setShaderModuleProps({picking:{isActive:S,isAttribute:C}})}const{getPolygonOffset:_}=this.props,w=_&&_(s)||[0,0];u.device.setParametersWebGL({polygonOffset:w});for(const S of this.getModels())S.setParameters(n);u.device.withParametersWebGL(n,()=>{const S={renderPass:e,moduleParameters:i,uniforms:s,parameters:n,context:u};for(const C of this.props.extensions)C.draw.call(this,S,C);this.draw(S)})}finally{this.props=a}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:i}=this.internalState;for(const n in e)if(e[n]){let a=!1;switch(n){case"dataChanged":const u=e[n],c=i[n];u&&Array.isArray(c)&&(i.dataChanged=Array.isArray(u)?c.concat(u):u,a=!0);default:i[n]||(i[n]=e[n],a=!0)}a&&tr(bH,this,n,e)}const s=!!(i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged);i.propsOrDataChanged=s,i.somethingChanged=s||i.viewportChanged||i.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,i){var n;const s=H7(e,i);if(s.updateTriggersChanged)for(const a in s.updateTriggersChanged)s.updateTriggersChanged[a]&&this.invalidateAttribute(a);if(s.transitionsChanged)for(const a in s.transitionsChanged)this.internalState.uniformTransitions.add(a,i[a],e[a],(n=e.transitions)==null?void 0:n[a]);return this.setChangeFlags(s)}validateProps(){W7(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const i={highlightedObjectColor:e.picked?e.color:null},{highlightColor:s}=this.props;e.picked&&typeof s=="function"&&(i.highlightColor=s(e)),this.setShaderModuleProps({picking:i}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new L7(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,i){const{props:s,oldProps:n}=e;this.setNeedsRedraw(),this._updateAttributes();const a=this.state.model;a!=null&&a.isInstanced&&a.setInstanceCount(this.getNumInstances());const{autoHighlight:u,highlightedObjectIndex:c,highlightColor:_}=s;if(i||n.autoHighlight!==u||n.highlightedObjectIndex!==c||n.highlightColor!==_){const w={};Array.isArray(_)&&(w.highlightColor=_),(i||n.autoHighlight!==u||c!==n.highlightedObjectIndex)&&(w.highlightedObjectColor=Number.isFinite(c)&&c>=0?this.encodePickingColor(c):null),this.setShaderModuleProps({picking:w})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id;const s=this.getAttributeManager(),n=s?s.getNeedsRedraw(e):!1;if(i=i||n,i)for(const a of this.props.extensions)a.onNeedsRedraw.call(this,a);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,i}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}};r0.defaultProps=AH,r0.layerName="Layer";let Uw=r0;const o0=class o0{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(e){e&&(this.opts=e)}equals(e){return this===e?!0:this.constructor===e.constructor&&Xr(this.opts,e.opts,1)}getShaders(e){return null}getSubLayerProps(e){const{defaultProps:i}=e.constructor,s={updateTriggers:{}};for(const n in i)if(n in this.props){const a=i[n],u=this.props[n];s[n]=u,a&&a.type==="accessor"&&(s.updateTriggers[n]=this.props.updateTriggers[n],typeof u=="function"&&(s[n]=this.getSubLayerAccessor(u)))}return s}initializeState(e,i){}updateState(e,i){}onNeedsRedraw(e){}getNeedsPickingBuffer(e){return!1}draw(e,i){}finalizeState(e,i){}};o0.defaultProps={},o0.extensionName="LayerExtension";let Vw=o0;const wx=512,IH=Math.PI/180;function Ck({map:t,gl:e,deck:i}){if(t.__deck)return t.__deck;const s=i==null?void 0:i.props._customRender,n=i==null?void 0:i.props.onLoad,a=Rk({...i==null?void 0:i.props,_customRender:()=>{t.triggerRepaint(),s==null||s("")}});let u;return(!i||i.props.gl===e)&&(Object.assign(a,{gl:e,width:null,height:null,touchAction:"unset",viewState:dm(t)}),i!=null&&i.isInitialized?dC(i,t):a.onLoad=()=>{n==null||n(),dC(u,t)}),i?(u=i,i.setProps(a),i.userData.isExternal=!0):(u=new hm(a),t.on("remove",()=>{Pk(t)})),u.userData.mapboxLayers=new Set,t.__deck=u,t.on("render",()=>{u.isInitialized&&OH(u,t)}),u}function dC(t,e){const i=()=>{t.isInitialized?DH(t,e):e.off("move",i)};e.on("move",i)}function Pk(t){var e;(e=t.__deck)==null||e.finalize(),t.__deck=null}function Rk(t){return{...t,parameters:{depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthFunc:515,blendEquation:32774,...t.parameters},views:t.views||[new Sy({id:"mapbox"})]}}function CH(t,e){t.userData.mapboxLayers.add(e),eT(t)}function PH(t,e){t.userData.mapboxLayers.delete(e),eT(t)}function RH(t,e){eT(t)}function MH(t,e,i){let{currentViewport:s}=t.userData,n=!1;s||(s=Mk(t,e,!0),t.userData.currentViewport=s,n=!0),t.isInitialized&&t._drawLayers("mapbox-repaint",{viewports:[s],layerFilter:({layer:a})=>i.id===a.id||a.props.operation.includes("terrain"),clearStack:n,clearCanvas:!1})}function dm(t){var n;const{lng:e,lat:i}=t.getCenter(),s={longitude:(e+540)%360-180,latitude:i,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),padding:t.getPadding(),repeat:t.getRenderWorldCopies()};return(n=t.getTerrain)!=null&&n.call(t)&&kH(t,s),s}function kH(t,e){if(t.getFreeCameraOptions){const{position:i}=t.getFreeCameraOptions();if(!i||i.z===void 0)return;const s=t.transform.height,{longitude:n,latitude:a,pitch:u}=e,c=i.x*wx,_=(1-i.y)*wx,w=i.z*wx,S=rm([n,a]),C=c-S[0],P=_-S[1],D=Math.sqrt(C*C+P*P),j=u*IH,L=1.5*s,H=j<.001?L*Math.cos(j)/w:L*Math.sin(j)/D;e.zoom=Math.log2(H);const te=L*Math.cos(j)/H,G=w-te;e.position=[0,0,G/z_(a)]}else typeof t.transform.elevation=="number"&&(e.position=[0,0,t.transform.elevation])}function Mk(t,e,i=!0){return new am({id:"mapbox",x:0,y:0,width:t.width,height:t.height,...dm(e),nearZMultiplier:i?.02:.1,nearZ:e.transform._nearZ/e.transform.height,farZ:e.transform._farZ/e.transform.height})}function OH(t,e){const{mapboxLayers:i,isExternal:s}=t.userData;if(s){const n=Array.from(i,S=>S.id),u=cm(t.props.layers,Boolean).some(S=>S&&!n.includes(S.id));let c=t.getViewports();const _=c.findIndex(S=>S.id==="mapbox"),w=c.length>1||_<0;(u||w)&&(_>=0&&(c=c.slice(),c[_]=Mk(t,e,!1)),t._drawLayers("mapbox-repaint",{viewports:c,layerFilter:S=>(!t.props.layerFilter||t.props.layerFilter(S))&&(S.viewport.id!=="mapbox"||!n.includes(S.layer.id)),clearCanvas:!1}))}t.userData.currentViewport=null}function DH(t,e){t.setProps({viewState:dm(e)}),t.needsRedraw({clearRedrawFlags:!0})}function eT(t){if(t.userData.isExternal)return;const e=[];t.userData.mapboxLayers.forEach(i=>{const s=i.props.type,n=new s(i.props);e.push(n)}),t.setProps({layers:e})}class FH{constructor(e){if(!e.id)throw new Error("Layer must have an unique id");this.id=e.id,this.type="custom",this.renderingMode=e.renderingMode||"3d",this.map=null,this.deck=null,this.props=e}onAdd(e,i){this.map=e,this.deck=Ck({map:e,gl:i,deck:this.props.deck}),CH(this.deck,this)}onRemove(){this.deck&&PH(this.deck,this)}setProps(e){Object.assign(this.props,e,{id:this.id}),this.deck&&RH(this.deck)}render(){MH(this.deck,this.map,this)}}const Tx="__UNDEFINED__";function S_(t,e,i,s){if(!t||!e||!t.style||!t.style._loaded)return;const n=cm(s,Boolean);if(i!==s){const c=cm(i,Boolean),_=new Set(c.map(w=>w.id));for(const w of n)_.delete(w.id);for(const w of _)t.getLayer(w)&&t.removeLayer(w)}for(const c of n){const _=t.getLayer(c.id);_?_.implementation.setProps(c.props):t.addLayer(new FH({id:c.id,deck:e}),c.props.beforeId)}const a=t.style._order,u={};for(const c of n){let{beforeId:_}=c.props;(!_||!a.includes(_))&&(_=Tx),u[_]=u[_]||[],u[_].push(c.id)}for(const c in u){const _=u[c];let w=c===Tx?a.length:a.indexOf(c),S=c===Tx?void 0:c;for(let C=_.length-1;C>=0;C--){const P=_[C],D=a.indexOf(P);D!==w-1&&(t.moveLayer(P,S),D>w&&w++),w--,S=P}}}class NH{constructor(e){this._handleStyleChange=()=>{S_(this._map,this._deck,this._props.layers,this._props.layers)},this._updateContainerSize=()=>{if(this._map&&this._container){const{clientWidth:n,clientHeight:a}=this._map.getContainer();Object.assign(this._container.style,{width:`${n}px`,height:`${a}px`})}},this._updateViewState=()=>{const n=this._deck;n&&(n.setProps({viewState:dm(this._map)}),n.isInitialized&&n.redraw())},this._handleMouseEvent=n=>{const a=this._deck;if(!a||!a.isInitialized)return;const u={type:n.type,offsetCenter:n.point,srcEvent:n},c=this._lastMouseDownPoint;switch(!n.point&&c&&(u.deltaX=n.originalEvent.clientX-c.clientX,u.deltaY=n.originalEvent.clientY-c.clientY,u.offsetCenter={x:c.x+u.deltaX,y:c.y+u.deltaY}),u.type){case"mousedown":a._onPointerDown(u),this._lastMouseDownPoint={...n.point,clientX:n.originalEvent.clientX,clientY:n.originalEvent.clientY};break;case"dragstart":u.type="panstart",a._onEvent(u);break;case"drag":u.type="panmove",a._onEvent(u);break;case"dragend":u.type="panend",a._onEvent(u);break;case"click":u.tapCount=1,a._onEvent(u);break;case"dblclick":u.type="click",u.tapCount=2,a._onEvent(u);break;case"mousemove":u.type="pointermove",a._onPointerMove(u);break;case"mouseout":u.type="pointerleave",a._onPointerMove(u);break;default:return}};const{interleaved:i=!1,...s}=e;this._interleaved=i,this._props=s}setProps(e){this._interleaved&&e.layers&&S_(this._map,this._deck,this._props.layers,e.layers),Object.assign(this._props,e),this._deck&&this._deck.setProps(this._interleaved?Rk(this._props):this._props)}onAdd(e){return this._map=e,this._interleaved?this._onAddInterleaved(e):this._onAddOverlaid(e)}_onAddOverlaid(e){const i=document.createElement("div");return Object.assign(i.style,{position:"absolute",left:0,top:0,textAlign:"initial",pointerEvents:"none"}),this._container=i,this._deck=new hm({...this._props,parent:i,viewState:dm(e)}),e.on("resize",this._updateContainerSize),e.on("render",this._updateViewState),e.on("mousedown",this._handleMouseEvent),e.on("dragstart",this._handleMouseEvent),e.on("drag",this._handleMouseEvent),e.on("dragend",this._handleMouseEvent),e.on("mousemove",this._handleMouseEvent),e.on("mouseout",this._handleMouseEvent),e.on("click",this._handleMouseEvent),e.on("dblclick",this._handleMouseEvent),this._updateContainerSize(),i}_onAddInterleaved(e){const i=e.painter.context.gl;return i instanceof WebGLRenderingContext&&Xi.warn("Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility")(),this._deck=Ck({map:e,gl:i,deck:new hm({...this._props,gl:i})}),e.on("styledata",this._handleStyleChange),S_(e,this._deck,[],this._props.layers),document.createElement("div")}onRemove(){const e=this._map;e&&(this._interleaved?this._onRemoveInterleaved(e):this._onRemoveOverlaid(e)),this._deck=void 0,this._map=void 0,this._container=void 0}_onRemoveOverlaid(e){var i;e.off("resize",this._updateContainerSize),e.off("render",this._updateViewState),e.off("mousedown",this._handleMouseEvent),e.off("dragstart",this._handleMouseEvent),e.off("drag",this._handleMouseEvent),e.off("dragend",this._handleMouseEvent),e.off("mousemove",this._handleMouseEvent),e.off("mouseout",this._handleMouseEvent),e.off("click",this._handleMouseEvent),e.off("dblclick",this._handleMouseEvent),(i=this._deck)==null||i.finalize()}_onRemoveInterleaved(e){e.off("styledata",this._handleStyleChange),S_(e,this._deck,this._props.layers,[]),Pk(e)}getDefaultPosition(){return"top-left"}pickObject(e){return Ks(this._deck),this._deck.pickObject(e)}pickMultipleObjects(e){return Ks(this._deck),this._deck.pickMultipleObjects(e)}pickObjects(e){return Ks(this._deck),this._deck.pickObjects(e)}finalize(){this._map&&this._map.removeControl(this)}getCanvas(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}}const BH=`#version 300 es +}`;function OW(t,e){const i=Tk(e.size),s=Sk(e.size);return new _g(t,{vs:RW,fs:kW,bufferLayout:[{name:"aPrev",format:s},{name:"aCur",format:s},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],defines:{ATTRIBUTE_TYPE:i},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function DW(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function FW(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const NW={interpolation:AW,spring:MW};class BW{constructor(e,{id:i,timeline:s}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=i,this.device=e,this.timeline=s,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:i,numInstances:s}){this.numInstances=s||1;for(const n in e){const a=e[n],u=a.getTransitionSetting(i);u&&this._updateAttribute(n,a,u)}for(const n in this.transitions){const a=e[n];(!a||!a.getTransitionSetting(i))&&this._removeTransition(n)}}hasAttribute(e){const i=this.transitions[e];return i&&i.inProgress}getAttributes(){const e={};for(const i in this.transitions){const s=this.transitions[i];s.inProgress&&(e[i]=s.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const i in this.transitions)this.transitions[i].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,i,s){const n=this.transitions[e];let a=!n||n.type!==s.type;if(a){n&&this._removeTransition(e);const u=NW[s.type];u?this.transitions[e]=new u({attribute:i,timeline:this.timeline,device:this.device}):(qi.error(`unsupported transition type '${s.type}'`)(),a=!1)}(a||i.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(s,this.numInstances))}}const nC="attributeManager.invalidate",LW="attributeManager.updateStart",zW="attributeManager.updateEnd",UW="attribute.updateStart",VW="attribute.allocate",jW="attribute.updateEnd";class $W{constructor(e,{id:i="attribute-manager",stats:s,timeline:n}={}){this.mergeBoundsMemoized=jg(Tj),this.id=i,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=s,this.attributeTransitionManager=new BW(e,{id:`${i}-transitions`,timeline:n}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const i=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,i&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const i of e)this.attributes[i]!==void 0&&(this.attributes[i].delete(),delete this.attributes[i])}invalidate(e,i){const s=this._invalidateTrigger(e,i);nr(nC,this,e,s)}invalidateAll(e){for(const i in this.attributes)this.attributes[i].setNeedsUpdate(i,e);nr(nC,this,"all")}update({data:e,numInstances:i,startIndices:s=null,transitions:n,props:a={},buffers:u={},context:c={}}){let _=!1;nr(LW,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const w in this.attributes){const S=this.attributes[w],A=S.settings.accessor;S.startIndices=s,S.numInstances=i,a[w]&&qi.removed(`props.${w}`,`data.attributes.${w}`)(),S.setExternalBuffer(u[w])||S.setBinaryValue(typeof A=="string"?u[A]:void 0,e.startIndices)||typeof A=="string"&&!u[A]&&S.setConstantValue(a[A])||S.needsUpdate()&&(_=!0,this._updateAttribute({attribute:S,numInstances:i,data:e,props:a,context:c})),this.needsRedraw=this.needsRedraw||S.needsRedraw()}_&&nr(zW,this,i),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:i,transitions:n})}updateTransition(){const{attributeTransitionManager:e}=this,i=e.run();return this.needsRedraw=this.needsRedraw||i,i}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const i=e.map(s=>{var n;return(n=this.attributes[s])==null?void 0:n.getBounds()});return this.mergeBoundsMemoized(i)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:i,attributeTransitionManager:s}=this,n={...s.getAttributes()};for(const a in i){const u=i[a];u.needsRedraw(e)&&!s.hasAttribute(a)&&(n[a]=u)}return n}getBufferLayouts(e){return Object.values(this.getAttributes()).map(i=>i.getBufferLayout(e))}_add(e,i){for(const s in e){const n=e[s],a={...n,id:s,size:n.isIndexed&&1||n.size||1,...i};this.attributes[s]=new wk(this.device,a)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const i in this.attributes)this.attributes[i].getUpdateTriggers().forEach(n=>{e[n]||(e[n]=[]),e[n].push(i)});this.updateTriggers=e}_invalidateTrigger(e,i){const{attributes:s,updateTriggers:n}=this,a=n[e];return a&&a.forEach(u=>{const c=s[u];c&&c.setNeedsUpdate(c.id,i)}),a}_updateAttribute(e){const{attribute:i,numInstances:s}=e;if(nr(UW,i),i.constant){i.setConstantValue(i.value);return}i.allocate(s)&&nr(VW,i,s),i.updateBuffer(e)&&(this.needsRedraw=!0,nr(jW,i,s))}}class HW extends E0{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:i,toValue:s,duration:n,easing:a}}=this,u=a(e/n);this._value=Ty(i,s,u)}}const rC=1e-5;function oC(t,e,i,s,n){const a=e-t,c=(i-e)*n,_=-a*s;return c+_+a+e}function WW(t,e,i,s,n){if(Array.isArray(i)){const a=[];for(let u=0;u0}add(e,i,s,n){const{transitions:a}=this;if(a.has(e)){const _=a.get(e),{value:w=_.settings.fromValue}=_;i=w,this.remove(e)}if(n=xk(n),!n)return;const u=XW[n.type];if(!u){qi.error(`unsupported transition type '${n.type}'`)();return}const c=new u(this.timeline);c.start({...n,fromValue:i,toValue:s}),a.set(e,c)}remove(e){const{transitions:i}=this;i.has(e)&&(i.get(e).cancel(),i.delete(e))}update(){const e={};for(const[i,s]of this.transitions)s.update(),e[i]=s.value,s.inProgress||this.remove(i);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function YW(t){const e=t[Cu];for(const i in e){const s=e[i],{validate:n}=s;if(n&&!n(t[i],s))throw new Error(`Invalid prop ${i}: ${t[i]}`)}}function KW(t,e){const i=Mk({newProps:t,oldProps:e,propTypes:t[Cu],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),s=GW(t,e);let n=!1;return s||(n=QW(t,e)),{dataChanged:s,propsChanged:i,updateTriggersChanged:n,extensionsChanged:e7(t,e),transitionsChanged:JW(t,e)}}function JW(t,e){if(!t.transitions)return!1;const i={},s=t[Cu];let n=!1;for(const a in t.transitions){const u=s[a],c=u&&u.type;(c==="number"||c==="color"||c==="array")&&Hw(t[a],e[a],u)&&(i[a]=!0,n=!0)}return n?i:!1}function Mk({newProps:t,oldProps:e,ignoreProps:i={},propTypes:s={},triggerName:n="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${n} changed shallowly`;if(typeof e!="object"||e===null)return`${n} changed shallowly`;for(const a of Object.keys(t))if(!(a in i)){if(!(a in e))return`${n}.${a} added`;const u=Hw(t[a],e[a],s[a]);if(u)return`${n}.${a} ${u}`}for(const a of Object.keys(e))if(!(a in i)){if(!(a in t))return`${n}.${a} dropped`;if(!Object.hasOwnProperty.call(t,a)){const u=Hw(t[a],e[a],s[a]);if(u)return`${n}.${a} ${u}`}}return!1}function Hw(t,e,i){let s=i&&i.equal;return s&&!s(t,e,i)||!s&&(s=t&&e&&t.equals,s&&!s.call(t,e))?"changed deeply":!s&&e!==t?"changed shallowly":null}function GW(t,e){if(e===null)return"oldProps is null, initial diff";let i=!1;const{dataComparator:s,_dataDiff:n}=t;return s?s(t.data,e.data)||(i="Data comparator detected a change"):t.data!==e.data&&(i="A new data container was supplied"),i&&n&&(i=n(t.data,e.data)||i),i}function QW(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&lC(t,e,"all"))return{all:!0};const i={};let s=!1;for(const n in t.updateTriggers)n!=="all"&&lC(t,e,n)&&(i[n]=!0,s=!0);return s?i:!1}function e7(t,e){if(e===null)return!0;const i=e.extensions,{extensions:s}=t;if(s===i)return!1;if(!i||!s||s.length!==i.length)return!0;for(let n=0;ns.name==="project64"))){const s=i.modules.findIndex(n=>n.name==="project32");s>=0&&i.modules.splice(s,1)}if("inject"in e)if(!t.inject)i.inject=e.inject;else{const s={...t.inject};for(const n in e.inject)s[n]=(s[n]||"")+e.inject[n];i.inject=s}return i}const o7={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Ww={};function a7(t,e,i,s){if(i instanceof po)return i;i.constructor&&i.constructor.name!=="Object"&&(i={data:i});let n=null;i.compressed&&(n={minFilter:"linear",mipmapFilter:i.data.length>1?"nearest":"linear"});const a=e.createTexture({...i,sampler:{...o7,...n,...s}});return Ww[a.id]=t,a}function l7(t,e){!e||!(e instanceof po)||Ww[e.id]===t&&(e.delete(),delete Ww[e.id])}const c7={boolean:{validate(t,e){return!0},equal(t,e,i){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||qw(t)&&(t.length===3||t.length===4)},equal(t,e,i){return Kr(t,e,1)}},accessor:{validate(t,e){const i=My(t);return i==="function"||i===My(e.value)},equal(t,e,i){return typeof e=="function"?!0:Kr(t,e,1)}},array:{validate(t,e){return e.optional&&!t||qw(t)},equal(t,e,i){const{compare:s}=i,n=Number.isInteger(s)?s:s?1:0;return s?Kr(t,e,n):t===e}},object:{equal(t,e,i){if(i.ignore)return!0;const{compare:s}=i,n=Number.isInteger(s)?s:s?1:0;return s?Kr(t,e,n):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,i){return!i.compare&&i.ignore!==!1||t===e}},data:{transform:(t,e,i)=>{if(!t)return t;const{dataTransform:s}=i.props;return s?s(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,i)=>{const s=i.context;return!s||!s.device?null:a7(i.id,s.device,t,{...e.parameters,...i.props.textureParameters})},release:(t,e,i)=>{l7(i.id,t)}}};function u7(t){const e={},i={},s={};for(const[n,a]of Object.entries(t)){const u=a==null?void 0:a.deprecatedFor;if(u)s[n]=Array.isArray(u)?u:[u];else{const c=h7(n,a);e[n]=c,i[n]=c.value}}return{propTypes:e,defaultProps:i,deprecatedProps:s}}function h7(t,e){switch(My(e)){case"object":return Rp(t,e);case"array":return Rp(t,{type:"array",value:e,compare:!1});case"boolean":return Rp(t,{type:"boolean",value:e});case"number":return Rp(t,{type:"number",value:e});case"function":return Rp(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Rp(t,e){return"type"in e?{name:t,...c7[e.type],...e}:"value"in e?{name:t,type:My(e.value),...e}:{name:t,type:"object",value:e}}function qw(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function My(t){return qw(t)?"array":t===null?"null":typeof t}function f7(t,e){let i;for(let a=e.length-1;a>=0;a--){const u=e[a];"extensions"in u&&(i=u.extensions)}const s=Xw(t.constructor,i),n=Object.create(s);n[Cy]=t,n[Fu]={},n[sc]={};for(let a=0;a{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const i=this.asyncProps[e];i&&i.type&&i.type.release&&i.type.release(i.resolvedValue,i.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||x7}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const i=this.asyncProps[e];return i&&i.resolvedValue}isAsyncPropLoading(e){if(e){const i=this.asyncProps[e];return!!(i&&i.pendingLoadCount>0&&i.pendingLoadCount!==i.resolvedLoadCount)}for(const i in this.asyncProps)if(this.isAsyncPropLoading(i))return!0;return!1}reloadAsyncProp(e,i){this._watchPromise(e,Promise.resolve(i))}setAsyncProps(e){this.component=e[Cy]||this.component;const i=e[sc]||{},s=e[Fu]||e,n=e[Rf]||{};for(const a in i){const u=i[a];this._createAsyncPropData(a,n[a]),this._updateAsyncProp(a,u),i[a]=this.getAsyncProp(a)}for(const a in s){const u=s[a];this._createAsyncPropData(a,n[a]),this._updateAsyncProp(a,u)}}_fetch(e,i){return null}_onResolve(e,i){}_onError(e,i){}_updateAsyncProp(e,i){if(this._didAsyncInputValueChange(e,i)){if(typeof i=="string"&&(i=this._fetch(e,i)),i instanceof Promise){this._watchPromise(e,i);return}if(vk(i)){this._resolveAsyncIterable(e,i);return}this._setPropValue(e,i)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,i){const s=this.asyncProps[e];return i===s.resolvedValue||i===s.lastValue?!1:(s.lastValue=i,!0)}_setPropValue(e,i){this._freezeAsyncOldProps();const s=this.asyncProps[e];s&&(i=this._postProcessValue(s,i),s.resolvedValue=i,s.pendingLoadCount++,s.resolvedLoadCount=s.pendingLoadCount)}_setAsyncPropValue(e,i,s){const n=this.asyncProps[e];n&&s>=n.resolvedLoadCount&&i!==void 0&&(this._freezeAsyncOldProps(),n.resolvedValue=i,n.resolvedLoadCount=s,this.onAsyncPropUpdated(e,i))}_watchPromise(e,i){const s=this.asyncProps[e];if(s){s.pendingLoadCount++;const n=s.pendingLoadCount;i.then(a=>{this.component&&(a=this._postProcessValue(s,a),this._setAsyncPropValue(e,a,n),this._onResolve(e,a))}).catch(a=>{this._onError(e,a)})}}async _resolveAsyncIterable(e,i){if(e!=="data"){this._setPropValue(e,i);return}const s=this.asyncProps[e];if(!s)return;s.pendingLoadCount++;const n=s.pendingLoadCount;let a=[],u=0;for await(const c of i){if(!this.component)return;const{dataTransform:_}=this.component.props;_?a=_(c,a):a=a.concat(c),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:u,endRow:a.length}]}),u=a.length,this._setAsyncPropValue(e,a,n)}this._onResolve(e,a)}_postProcessValue(e,i){const s=e.type;return s&&this.component&&(s.release&&s.release(e.resolvedValue,s,this.component),s.transform)?s.transform(i,s,this.component):i}_createAsyncPropData(e,i){if(!this.asyncProps[e]){const n=this.component&&this.component.props[Cu];this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:i,pendingLoadCount:0,resolvedLoadCount:0}}}}class T7 extends w7{constructor({attributeManager:e,layer:i}){super(i),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,i){const s=this.layer,n=s==null?void 0:s.props.fetch;return n?n(i,{propName:e,layer:s}):super._fetch(e,i)}_onResolve(e,i){const s=this.layer;if(s){const n=s.props.onDataLoad;e==="data"&&n&&n(i,{propName:e,layer:s})}}_onError(e,i){const s=this.layer;s&&s.raiseError(i,`loading ${e} of ${this.layer}`)}}const S7="layer.changeFlag",E7="layer.initialize",A7="layer.update",I7="layer.finalize",C7="layer.matched",uC=2**24-1,P7=Object.freeze([]),M7=jg(({oldViewport:t,viewport:e})=>t.equals(e));let ia=new Uint8ClampedArray(0);const R7={data:{type:"data",value:P7,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:i,loaders:s,loadOptions:n,signal:a})=>{const{resourceManager:u}=i.context;n=n||i.getLoadOptions(),s=s||i.props.loaders,a&&(n={...n,fetch:{...n==null?void 0:n.fetch,signal:a}});let c=u.contains(t);return!c&&!n&&(u.add({resourceId:t,data:hw(t,s),persistent:!1}),c=!0),c?u.subscribe({resourceId:t,onChange:_=>{var w;return(w=i.internalState)==null?void 0:w.reloadAsyncProp(e,_)},consumerId:i.id,requestId:e}):hw(t,s,n)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:Li.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class iT extends tT{constructor(){super(...arguments),this.internalState=null,this.lifecycle=af.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Ys(this.internalState);const i=this.internalState.viewport||this.context.viewport,s=YR(e,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,a,u]=qR(s,i.pixelProjectionMatrix);return e.length===2?[n,a]:[n,a,u]}unproject(e){return Ys(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,i){Ys(this.internalState);const s=this.internalState.viewport||this.context.viewport;return Pj(e,{viewport:s,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...i})}get isComposite(){return!1}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setModuleParameters(e){for(const i of this.getModels())i.updateModuleSettings(e)}setShaderModuleProps(...e){for(const i of this.getModels())i.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===Li.DEFAULT||e===Li.LNGLAT||e===Li.CARTESIAN}onHover(e,i){return this.props.onHover&&this.props.onHover(e,i)||!1}onClick(e,i){return this.props.onClick&&this.props.onClick(e,i)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,i=[]){return i[0]=e+1&255,i[1]=e+1>>8&255,i[2]=e+1>>8>>8&255,i}decodePickingColor(e){Ys(e instanceof Uint8Array);const[i,s,n]=e;return i+s*256+n*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:s7(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=cC(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const i of this.props.extensions)e=cC(e,i.getShaders.call(this,i));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const i=this.getAttributeManager(),{dataChanged:s}=e.changeFlags;if(s&&i)if(Array.isArray(s))for(const n of s)i.invalidateAll(n);else i.invalidateAll();if(i){const{props:n}=e,a=this.internalState.hasPickingBuffer,u=Number.isInteger(n.highlightedObjectIndex)||n.pickable||n.extensions.some(c=>c.getNeedsPickingBuffer.call(this,c));if(a!==u){this.internalState.hasPickingBuffer=u;const{pickingColors:c,instancePickingColors:_}=i.attributes,w=c||_;w&&(u&&w.constant&&(w.constant=!1,i.invalidate(w.id)),!w.value&&!u&&(w.constant=!0,w.value=[0,0,0]))}}}finalizeState(e){for(const s of this.getModels())s.destroy();const i=this.getAttributeManager();i&&i.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const i of this.getModels())i.draw(e)}getPickingInfo({info:e,mode:i,sourceLayer:s}){const{index:n}=e;return n>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[n]),e}raiseError(e,i){var s,n,a,u;i&&(e=new Error(`${i}: ${e.message}`,{cause:e})),(n=(s=this.props).onError)!=null&&n.call(s,e)||(u=(a=this.context)==null?void 0:a.onError)==null||u.call(a,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const i=this.internalState.viewport;this.internalState.viewport=e,(!i||!M7({oldViewport:i,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const i=this.getAttributeManager();i&&(e==="all"?i.invalidateAll():i.invalidate(e))}updateAttributes(e){let i=!1;for(const s in e)e[s].layoutChanged()&&(i=!0);for(const s of this.getModels())this._setModelAttributes(s,e,i)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const i=this.props,s=this.getNumInstances(),n=this.getStartIndices();e.update({data:i.data,numInstances:s,startIndices:n,props:i,transitions:i.transitions,buffers:i.data.attributes,context:this});const a=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(a)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const i=e.update(),s=Object.create(this.props);for(const n in i)Object.defineProperty(s,n,{value:i[n]});return s}return this.props}calculateInstancePickingColors(e,{numInstances:i}){if(e.constant)return;const s=Math.floor(ia.length/4);if(this.internalState.usesPickingColorCache=!0,suC&&qi.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),ia=mg.allocate(ia,i,{size:4,copy:!0,maxCount:Math.max(i,uC)});const n=Math.floor(ia.length/4),a=[];for(let u=s;u(qi.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new ZW(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const i of this.props.extensions)i.initializeState.call(this,this.context,i);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){nr(C7,this,this===e);const{state:i,internalState:s}=e;this!==e&&(this.internalState=s,this.state=i,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(nr(A7,this,e),!e)return;const i=this.props,s=this.context,n=this.internalState,a=s.viewport,u=this._updateUniformTransition();n.propsInTransition=u,s.viewport=n.viewport||a,this.props=u;try{const c=this._getUpdateParams(),_=this.getModels();if(s.device)this.updateState(c);else try{this.updateState(c)}catch{}for(const S of this.props.extensions)S.updateState.call(this,c,S);const w=this.getModels()[0]!==_[0];this._postUpdate(c,w)}finally{s.viewport=a,this.props=i,this._clearChangeFlags(),n.needsUpdate=!1,n.resetOldProps()}}_finalize(){nr(I7,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,moduleParameters:i=null,uniforms:s={},parameters:n={}}){this._updateAttributeTransition();const a=this.props,u=this.context;this.props=this.internalState.propsInTransition||a;const c=this.props.opacity;s.opacity=Math.pow(c,1/2.2);try{if(i){const{isActive:S,isAttribute:A}=i.picking;this.setModuleParameters(i),this.setShaderModuleProps({picking:{isActive:S,isAttribute:A}})}const{getPolygonOffset:_}=this.props,w=_&&_(s)||[0,0];u.device.setParametersWebGL({polygonOffset:w});for(const S of this.getModels())S.setParameters(n);u.device.withParametersWebGL(n,()=>{const S={renderPass:e,moduleParameters:i,uniforms:s,parameters:n,context:u};for(const A of this.props.extensions)A.draw.call(this,S,A);this.draw(S)})}finally{this.props=a}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:i}=this.internalState;for(const n in e)if(e[n]){let a=!1;switch(n){case"dataChanged":const u=e[n],c=i[n];u&&Array.isArray(c)&&(i.dataChanged=Array.isArray(u)?c.concat(u):u,a=!0);default:i[n]||(i[n]=e[n],a=!0)}a&&nr(S7,this,n,e)}const s=!!(i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged);i.propsOrDataChanged=s,i.somethingChanged=s||i.viewportChanged||i.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,i){var n;const s=KW(e,i);if(s.updateTriggersChanged)for(const a in s.updateTriggersChanged)s.updateTriggersChanged[a]&&this.invalidateAttribute(a);if(s.transitionsChanged)for(const a in s.transitionsChanged)this.internalState.uniformTransitions.add(a,i[a],e[a],(n=e.transitions)==null?void 0:n[a]);return this.setChangeFlags(s)}validateProps(){YW(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const i={highlightedObjectColor:e.picked?e.color:null},{highlightColor:s}=this.props;e.picked&&typeof s=="function"&&(i.highlightColor=s(e)),this.setShaderModuleProps({picking:i}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new $W(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,i){const{props:s,oldProps:n}=e;this.setNeedsRedraw(),this._updateAttributes();const a=this.state.model;a!=null&&a.isInstanced&&a.setInstanceCount(this.getNumInstances());const{autoHighlight:u,highlightedObjectIndex:c,highlightColor:_}=s;if(i||n.autoHighlight!==u||n.highlightedObjectIndex!==c||n.highlightColor!==_){const w={};Array.isArray(_)&&(w.highlightColor=_),(i||n.autoHighlight!==u||c!==n.highlightedObjectIndex)&&(w.highlightedObjectColor=Number.isFinite(c)&&c>=0?this.encodePickingColor(c):null),this.setShaderModuleProps({picking:w})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id;const s=this.getAttributeManager(),n=s?s.getNeedsRedraw(e):!1;if(i=i||n,i)for(const a of this.props.extensions)a.onNeedsRedraw.call(this,a);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,i}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}iT.defaultProps=R7;iT.layerName="Layer";class sT{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(e){e&&(this.opts=e)}equals(e){return this===e?!0:this.constructor===e.constructor&&Kr(this.opts,e.opts,1)}getShaders(e){return null}getSubLayerProps(e){const{defaultProps:i}=e.constructor,s={updateTriggers:{}};for(const n in i)if(n in this.props){const a=i[n],u=this.props[n];s[n]=u,a&&a.type==="accessor"&&(s.updateTriggers[n]=this.props.updateTriggers[n],typeof u=="function"&&(s[n]=this.getSubLayerAccessor(u)))}return s}initializeState(e,i){}updateState(e,i){}onNeedsRedraw(e){}getNeedsPickingBuffer(e){return!1}draw(e,i){}finalizeState(e,i){}}sT.defaultProps={};sT.extensionName="LayerExtension";const Mx=512,k7=Math.PI/180;function kk({map:t,gl:e,deck:i}){if(t.__deck)return t.__deck;const s=i==null?void 0:i.props._customRender,n=i==null?void 0:i.props.onLoad,a=Dk({...i==null?void 0:i.props,_customRender:()=>{t.triggerRepaint(),s==null||s("")}});let u;return(!i||i.props.gl===e)&&(Object.assign(a,{gl:e,width:null,height:null,touchAction:"unset",viewState:xg(t)}),i!=null&&i.isInitialized?hC(i,t):a.onLoad=()=>{n==null||n(),hC(u,t)}),i?(u=i,i.setProps(a),i.userData.isExternal=!0):(u=new vg(a),t.on("remove",()=>{Ok(t)})),u.userData.mapboxLayers=new Set,t.__deck=u,t.on("render",()=>{u.isInitialized&&L7(u,t)}),u}function hC(t,e){const i=()=>{t.isInitialized?z7(t,e):e.off("move",i)};e.on("move",i)}function Ok(t){var e;(e=t.__deck)==null||e.finalize(),t.__deck=null}function Dk(t){return{...t,parameters:{depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthFunc:515,blendEquation:32774,...t.parameters},views:t.views||[new Z1({id:"mapbox"})]}}function O7(t,e){t.userData.mapboxLayers.add(e),nT(t)}function D7(t,e){t.userData.mapboxLayers.delete(e),nT(t)}function F7(t,e){nT(t)}function N7(t,e,i){let{currentViewport:s}=t.userData,n=!1;s||(s=Fk(t,e,!0),t.userData.currentViewport=s,n=!0),t.isInitialized&&t._drawLayers("mapbox-repaint",{viewports:[s],layerFilter:({layer:a})=>i.id===a.id||a.props.operation.includes("terrain"),clearStack:n,clearCanvas:!1})}function xg(t){var n;const{lng:e,lat:i}=t.getCenter(),s={longitude:(e+540)%360-180,latitude:i,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),padding:t.getPadding(),repeat:t.getRenderWorldCopies()};return(n=t.getTerrain)!=null&&n.call(t)&&B7(t,s),s}function B7(t,e){if(t.getFreeCameraOptions){const{position:i}=t.getFreeCameraOptions();if(!i||i.z===void 0)return;const s=t.transform.height,{longitude:n,latitude:a,pitch:u}=e,c=i.x*Mx,_=(1-i.y)*Mx,w=i.z*Mx,S=gg([n,a]),A=c-S[0],P=_-S[1],D=Math.sqrt(A*A+P*P),U=u*k7,L=1.5*s,W=U<.001?L*Math.cos(U)/w:L*Math.sin(U)/D;e.zoom=Math.log2(W);const ee=L*Math.cos(U)/W,G=w-ee;e.position=[0,0,G/W_(a)]}else typeof t.transform.elevation=="number"&&(e.position=[0,0,t.transform.elevation])}function Fk(t,e,i=!0){return new Du({id:"mapbox",x:0,y:0,width:t.width,height:t.height,...xg(e),nearZMultiplier:i?.02:.1,nearZ:e.transform._nearZ/e.transform.height,farZ:e.transform._farZ/e.transform.height})}function L7(t,e){const{mapboxLayers:i,isExternal:s}=t.userData;if(s){const n=Array.from(i,S=>S.id),u=yg(t.props.layers,Boolean).some(S=>S&&!n.includes(S.id));let c=t.getViewports();const _=c.findIndex(S=>S.id==="mapbox"),w=c.length>1||_<0;(u||w)&&(_>=0&&(c=c.slice(),c[_]=Fk(t,e,!1)),t._drawLayers("mapbox-repaint",{viewports:c,layerFilter:S=>(!t.props.layerFilter||t.props.layerFilter(S))&&(S.viewport.id!=="mapbox"||!n.includes(S.layer.id)),clearCanvas:!1}))}t.userData.currentViewport=null}function z7(t,e){t.setProps({viewState:xg(e)}),t.needsRedraw({clearRedrawFlags:!0})}function nT(t){if(t.userData.isExternal)return;const e=[];t.userData.mapboxLayers.forEach(i=>{const s=i.props.type,n=new s(i.props);e.push(n)}),t.setProps({layers:e})}class U7{constructor(e){if(!e.id)throw new Error("Layer must have an unique id");this.id=e.id,this.type="custom",this.renderingMode=e.renderingMode||"3d",this.map=null,this.deck=null,this.props=e}onAdd(e,i){this.map=e,this.deck=kk({map:e,gl:i,deck:this.props.deck}),O7(this.deck,this)}onRemove(){this.deck&&D7(this.deck,this)}setProps(e){Object.assign(this.props,e,{id:this.id}),this.deck&&F7(this.deck)}render(){N7(this.deck,this.map,this)}}const Rx="__UNDEFINED__";function C_(t,e,i,s){if(!t||!e||!t.style||!t.style._loaded)return;const n=yg(s,Boolean);if(i!==s){const c=yg(i,Boolean),_=new Set(c.map(w=>w.id));for(const w of n)_.delete(w.id);for(const w of _)t.getLayer(w)&&t.removeLayer(w)}for(const c of n){const _=t.getLayer(c.id);_?(_.implementation||_).setProps(c.props):t.addLayer(new U7({id:c.id,deck:e}),c.props.beforeId)}const a=t.style._order,u={};for(const c of n){let{beforeId:_}=c.props;(!_||!a.includes(_))&&(_=Rx),u[_]=u[_]||[],u[_].push(c.id)}for(const c in u){const _=u[c];let w=c===Rx?a.length:a.indexOf(c),S=c===Rx?void 0:c;for(let A=_.length-1;A>=0;A--){const P=_[A],D=a.indexOf(P);D!==w-1&&(t.moveLayer(P,S),D>w&&w++),w--,S=P}}}class V7{constructor(e){this._handleStyleChange=()=>{C_(this._map,this._deck,this._props.layers,this._props.layers)},this._updateContainerSize=()=>{if(this._map&&this._container){const{clientWidth:n,clientHeight:a}=this._map.getContainer();Object.assign(this._container.style,{width:`${n}px`,height:`${a}px`})}},this._updateViewState=()=>{const n=this._deck;n&&(n.setProps({viewState:xg(this._map)}),n.isInitialized&&n.redraw())},this._handleMouseEvent=n=>{const a=this._deck;if(!a||!a.isInitialized)return;const u={type:n.type,offsetCenter:n.point,srcEvent:n},c=this._lastMouseDownPoint;switch(!n.point&&c&&(u.deltaX=n.originalEvent.clientX-c.clientX,u.deltaY=n.originalEvent.clientY-c.clientY,u.offsetCenter={x:c.x+u.deltaX,y:c.y+u.deltaY}),u.type){case"mousedown":a._onPointerDown(u),this._lastMouseDownPoint={...n.point,clientX:n.originalEvent.clientX,clientY:n.originalEvent.clientY};break;case"dragstart":u.type="panstart",a._onEvent(u);break;case"drag":u.type="panmove",a._onEvent(u);break;case"dragend":u.type="panend",a._onEvent(u);break;case"click":u.tapCount=1,a._onEvent(u);break;case"dblclick":u.type="click",u.tapCount=2,a._onEvent(u);break;case"mousemove":u.type="pointermove",a._onPointerMove(u);break;case"mouseout":u.type="pointerleave",a._onPointerMove(u);break;default:return}};const{interleaved:i=!1,...s}=e;this._interleaved=i,this._props=s}setProps(e){this._interleaved&&e.layers&&C_(this._map,this._deck,this._props.layers,e.layers),Object.assign(this._props,e),this._deck&&this._deck.setProps(this._interleaved?Dk(this._props):this._props)}onAdd(e){return this._map=e,this._interleaved?this._onAddInterleaved(e):this._onAddOverlaid(e)}_onAddOverlaid(e){const i=document.createElement("div");return Object.assign(i.style,{position:"absolute",left:0,top:0,textAlign:"initial",pointerEvents:"none"}),this._container=i,this._deck=new vg({...this._props,parent:i,viewState:xg(e)}),e.on("resize",this._updateContainerSize),e.on("render",this._updateViewState),e.on("mousedown",this._handleMouseEvent),e.on("dragstart",this._handleMouseEvent),e.on("drag",this._handleMouseEvent),e.on("dragend",this._handleMouseEvent),e.on("mousemove",this._handleMouseEvent),e.on("mouseout",this._handleMouseEvent),e.on("click",this._handleMouseEvent),e.on("dblclick",this._handleMouseEvent),this._updateContainerSize(),i}_onAddInterleaved(e){const i=e.painter.context.gl;return i instanceof WebGLRenderingContext&&qi.warn("Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility")(),this._deck=kk({map:e,gl:i,deck:new vg({...this._props,gl:i})}),e.on("styledata",this._handleStyleChange),C_(e,this._deck,[],this._props.layers),document.createElement("div")}onRemove(){const e=this._map;e&&(this._interleaved?this._onRemoveInterleaved(e):this._onRemoveOverlaid(e)),this._deck=void 0,this._map=void 0,this._container=void 0}_onRemoveOverlaid(e){var i;e.off("resize",this._updateContainerSize),e.off("render",this._updateViewState),e.off("mousedown",this._handleMouseEvent),e.off("dragstart",this._handleMouseEvent),e.off("drag",this._handleMouseEvent),e.off("dragend",this._handleMouseEvent),e.off("mousemove",this._handleMouseEvent),e.off("mouseout",this._handleMouseEvent),e.off("click",this._handleMouseEvent),e.off("dblclick",this._handleMouseEvent),(i=this._deck)==null||i.finalize()}_onRemoveInterleaved(e){e.off("styledata",this._handleStyleChange),C_(e,this._deck,this._props.layers,[]),Ok(e)}getDefaultPosition(){return"top-left"}pickObject(e){return Ys(this._deck),this._deck.pickObject(e)}pickMultipleObjects(e){return Ys(this._deck),this._deck.pickMultipleObjects(e)}pickObjects(e){return Ys(this._deck),this._deck.pickObjects(e)}finalize(){this._map&&this._map.removeControl(this)}getCanvas(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}}const j7=`#version 300 es #define SHADER_NAME scatterplot-layer-vertex-shader in vec3 positions; in vec3 instancePositions; @@ -918,7 +918,7 @@ DECKGL_FILTER_COLOR(vFillColor, geometry); vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity); DECKGL_FILTER_COLOR(vLineColor, geometry); } -`,LH=`#version 300 es +`,$7=`#version 300 es #define SHADER_NAME scatterplot-layer-fragment-shader precision highp float; uniform bool filled; @@ -959,7 +959,7 @@ fragColor = vFillColor; fragColor.a *= inCircle; DECKGL_FILTER_COLOR(fragColor, geometry); } -`,fC=[0,0,0,255],zH={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:fC},getLineColor:{type:"accessor",value:fC},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},a0=class a0 extends Uw{getShaders(){return super.getShaders({vs:BH,fs:LH,modules:[P8,J8]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var i;super.updateState(e),e.changeFlags.extensionsChanged&&((i=this.state.model)==null||i.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:i,radiusScale:s,radiusMinPixels:n,radiusMaxPixels:a,stroked:u,filled:c,billboard:_,antialiasing:w,lineWidthUnits:S,lineWidthScale:C,lineWidthMinPixels:P,lineWidthMaxPixels:D}=this.props,j=this.state.model;j.setUniforms(e),j.setUniforms({stroked:u?1:0,filled:c,billboard:_,antialiasing:w,radiusUnits:by[i],radiusScale:s,radiusMinPixels:n,radiusMaxPixels:a,lineWidthUnits:by[S],lineWidthScale:C,lineWidthMinPixels:P,lineWidthMaxPixels:D}),j.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new Sd(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Lj({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}};a0.defaultProps=zH,a0.layerName="ScatterplotLayer";let jw=a0;const kk=` +`,fC=[0,0,0,255],H7={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:fC},getLineColor:{type:"accessor",value:fC},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class rT extends iT{getShaders(){return super.getShaders({vs:j7,fs:$7,modules:[D8,ij]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var i;super.updateState(e),e.changeFlags.extensionsChanged&&((i=this.state.model)==null||i.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:i,radiusScale:s,radiusMinPixels:n,radiusMaxPixels:a,stroked:u,filled:c,billboard:_,antialiasing:w,lineWidthUnits:S,lineWidthScale:A,lineWidthMinPixels:P,lineWidthMaxPixels:D}=this.props,U=this.state.model;U.setUniforms(e),U.setUniforms({stroked:u?1:0,filled:c,billboard:_,antialiasing:w,radiusUnits:Ey[i],radiusScale:s,radiusMinPixels:n,radiusMaxPixels:a,lineWidthUnits:Ey[S],lineWidthScale:A,lineWidthMinPixels:P,lineWidthMaxPixels:D}),U.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new $f(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new $j({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}}rT.defaultProps=H7;rT.layerName="ScatterplotLayer";const Nk=` uniform bool filter_useSoftMargin; uniform bool filter_enabled; uniform bool filter_transformSize; @@ -1036,10 +1036,10 @@ if(any(equal(dataFilter_bits, DATACATEGORY_TYPE(0.0)))) dataFilter_value = 0.0; #endif } #endif -`,Ok=` +`,Bk=` uniform bool filter_transformColor; in float dataFilter_value; -`;function Dk(t){if(!t||!("extensions"in t))return{};const{filterRange:e=[-1,1],filterEnabled:i=!0,filterTransformSize:s=!0,filterTransformColor:n=!0}=t,a=t.filterSoftRange||e;return{...Number.isFinite(e[0])?{filter_min:e[0],filter_softMin:a[0],filter_softMax:a[1],filter_max:e[1]}:{filter_min:e.map(u=>u[0]),filter_softMin:a.map(u=>u[0]),filter_softMax:a.map(u=>u[1]),filter_max:e.map(u=>u[1])},filter_enabled:i,filter_useSoftMargin:!!t.filterSoftRange,filter_transformSize:i&&s,filter_transformColor:i&&n}}function UH(t){if(!t||!("extensions"in t))return{};const e=Dk(t);if(Number.isFinite(e.filter_min)){const i=Math.fround(e.filter_min);e.filter_min-=i,e.filter_softMin-=i,e.filter_min64High=i;const s=Math.fround(e.filter_max);e.filter_max-=s,e.filter_softMax-=s,e.filter_max64High=s}else{const i=e.filter_min.map(Math.fround);e.filter_min=e.filter_min.map((n,a)=>n-i[a]),e.filter_softMin=e.filter_softMin.map((n,a)=>n-i[a]),e.filter_min64High=i;const s=e.filter_max.map(Math.fround);e.filter_max=e.filter_max.map((n,a)=>n-s[a]),e.filter_softMax=e.filter_softMax.map((n,a)=>n-s[a]),e.filter_max64High=s}return e}const Fk={"vs:#main-start":` +`;function Lk(t){if(!t||!("extensions"in t))return{};const{filterRange:e=[-1,1],filterEnabled:i=!0,filterTransformSize:s=!0,filterTransformColor:n=!0}=t,a=t.filterSoftRange||e;return{...Number.isFinite(e[0])?{filter_min:e[0],filter_softMin:a[0],filter_softMax:a[1],filter_max:e[1]}:{filter_min:e.map(u=>u[0]),filter_softMin:a.map(u=>u[0]),filter_softMax:a.map(u=>u[1]),filter_max:e.map(u=>u[1])},filter_enabled:i,filter_useSoftMargin:!!t.filterSoftRange,filter_transformSize:i&&s,filter_transformColor:i&&n}}function W7(t){if(!t||!("extensions"in t))return{};const e=Lk(t);if(Number.isFinite(e.filter_min)){const i=Math.fround(e.filter_min);e.filter_min-=i,e.filter_softMin-=i,e.filter_min64High=i;const s=Math.fround(e.filter_max);e.filter_max-=s,e.filter_softMax-=s,e.filter_max64High=s}else{const i=e.filter_min.map(Math.fround);e.filter_min=e.filter_min.map((n,a)=>n-i[a]),e.filter_softMin=e.filter_softMin.map((n,a)=>n-i[a]),e.filter_min64High=i;const s=e.filter_max.map(Math.fround);e.filter_max=e.filter_max.map((n,a)=>n-s[a]),e.filter_softMax=e.filter_softMax.map((n,a)=>n-s[a]),e.filter_max64High=s}return e}const zk={"vs:#main-start":` dataFilter_value = 1.0; if (filter_enabled) { #ifdef DATAFILTER_TYPE @@ -1069,7 +1069,7 @@ if (dataFilter_value == 0.0) discard; if (filter_transformColor) { color.a *= dataFilter_value; } -`},VH={name:"data-filter",vs:kk,fs:Ok,inject:Fk,getUniforms:Dk},jH={name:"data-filter-fp64",vs:kk,fs:Ok,inject:Fk,getUniforms:UH},$H=`#version 300 es +`},q7={name:"data-filter",vs:Nk,fs:Bk,inject:zk,getUniforms:Lk},X7={name:"data-filter-fp64",vs:Nk,fs:Bk,inject:zk,getUniforms:W7},Z7=`#version 300 es #define SHADER_NAME data-filter-vertex-shader #ifdef FLOAT_TARGET @@ -1100,7 +1100,7 @@ void main() { #endif gl_PointSize = 1.0; } -`,WH=`#version 300 es +`,Y7=`#version 300 es #define SHADER_NAME data-filter-fragment-shader precision highp float; @@ -1114,149 +1114,149 @@ void main() { } fragColor = vColor; } -`,HH=["float32-renderable-webgl","texture-blend-float-webgl"];function qH(t){return HH.every(e=>t.features.has(e))}function XH(t,e){return e?t.createFramebuffer({width:1,height:1,colorAttachments:[t.createTexture({format:"rgba32float",type:5126,mipmaps:!1})]}):t.createFramebuffer({width:256,height:64,colorAttachments:[t.createTexture({format:"rgba8unorm",type:5126,mipmaps:!1})]})}function ZH(t,e,i){return e.defines.NON_INSTANCED_MODEL=1,i&&(e.defines.FLOAT_TARGET=1),new Sd(t,{id:"data-filter-aggregation-model",vertexCount:1,isInstanced:!1,drawMode:0,vs:$H,fs:WH,...e})}const KH={blend:!0,blendFunc:[1,1,1,1],blendEquation:[32774,32774],depthTest:!1},YH={getFilterValue:{type:"accessor",value:0},getFilterCategory:{type:"accessor",value:0},onFilteredItemsChange:{type:"function",value:null,optional:!0},filterEnabled:!0,filterRange:[-1,1],filterSoftRange:null,filterCategories:[0],filterTransformSize:!0,filterTransformColor:!0},JH={categorySize:0,filterSize:1,fp64:!1,countItems:!1},pC={1:"float",2:"vec2",3:"vec3",4:"vec4"},l0=class l0 extends Vw{constructor(e={}){super({...JH,...e})}getShaders(e){const{categorySize:i,filterSize:s,fp64:n}=e.opts,a={};return i&&(a.DATACATEGORY_TYPE=pC[i],a.DATACATEGORY_CHANNELS=i),s&&(a.DATAFILTER_TYPE=pC[s],a.DATAFILTER_DOUBLE=!!n),{modules:[n?jH:VH],defines:a}}initializeState(e,i){const s=this.getAttributeManager(),{categorySize:n,filterSize:a,fp64:u}=i.opts;s&&(a&&s.add({filterValues:{size:a,type:u?"float64":"float32",stepMode:"dynamic",accessor:"getFilterValue"}}),n&&s.add({filterCategoryValues:{size:n,stepMode:"dynamic",accessor:"getFilterCategory",transform:n===1?_=>i._getCategoryKey.call(this,_,0):_=>_.map((w,S)=>i._getCategoryKey.call(this,w,S))}}));const{device:c}=this.context;if(s&&i.opts.countItems){const _=qH(c);s.add({filterIndices:{size:_?1:2,vertexOffset:1,type:"unorm8",accessor:(C,{index:P})=>{const D=C&&C.__source?C.__source.index:P;return _?(D+1)%255:[(D+1)%255,Math.floor(D/255)%255]},shaderAttributes:{filterPrevIndices:{vertexOffset:0},filterIndices:{vertexOffset:1}}}});const w=XH(c,_),S=ZH(c,i.getShaders.call(this,i),_);this.setState({filterFBO:w,filterModel:S})}}updateState({props:e,oldProps:i,changeFlags:s},n){var c,_;const a=this.getAttributeManager(),{categorySize:u}=n.opts;if(this.state.filterModel){const w=((c=a.attributes.filterValues)==null?void 0:c.needsUpdate())||((_=a.attributes.filterCategoryValues)==null?void 0:_.needsUpdate())||e.filterEnabled!==i.filterEnabled||e.filterRange!==i.filterRange||e.filterSoftRange!==i.filterSoftRange||e.filterCategories!==i.filterCategories;w&&this.setState({filterNeedsUpdate:w})}a!=null&&a.attributes.filterCategoryValues&&((a.attributes.filterCategoryValues.needsUpdate()||!Xr(e.filterCategories,i.filterCategories,2))&&this.setState({categoryBitMask:null}),s.dataChanged&&(this.setState({categoryMap:Array(u).fill(0).map(()=>({}))}),a.attributes.filterCategoryValues.setNeedsUpdate("categoryMap")))}draw(e,i){const s=this.state.filterFBO,n=this.state.filterModel,a=this.state.filterNeedsUpdate,{onFilteredItemsChange:u}=this.props;if(this.state.categoryBitMask||i._updateCategoryBitMask.call(this,e,i),e.uniforms.filter_categoryBitMask=this.state.categoryBitMask,a&&u&&n){const{attributes:{filterValues:c,filterCategoryValues:_,filterIndices:w}}=this.getAttributeManager();n.setVertexCount(this.getNumInstances()),this.context.device.clearWebGL({framebuffer:s,color:[0,0,0,0]}),n.updateModuleSettings(e.moduleParameters),n.setAttributes({...c==null?void 0:c.getValue(),..._==null?void 0:_.getValue(),...w==null?void 0:w.getValue()}),n.setUniforms(e.uniforms),n.device.withParametersWebGL({framebuffer:s,...KH,viewport:[0,0,s.width,s.height]},()=>{n.draw(this.context.renderPass)});const S=n.device.readPixelsToArrayWebGL(s);let C=0;for(let P=0;P!!t&&typeof t=="object"&&t[po]===tT,Fd=t=>!!t&&typeof t=="object"&&t[po]===Ww,Nd=t=>!!t&&typeof t=="object"&&t[po]===Jl,ms=t=>!!t&&typeof t=="object"&&t[po]===Nk,os=t=>!!t&&typeof t=="object"&&t[po]===el,Bd=t=>!!t&&typeof t=="object"&&t[po]===Dd;function bs(t){if(t&&typeof t=="object")switch(t[po]){case Jl:case Dd:return!0}return!1}function Es(t){if(t&&typeof t=="object")switch(t[po]){case tT:case Jl:case el:case Dd:return!0}return!1}const GH=t=>(os(t)||bs(t))&&!!t.anchor,_r=Symbol("break visit"),Bk=Symbol("skip children"),la=Symbol("remove node");function oc(t,e){const i=Lk(e);Fd(t)?Kh(null,t.contents,i,Object.freeze([t]))===la&&(t.contents=null):Kh(null,t,i,Object.freeze([]))}oc.BREAK=_r;oc.SKIP=Bk;oc.REMOVE=la;function Kh(t,e,i,s){const n=zk(t,e,i,s);if(Es(n)||ms(n))return Uk(t,s,n),Kh(t,n,i,s);if(typeof n!="symbol"){if(bs(e)){s=Object.freeze(s.concat(e));for(let a=0;at.replace(/[!,[\]{}]/g,e=>QH[e]);class Qn{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Qn.defaultYaml,e),this.tags=Object.assign({},Qn.defaultTags,i)}clone(){const e=new Qn(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Qn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Qn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Qn.defaultTags);break}return e}add(e,i){this.atNextDocument&&(this.yaml={explicit:Qn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Qn.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(s.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[a,u]=s;return this.tags[a]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const u=/^\d+\.\d+$/.test(a);return i(6,`Unsupported YAML version ${a}`,u),!1}}default:return i(0,`Unknown directive ${n}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const u=e.slice(2,-1);return u==="!"||u==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),u)}const[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||i(`The ${e} tag has no suffix`);const a=this.tags[s];if(a)try{return a+decodeURIComponent(n)}catch(u){return i(String(u)),null}return s==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[i,s]of Object.entries(this.tags))if(e.startsWith(s))return i+eq(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let n;if(e&&s.length>0&&Es(e.contents)){const a={};oc(e.contents,(u,c)=>{Es(c)&&c.tag&&(a[c.tag]=!0)}),n=Object.keys(a)}else n=[];for(const[a,u]of s)a==="!!"&&u==="tag:yaml.org,2002:"||(!e||n.some(c=>c.startsWith(u)))&&i.push(`%TAG ${a} ${u}`);return i.join(` -`)}}Qn.defaultYaml={explicit:!1,version:"1.2"};Qn.defaultTags={"!!":"tag:yaml.org,2002:"};function Vk(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(i)}return!0}function jk(t){const e=new Set;return oc(t,{Value(i,s){s.anchor&&e.add(s.anchor)}}),e}function $k(t,e){for(let i=1;;++i){const s=`${t}${i}`;if(!e.has(s))return s}}function tq(t,e){const i=[],s=new Map;let n=null;return{onAnchor:a=>{i.push(a),n||(n=jk(t));const u=$k(e,n);return n.add(u),u},setAnchors:()=>{for(const a of i){const u=s.get(a);if(typeof u=="object"&&u.anchor&&(os(u.node)||bs(u.node)))u.node.anchor=u.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:s}}function Jh(t,e,i,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let n=0,a=s.length;nho(s,String(n),i));if(t&&typeof t.toJSON=="function"){if(!i||!GH(t))return t.toJSON(e,i);const s={aliasCount:0,count:1,res:void 0};i.anchors.set(t,s),i.onCreate=a=>{s.res=a,delete i.onCreate};const n=t.toJSON(e,i);return i.onCreate&&i.onCreate(n),n}return typeof t=="bigint"&&!(i!=null&&i.keep)?Number(t):t}class iT{constructor(e){Object.defineProperty(this,po,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:s,onAnchor:n,reviver:a}={}){if(!Fd(e))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=ho(this,"",u);if(typeof n=="function")for(const{count:_,res:w}of u.anchors.values())n(w,_);return typeof a=="function"?Jh(a,{"":c},"",c):c}}class O0 extends iT{constructor(e){super(tT),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let i;return oc(e,{Node:(s,n)=>{if(n===this)return oc.BREAK;n.anchor===this.source&&(i=n)}}),i}toJSON(e,i){if(!i)return{source:this.source};const{anchors:s,doc:n,maxAliasCount:a}=i,u=this.resolve(n);if(!u){const _=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(_)}let c=s.get(u);if(c||(ho(u,null,i),c=s.get(u)),!c||c.res===void 0){const _="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(_)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=V_(n,u,s)),c.count*c.aliasCount>a)){const _="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(_)}return c.res}toString(e,i,s){const n=`*${this.source}`;if(e){if(Vk(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}}function V_(t,e,i){if(Du(e)){const s=e.resolve(t),n=i&&s&&i.get(s);return n?n.count*n.aliasCount:0}else if(bs(e)){let s=0;for(const n of e.items){const a=V_(t,n,i);a>s&&(s=a)}return s}else if(ms(e)){const s=V_(t,e.key,i),n=V_(t,e.value,i);return Math.max(s,n)}return 1}const Wk=t=>!t||typeof t!="function"&&typeof t!="object";class ti extends iT{constructor(e){super(el),this.value=e}toJSON(e,i){return i!=null&&i.keep?this.value:ho(this.value,e,i)}toString(){return String(this.value)}}ti.BLOCK_FOLDED="BLOCK_FOLDED";ti.BLOCK_LITERAL="BLOCK_LITERAL";ti.PLAIN="PLAIN";ti.QUOTE_DOUBLE="QUOTE_DOUBLE";ti.QUOTE_SINGLE="QUOTE_SINGLE";const iq="tag:yaml.org,2002:";function sq(t,e,i){if(e){const s=i.filter(a=>a.tag===e),n=s.find(a=>!a.format)??s[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return i.find(s=>{var n;return((n=s.identify)==null?void 0:n.call(s,t))&&!s.format})}function fm(t,e,i){var C,P,D;if(Fd(t)&&(t=t.contents),Es(t))return t;if(ms(t)){const j=(P=(C=i.schema[Jl]).createNode)==null?void 0:P.call(C,i.schema,null,i);return j.items.push(t),j}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:n,onTagObj:a,schema:u,sourceObjects:c}=i;let _;if(s&&t&&typeof t=="object"){if(_=c.get(t),_)return _.anchor||(_.anchor=n(t)),new O0(_.anchor);_={anchor:null,node:null},c.set(t,_)}e!=null&&e.startsWith("!!")&&(e=iq+e.slice(2));let w=sq(t,e,u.tags);if(!w){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const j=new ti(t);return _&&(_.node=j),j}w=t instanceof Map?u[Jl]:Symbol.iterator in Object(t)?u[Dd]:u[Jl]}a&&(a(w),delete i.onTagObj);const S=w!=null&&w.createNode?w.createNode(i.schema,t,i):typeof((D=w==null?void 0:w.nodeClass)==null?void 0:D.from)=="function"?w.nodeClass.from(i.schema,t,i):new ti(t);return e?S.tag=e:w.default||(S.tag=w.tag),_&&(_.node=S),S}function Iy(t,e,i){let s=i;for(let n=e.length-1;n>=0;--n){const a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const u=[];u[a]=s,s=u}else s=new Map([[a,s]])}return fm(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const kp=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class Hk extends iT{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(s=>Es(s)||ms(s)?s.clone(e):s),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(kp(e))this.add(i);else{const[s,...n]=e,a=this.get(s,!0);if(bs(a))a.addIn(n,i);else if(a===void 0&&this.schema)this.set(s,Iy(this.schema,n,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){const[i,...s]=e;if(s.length===0)return this.delete(i);const n=this.get(i,!0);if(bs(n))return n.deleteIn(s);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}getIn(e,i){const[s,...n]=e,a=this.get(s,!0);return n.length===0?!i&&os(a)?a.value:a:bs(a)?a.getIn(n,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!ms(i))return!1;const s=i.value;return s==null||e&&os(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[i,...s]=e;if(s.length===0)return this.has(i);const n=this.get(i,!0);return bs(n)?n.hasIn(s):!1}setIn(e,i){const[s,...n]=e;if(n.length===0)this.set(s,i);else{const a=this.get(s,!0);if(bs(a))a.setIn(n,i);else if(a===void 0&&this.schema)this.set(s,Iy(this.schema,n,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}const nq=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Za(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const hu=(t,e,i)=>t.endsWith(` -`)?Za(i,e):i.includes(` +`,K7=["float32-renderable-webgl","texture-blend-float-webgl"];function J7(t){return K7.every(e=>t.features.has(e))}function G7(t,e){return e?t.createFramebuffer({width:1,height:1,colorAttachments:[t.createTexture({format:"rgba32float",type:5126,mipmaps:!1})]}):t.createFramebuffer({width:256,height:64,colorAttachments:[t.createTexture({format:"rgba8unorm",type:5126,mipmaps:!1})]})}function Q7(t,e,i){return e.defines.NON_INSTANCED_MODEL=1,i&&(e.defines.FLOAT_TARGET=1),new $f(t,{id:"data-filter-aggregation-model",vertexCount:1,isInstanced:!1,drawMode:0,vs:Z7,fs:Y7,...e})}const eq={blend:!0,blendFunc:[1,1,1,1],blendEquation:[32774,32774],depthTest:!1},tq={getFilterValue:{type:"accessor",value:0},getFilterCategory:{type:"accessor",value:0},onFilteredItemsChange:{type:"function",value:null,optional:!0},filterEnabled:!0,filterRange:[-1,1],filterSoftRange:null,filterCategories:[0],filterTransformSize:!0,filterTransformColor:!0},iq={categorySize:0,filterSize:1,fp64:!1,countItems:!1},dC={1:"float",2:"vec2",3:"vec3",4:"vec4"};class oT extends sT{constructor(e={}){super({...iq,...e})}getShaders(e){const{categorySize:i,filterSize:s,fp64:n}=e.opts,a={};return i&&(a.DATACATEGORY_TYPE=dC[i],a.DATACATEGORY_CHANNELS=i),s&&(a.DATAFILTER_TYPE=dC[s],a.DATAFILTER_DOUBLE=!!n),{modules:[n?X7:q7],defines:a}}initializeState(e,i){const s=this.getAttributeManager(),{categorySize:n,filterSize:a,fp64:u}=i.opts;s&&(a&&s.add({filterValues:{size:a,type:u?"float64":"float32",stepMode:"dynamic",accessor:"getFilterValue"}}),n&&s.add({filterCategoryValues:{size:n,stepMode:"dynamic",accessor:"getFilterCategory",transform:n===1?_=>i._getCategoryKey.call(this,_,0):_=>_.map((w,S)=>i._getCategoryKey.call(this,w,S))}}));const{device:c}=this.context;if(s&&i.opts.countItems){const _=J7(c);s.add({filterIndices:{size:_?1:2,vertexOffset:1,type:"unorm8",accessor:(A,{index:P})=>{const D=A&&A.__source?A.__source.index:P;return _?(D+1)%255:[(D+1)%255,Math.floor(D/255)%255]},shaderAttributes:{filterPrevIndices:{vertexOffset:0},filterIndices:{vertexOffset:1}}}});const w=G7(c,_),S=Q7(c,i.getShaders.call(this,i),_);this.setState({filterFBO:w,filterModel:S})}}updateState({props:e,oldProps:i,changeFlags:s},n){var c,_;const a=this.getAttributeManager(),{categorySize:u}=n.opts;if(this.state.filterModel){const w=((c=a.attributes.filterValues)==null?void 0:c.needsUpdate())||((_=a.attributes.filterCategoryValues)==null?void 0:_.needsUpdate())||e.filterEnabled!==i.filterEnabled||e.filterRange!==i.filterRange||e.filterSoftRange!==i.filterSoftRange||e.filterCategories!==i.filterCategories;w&&this.setState({filterNeedsUpdate:w})}a!=null&&a.attributes.filterCategoryValues&&((a.attributes.filterCategoryValues.needsUpdate()||!Kr(e.filterCategories,i.filterCategories,2))&&this.setState({categoryBitMask:null}),s.dataChanged&&(this.setState({categoryMap:Array(u).fill(0).map(()=>({}))}),a.attributes.filterCategoryValues.setNeedsUpdate("categoryMap")))}draw(e,i){const s=this.state.filterFBO,n=this.state.filterModel,a=this.state.filterNeedsUpdate,{onFilteredItemsChange:u}=this.props;if(this.state.categoryBitMask||i._updateCategoryBitMask.call(this,e,i),e.uniforms.filter_categoryBitMask=this.state.categoryBitMask,a&&u&&n){const{attributes:{filterValues:c,filterCategoryValues:_,filterIndices:w}}=this.getAttributeManager();n.setVertexCount(this.getNumInstances()),this.context.device.clearWebGL({framebuffer:s,color:[0,0,0,0]}),n.updateModuleSettings(e.moduleParameters),n.setAttributes({...c==null?void 0:c.getValue(),..._==null?void 0:_.getValue(),...w==null?void 0:w.getValue()}),n.setUniforms(e.uniforms),n.device.withParametersWebGL({framebuffer:s,...eq,viewport:[0,0,s.width,s.height]},()=>{n.draw(this.context.renderPass)});const S=n.device.readPixelsToArrayWebGL(s);let A=0;for(let P=0;P!!t&&typeof t=="object"&&t[bo]===aT,qu=t=>!!t&&typeof t=="object"&&t[bo]===Zw,ed=t=>!!t&&typeof t=="object"&&t[bo]===ac,ms=t=>!!t&&typeof t=="object"&&t[bo]===Uk,Ji=t=>!!t&&typeof t=="object"&&t[bo]===ya,td=t=>!!t&&typeof t=="object"&&t[bo]===Qf;function vs(t){if(t&&typeof t=="object")switch(t[bo]){case ac:case Qf:return!0}return!1}function xs(t){if(t&&typeof t=="object")switch(t[bo]){case aT:case ac:case ya:case Qf:return!0}return!1}const sq=t=>(Ji(t)||vs(t))&&!!t.anchor,Er=Symbol("break visit"),Vk=Symbol("skip children"),pa=Symbol("remove node");function gc(t,e){const i=jk(e);qu(t)?pf(null,t.contents,i,Object.freeze([t]))===pa&&(t.contents=null):pf(null,t,i,Object.freeze([]))}gc.BREAK=Er;gc.SKIP=Vk;gc.REMOVE=pa;function pf(t,e,i,s){const n=$k(t,e,i,s);if(xs(n)||ms(n))return Hk(t,s,n),pf(t,n,i,s);if(typeof n!="symbol"){if(vs(e)){s=Object.freeze(s.concat(e));for(let a=0;at.replace(/[!,[\]{}]/g,e=>nq[e]);class ir{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ir.defaultYaml,e),this.tags=Object.assign({},ir.defaultTags,i)}clone(){const e=new ir(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ir(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ir.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ir.defaultTags);break}return e}add(e,i){this.atNextDocument&&(this.yaml={explicit:ir.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ir.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(s.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[a,u]=s;return this.tags[a]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const u=/^\d+\.\d+$/.test(a);return i(6,`Unsupported YAML version ${a}`,u),!1}}default:return i(0,`Unknown directive ${n}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const u=e.slice(2,-1);return u==="!"||u==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),u)}const[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||i(`The ${e} tag has no suffix`);const a=this.tags[s];if(a)try{return a+decodeURIComponent(n)}catch(u){return i(String(u)),null}return s==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[i,s]of Object.entries(this.tags))if(e.startsWith(s))return i+rq(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let n;if(e&&s.length>0&&xs(e.contents)){const a={};gc(e.contents,(u,c)=>{xs(c)&&c.tag&&(a[c.tag]=!0)}),n=Object.keys(a)}else n=[];for(const[a,u]of s)a==="!!"&&u==="tag:yaml.org,2002:"||(!e||n.some(c=>c.startsWith(u)))&&i.push(`%TAG ${a} ${u}`);return i.join(` +`)}}ir.defaultYaml={explicit:!1,version:"1.2"};ir.defaultTags={"!!":"tag:yaml.org,2002:"};function Wk(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(i)}return!0}function qk(t){const e=new Set;return gc(t,{Value(i,s){s.anchor&&e.add(s.anchor)}}),e}function Xk(t,e){for(let i=1;;++i){const s=`${t}${i}`;if(!e.has(s))return s}}function oq(t,e){const i=[],s=new Map;let n=null;return{onAnchor:a=>{i.push(a),n||(n=qk(t));const u=Xk(e,n);return n.add(u),u},setAnchors:()=>{for(const a of i){const u=s.get(a);if(typeof u=="object"&&u.anchor&&(Ji(u.node)||vs(u.node)))u.node.anchor=u.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:s}}function mf(t,e,i,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let n=0,a=s.length;nyo(s,String(n),i));if(t&&typeof t.toJSON=="function"){if(!i||!sq(t))return t.toJSON(e,i);const s={aliasCount:0,count:1,res:void 0};i.anchors.set(t,s),i.onCreate=a=>{s.res=a,delete i.onCreate};const n=t.toJSON(e,i);return i.onCreate&&i.onCreate(n),n}return typeof t=="bigint"&&!(i!=null&&i.keep)?Number(t):t}class lT{constructor(e){Object.defineProperty(this,bo,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:s,onAnchor:n,reviver:a}={}){if(!qu(e))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=yo(this,"",u);if(typeof n=="function")for(const{count:_,res:w}of u.anchors.values())n(w,_);return typeof a=="function"?mf(a,{"":c},"",c):c}}class M0 extends lT{constructor(e){super(aT),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let i;return gc(e,{Node:(s,n)=>{if(n===this)return gc.BREAK;n.anchor===this.source&&(i=n)}}),i}toJSON(e,i){if(!i)return{source:this.source};const{anchors:s,doc:n,maxAliasCount:a}=i,u=this.resolve(n);if(!u){const _=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(_)}let c=s.get(u);if(c||(yo(u,null,i),c=s.get(u)),!c||c.res===void 0){const _="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(_)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=X_(n,u,s)),c.count*c.aliasCount>a)){const _="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(_)}return c.res}toString(e,i,s){const n=`*${this.source}`;if(e){if(Wk(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}}function X_(t,e,i){if(Wu(e)){const s=e.resolve(t),n=i&&s&&i.get(s);return n?n.count*n.aliasCount:0}else if(vs(e)){let s=0;for(const n of e.items){const a=X_(t,n,i);a>s&&(s=a)}return s}else if(ms(e)){const s=X_(t,e.key,i),n=X_(t,e.value,i);return Math.max(s,n)}return 1}const Zk=t=>!t||typeof t!="function"&&typeof t!="object";class ti extends lT{constructor(e){super(ya),this.value=e}toJSON(e,i){return i!=null&&i.keep?this.value:yo(this.value,e,i)}toString(){return String(this.value)}}ti.BLOCK_FOLDED="BLOCK_FOLDED";ti.BLOCK_LITERAL="BLOCK_LITERAL";ti.PLAIN="PLAIN";ti.QUOTE_DOUBLE="QUOTE_DOUBLE";ti.QUOTE_SINGLE="QUOTE_SINGLE";const aq="tag:yaml.org,2002:";function lq(t,e,i){if(e){const s=i.filter(a=>a.tag===e),n=s.find(a=>!a.format)??s[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return i.find(s=>{var n;return((n=s.identify)==null?void 0:n.call(s,t))&&!s.format})}function wg(t,e,i){var A,P,D;if(qu(t)&&(t=t.contents),xs(t))return t;if(ms(t)){const U=(P=(A=i.schema[ac]).createNode)==null?void 0:P.call(A,i.schema,null,i);return U.items.push(t),U}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:n,onTagObj:a,schema:u,sourceObjects:c}=i;let _;if(s&&t&&typeof t=="object"){if(_=c.get(t),_)return _.anchor||(_.anchor=n(t)),new M0(_.anchor);_={anchor:null,node:null},c.set(t,_)}e!=null&&e.startsWith("!!")&&(e=aq+e.slice(2));let w=lq(t,e,u.tags);if(!w){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const U=new ti(t);return _&&(_.node=U),U}w=t instanceof Map?u[ac]:Symbol.iterator in Object(t)?u[Qf]:u[ac]}a&&(a(w),delete i.onTagObj);const S=w!=null&&w.createNode?w.createNode(i.schema,t,i):typeof((D=w==null?void 0:w.nodeClass)==null?void 0:D.from)=="function"?w.nodeClass.from(i.schema,t,i):new ti(t);return e?S.tag=e:w.default||(S.tag=w.tag),_&&(_.node=S),S}function Ry(t,e,i){let s=i;for(let n=e.length-1;n>=0;--n){const a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const u=[];u[a]=s,s=u}else s=new Map([[a,s]])}return wg(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Vp=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class Yk extends lT{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(s=>xs(s)||ms(s)?s.clone(e):s),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(Vp(e))this.add(i);else{const[s,...n]=e,a=this.get(s,!0);if(vs(a))a.addIn(n,i);else if(a===void 0&&this.schema)this.set(s,Ry(this.schema,n,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){const[i,...s]=e;if(s.length===0)return this.delete(i);const n=this.get(i,!0);if(vs(n))return n.deleteIn(s);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}getIn(e,i){const[s,...n]=e,a=this.get(s,!0);return n.length===0?!i&&Ji(a)?a.value:a:vs(a)?a.getIn(n,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!ms(i))return!1;const s=i.value;return s==null||e&&Ji(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[i,...s]=e;if(s.length===0)return this.has(i);const n=this.get(i,!0);return vs(n)?n.hasIn(s):!1}setIn(e,i){const[s,...n]=e;if(n.length===0)this.set(s,i);else{const a=this.get(s,!0);if(vs(a))a.setIn(n,i);else if(a===void 0&&this.schema)this.set(s,Ry(this.schema,n,i));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}const cq=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Ga(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const xu=(t,e,i)=>t.endsWith(` +`)?Ga(i,e):i.includes(` `)?` -`+Za(i,e):(t.endsWith(" ")?"":" ")+i,qk="flow",Hw="block",j_="quoted";function D0(t,e,i="flow",{indentAtStart:s,lineWidth:n=80,minContentWidth:a=20,onFold:u,onOverflow:c}={}){if(!n||n<0)return t;nn-Math.max(2,a)?w.push(0):C=n-s);let P,D,j=!1,L=-1,H=-1,te=-1;i===Hw&&(L=mC(t,L,e.length),L!==-1&&(C=L+_));for(let se;se=t[L+=1];){if(i===j_&&se==="\\"){switch(H=L,t[L+1]){case"x":L+=3;break;case"u":L+=5;break;case"U":L+=9;break;default:L+=1}te=L}if(se===` -`)i===Hw&&(L=mC(t,L,e.length)),C=L+e.length+_,P=void 0;else{if(se===" "&&D&&D!==" "&&D!==` -`&&D!==" "){const ve=t[L+1];ve&&ve!==" "&&ve!==` -`&&ve!==" "&&(P=L)}if(L>=C)if(P)w.push(P),C=P+_,P=void 0;else if(i===j_){for(;D===" "||D===" ";)D=se,se=t[L+=1],j=!0;const ve=L>te+1?L-2:H-1;if(S[ve])return t;w.push(ve),S[ve]=!0,C=ve+_,P=void 0}else j=!0}D=se}if(j&&c&&c(),w.length===0)return t;u&&u();let G=t.slice(0,w[0]);for(let se=0;se({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),N0=t=>/^(%|---|\.\.\.)/m.test(t);function rq(t,e,i){if(!e||e<0)return!1;const s=e-i,n=t.length;if(n<=s)return!1;for(let a=0,u=0;as)return!0;if(u=a+1,n-u<=s)return!1}return!0}function Hp(t,e){const i=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return i;const{implicitKey:s}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(N0(t)?" ":"");let u="",c=0;for(let _=0,w=i[_];w;w=i[++_])if(w===" "&&i[_+1]==="\\"&&i[_+2]==="n"&&(u+=i.slice(c,_)+"\\ ",_+=1,c=_,w="\\"),w==="\\")switch(i[_+1]){case"u":{u+=i.slice(c,_);const S=i.substr(_+2,4);switch(S){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:S.substr(0,2)==="00"?u+="\\x"+S.substr(2):u+=i.substr(_,6)}_+=5,c=_+1}break;case"n":if(s||i[_+2]==='"'||i.lengthn-Math.max(2,a)?w.push(0):A=n-s);let P,D,U=!1,L=-1,W=-1,ee=-1;i===Yw&&(L=pC(t,L,e.length),L!==-1&&(A=L+_));for(let se;se=t[L+=1];){if(i===Z_&&se==="\\"){switch(W=L,t[L+1]){case"x":L+=3;break;case"u":L+=5;break;case"U":L+=9;break;default:L+=1}ee=L}if(se===` +`)i===Yw&&(L=pC(t,L,e.length)),A=L+e.length+_,P=void 0;else{if(se===" "&&D&&D!==" "&&D!==` +`&&D!==" "){const fe=t[L+1];fe&&fe!==" "&&fe!==` +`&&fe!==" "&&(P=L)}if(L>=A)if(P)w.push(P),A=P+_,P=void 0;else if(i===Z_){for(;D===" "||D===" ";)D=se,se=t[L+=1],U=!0;const fe=L>ee+1?L-2:W-1;if(S[fe])return t;w.push(fe),S[fe]=!0,A=fe+_,P=void 0}else U=!0}D=se}if(U&&c&&c(),w.length===0)return t;u&&u();let G=t.slice(0,w[0]);for(let se=0;se({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),O0=t=>/^(%|---|\.\.\.)/m.test(t);function uq(t,e,i){if(!e||e<0)return!1;const s=e-i,n=t.length;if(n<=s)return!1;for(let a=0,u=0;as)return!0;if(u=a+1,n-u<=s)return!1}return!0}function Qp(t,e){const i=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return i;const{implicitKey:s}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(O0(t)?" ":"");let u="",c=0;for(let _=0,w=i[_];w;w=i[++_])if(w===" "&&i[_+1]==="\\"&&i[_+2]==="n"&&(u+=i.slice(c,_)+"\\ ",_+=1,c=_,w="\\"),w==="\\")switch(i[_+1]){case"u":{u+=i.slice(c,_);const S=i.substr(_+2,4);switch(S){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:S.substr(0,2)==="00"?u+="\\x"+S.substr(2):u+=i.substr(_,6)}_+=5,c=_+1}break;case"n":if(s||i[_+2]==='"'||i.length -`;let C,P;for(P=i.length;P>0;--P){const ge=i[P-1];if(ge!==` -`&&ge!==" "&&ge!==" ")break}let D=i.substring(P);const j=D.indexOf(` -`);j===-1?C="-":i===D||j!==D.length-1?(C="+",a&&a()):C="",D&&(i=i.slice(0,-D.length),D[D.length-1]===` -`&&(D=D.slice(0,-1)),D=D.replace(Xw,`$&${w}`));let L=!1,H,te=-1;for(H=0;H")+(L?w?"2":"1":"")+C;if(t&&(ve+=" "+c(t.replace(/ ?[\r\n]+/g," ")),n&&n()),S)return i=i.replace(/\n+/g,`$&${w}`),`${ve} +`;let A,P;for(P=i.length;P>0;--P){const Te=i[P-1];if(Te!==` +`&&Te!==" "&&Te!==" ")break}let D=i.substring(P);const U=D.indexOf(` +`);U===-1?A="-":i===D||U!==D.length-1?(A="+",a&&a()):A="",D&&(i=i.slice(0,-D.length),D[D.length-1]===` +`&&(D=D.slice(0,-1)),D=D.replace(Jw,`$&${w}`));let L=!1,W,ee=-1;for(W=0;W")+(L?w?"2":"1":"")+A;if(t&&(fe+=" "+c(t.replace(/ ?[\r\n]+/g," ")),n&&n()),S)return i=i.replace(/\n+/g,`$&${w}`),`${fe} ${w}${G}${i}${D}`;i=i.replace(/\n+/g,` -$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${w}`);const Se=D0(`${G}${i}${D}`,w,Hw,F0(s,!0));return`${ve} -${w}${Se}`}function oq(t,e,i,s){const{type:n,value:a}=t,{actualString:u,implicitKey:c,indent:_,indentStep:w,inFlow:S}=e;if(c&&a.includes(` -`)||S&&/[[\]{},]/.test(a))return Gh(a,e);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||S||!a.includes(` -`)?Gh(a,e):$_(t,e,i,s);if(!c&&!S&&n!==ti.PLAIN&&a.includes(` -`))return $_(t,e,i,s);if(N0(a)){if(_==="")return e.forceBlockIndent=!0,$_(t,e,i,s);if(c&&_===w)return Gh(a,e)}const C=a.replace(/\n+/g,`$& -${_}`);if(u){const P=L=>{var H;return L.default&&L.tag!=="tag:yaml.org,2002:str"&&((H=L.test)==null?void 0:H.test(C))},{compat:D,tags:j}=e.doc.schema;if(j.some(P)||D!=null&&D.some(P))return Gh(a,e)}return c?C:D0(C,_,qk,F0(e,!1))}function Dm(t,e,i,s){const{implicitKey:n,inFlow:a}=e,u=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:c}=t;c!==ti.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(c=ti.QUOTE_DOUBLE);const _=S=>{switch(S){case ti.BLOCK_FOLDED:case ti.BLOCK_LITERAL:return n||a?Gh(u.value,e):$_(u,e,i,s);case ti.QUOTE_DOUBLE:return Hp(u.value,e);case ti.QUOTE_SINGLE:return qw(u.value,e);case ti.PLAIN:return oq(u,e,i,s);default:return null}};let w=_(c);if(w===null){const{defaultKeyType:S,defaultStringType:C}=e.options,P=n&&S||C;if(w=_(P),w===null)throw new Error(`Unsupported default string type ${P}`)}return w}function Xk(t,e){const i=Object.assign({blockQuote:!0,commentString:nq,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(i.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:s,options:i}}function aq(t,e){var n;if(e.tag){const a=t.filter(u=>u.tag===e.tag);if(a.length>0)return a.find(u=>u.format===e.format)??a[0]}let i,s;if(os(e)){s=e.value;const a=t.filter(u=>{var c;return(c=u.identify)==null?void 0:c.call(u,s)});i=a.find(u=>u.format===e.format)??a.find(u=>!u.format)}else s=e,i=t.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!i){const a=((n=s==null?void 0:s.constructor)==null?void 0:n.name)??typeof s;throw new Error(`Tag not resolved for ${a} value`)}return i}function lq(t,e,{anchors:i,doc:s}){if(!s.directives)return"";const n=[],a=(os(t)||bs(t))&&t.anchor;a&&Vk(a)&&(i.add(a),n.push(`&${a}`));const u=t.tag?t.tag:e.default?null:e.tag;return u&&n.push(s.directives.tagString(u)),n.join(" ")}function Ed(t,e,i,s){var _;if(ms(t))return t.toString(e,i,s);if(Du(t)){if(e.doc.directives)return t.toString(e);if((_=e.resolvedAliases)!=null&&_.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n;const a=Es(t)?t:e.doc.createNode(t,{onTagObj:w=>n=w});n||(n=aq(e.doc.schema.tags,a));const u=lq(a,n,e);u.length>0&&(e.indentAtStart=(e.indentAtStart??0)+u.length+1);const c=typeof n.stringify=="function"?n.stringify(a,e,i,s):os(a)?Dm(a,e,i,s):a.toString(e,i,s);return u?os(a)||c[0]==="{"||c[0]==="["?`${u} ${c}`:`${u} -${e.indent}${c}`:c}function cq({key:t,value:e},i,s,n){const{allNullValues:a,doc:u,indent:c,indentStep:_,options:{commentString:w,indentSeq:S,simpleKeys:C}}=i;let P=Es(t)&&t.comment||null;if(C){if(P)throw new Error("With simple keys, key nodes cannot have comments");if(bs(t)||!Es(t)&&typeof t=="object"){const De="With simple keys, collection cannot be used as a key value";throw new Error(De)}}let D=!C&&(!t||P&&e==null&&!i.inFlow||bs(t)||(os(t)?t.type===ti.BLOCK_FOLDED||t.type===ti.BLOCK_LITERAL:typeof t=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!D&&(C||!a),indent:c+_});let j=!1,L=!1,H=Ed(t,i,()=>j=!0,()=>L=!0);if(!D&&!i.inFlow&&H.length>1024){if(C)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(i.inFlow){if(a||e==null)return j&&s&&s(),H===""?"?":D?`? ${H}`:H}else if(a&&!C||e==null&&D)return H=`? ${H}`,P&&!j?H+=hu(H,i.indent,w(P)):L&&n&&n(),H;j&&(P=null),D?(P&&(H+=hu(H,i.indent,w(P))),H=`? ${H} -${c}:`):(H=`${H}:`,P&&(H+=hu(H,i.indent,w(P))));let te,G,se;Es(e)?(te=!!e.spaceBefore,G=e.commentBefore,se=e.comment):(te=!1,G=null,se=null,e&&typeof e=="object"&&(e=u.createNode(e))),i.implicitKey=!1,!D&&!P&&os(e)&&(i.indentAtStart=H.length+1),L=!1,!S&&_.length>=2&&!i.inFlow&&!D&&Bd(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let ve=!1;const Se=Ed(e,i,()=>ve=!0,()=>L=!0);let ge=" ";if(P||te||G){if(ge=te?` -`:"",G){const De=w(G);ge+=` -${Za(De,i.indent)}`}Se===""&&!i.inFlow?ge===` -`&&(ge=` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${w}`);const Se=R0(`${G}${i}${D}`,w,Yw,k0(s,!0));return`${fe} +${w}${Se}`}function hq(t,e,i,s){const{type:n,value:a}=t,{actualString:u,implicitKey:c,indent:_,indentStep:w,inFlow:S}=e;if(c&&a.includes(` +`)||S&&/[[\]{},]/.test(a))return _f(a,e);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||S||!a.includes(` +`)?_f(a,e):Y_(t,e,i,s);if(!c&&!S&&n!==ti.PLAIN&&a.includes(` +`))return Y_(t,e,i,s);if(O0(a)){if(_==="")return e.forceBlockIndent=!0,Y_(t,e,i,s);if(c&&_===w)return _f(a,e)}const A=a.replace(/\n+/g,`$& +${_}`);if(u){const P=L=>{var W;return L.default&&L.tag!=="tag:yaml.org,2002:str"&&((W=L.test)==null?void 0:W.test(A))},{compat:D,tags:U}=e.doc.schema;if(U.some(P)||D!=null&&D.some(P))return _f(a,e)}return c?A:R0(A,_,Kk,k0(e,!1))}function Wg(t,e,i,s){const{implicitKey:n,inFlow:a}=e,u=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:c}=t;c!==ti.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(c=ti.QUOTE_DOUBLE);const _=S=>{switch(S){case ti.BLOCK_FOLDED:case ti.BLOCK_LITERAL:return n||a?_f(u.value,e):Y_(u,e,i,s);case ti.QUOTE_DOUBLE:return Qp(u.value,e);case ti.QUOTE_SINGLE:return Kw(u.value,e);case ti.PLAIN:return hq(u,e,i,s);default:return null}};let w=_(c);if(w===null){const{defaultKeyType:S,defaultStringType:A}=e.options,P=n&&S||A;if(w=_(P),w===null)throw new Error(`Unsupported default string type ${P}`)}return w}function Jk(t,e){const i=Object.assign({blockQuote:!0,commentString:cq,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(i.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:s,options:i}}function fq(t,e){var n;if(e.tag){const a=t.filter(u=>u.tag===e.tag);if(a.length>0)return a.find(u=>u.format===e.format)??a[0]}let i,s;if(Ji(e)){s=e.value;let a=t.filter(u=>{var c;return(c=u.identify)==null?void 0:c.call(u,s)});if(a.length>1){const u=a.filter(c=>c.test);u.length>0&&(a=u)}i=a.find(u=>u.format===e.format)??a.find(u=>!u.format)}else s=e,i=t.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!i){const a=((n=s==null?void 0:s.constructor)==null?void 0:n.name)??typeof s;throw new Error(`Tag not resolved for ${a} value`)}return i}function dq(t,e,{anchors:i,doc:s}){if(!s.directives)return"";const n=[],a=(Ji(t)||vs(t))&&t.anchor;a&&Wk(a)&&(i.add(a),n.push(`&${a}`));const u=t.tag?t.tag:e.default?null:e.tag;return u&&n.push(s.directives.tagString(u)),n.join(" ")}function Hf(t,e,i,s){var _;if(ms(t))return t.toString(e,i,s);if(Wu(t)){if(e.doc.directives)return t.toString(e);if((_=e.resolvedAliases)!=null&&_.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n;const a=xs(t)?t:e.doc.createNode(t,{onTagObj:w=>n=w});n||(n=fq(e.doc.schema.tags,a));const u=dq(a,n,e);u.length>0&&(e.indentAtStart=(e.indentAtStart??0)+u.length+1);const c=typeof n.stringify=="function"?n.stringify(a,e,i,s):Ji(a)?Wg(a,e,i,s):a.toString(e,i,s);return u?Ji(a)||c[0]==="{"||c[0]==="["?`${u} ${c}`:`${u} +${e.indent}${c}`:c}function pq({key:t,value:e},i,s,n){const{allNullValues:a,doc:u,indent:c,indentStep:_,options:{commentString:w,indentSeq:S,simpleKeys:A}}=i;let P=xs(t)&&t.comment||null;if(A){if(P)throw new Error("With simple keys, key nodes cannot have comments");if(vs(t)||!xs(t)&&typeof t=="object"){const Fe="With simple keys, collection cannot be used as a key value";throw new Error(Fe)}}let D=!A&&(!t||P&&e==null&&!i.inFlow||vs(t)||(Ji(t)?t.type===ti.BLOCK_FOLDED||t.type===ti.BLOCK_LITERAL:typeof t=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!D&&(A||!a),indent:c+_});let U=!1,L=!1,W=Hf(t,i,()=>U=!0,()=>L=!0);if(!D&&!i.inFlow&&W.length>1024){if(A)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(i.inFlow){if(a||e==null)return U&&s&&s(),W===""?"?":D?`? ${W}`:W}else if(a&&!A||e==null&&D)return W=`? ${W}`,P&&!U?W+=xu(W,i.indent,w(P)):L&&n&&n(),W;U&&(P=null),D?(P&&(W+=xu(W,i.indent,w(P))),W=`? ${W} +${c}:`):(W=`${W}:`,P&&(W+=xu(W,i.indent,w(P))));let ee,G,se;xs(e)?(ee=!!e.spaceBefore,G=e.commentBefore,se=e.comment):(ee=!1,G=null,se=null,e&&typeof e=="object"&&(e=u.createNode(e))),i.implicitKey=!1,!D&&!P&&Ji(e)&&(i.indentAtStart=W.length+1),L=!1,!S&&_.length>=2&&!i.inFlow&&!D&&td(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let fe=!1;const Se=Hf(e,i,()=>fe=!0,()=>L=!0);let Te=" ";if(P||ee||G){if(Te=ee?` +`:"",G){const Fe=w(G);Te+=` +${Ga(Fe,i.indent)}`}Se===""&&!i.inFlow?Te===` +`&&(Te=` -`):ge+=` -${i.indent}`}else if(!D&&bs(e)){const De=Se[0],Fe=Se.indexOf(` -`),Be=Fe!==-1,Qe=i.inFlow??e.flow??e.items.length===0;if(Be||!Qe){let He=!1;if(Be&&(De==="&"||De==="!")){let Xe=Se.indexOf(" ");De==="&"&&Xe!==-1&&Xet===gC||os(t)&&t.value===gC&&(!t.type||t.type===ti.PLAIN);function Sx(t,e,i){const s=t&&Du(i)?i.resolve(t.doc):i;if(!Nd(s))throw new Error("Merge sources must be maps or map aliases");const n=s.toJSON(null,t,Map);for(const[a,u]of n)e instanceof Map?e.has(a)||e.set(a,u):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:u,writable:!0,enumerable:!0,configurable:!0});return e}function hq(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(Es(t)&&(i!=null&&i.doc)){const s=Xk(i.doc,{});s.anchors=new Set;for(const a of i.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const n=t.toString(s);if(!i.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Zk(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return n}return JSON.stringify(e)}function sT(t,e,i){const s=fm(t,void 0,i),n=fm(e,void 0,i);return new Ln(s,n)}class Ln{constructor(e,i=null){Object.defineProperty(this,po,{value:Nk}),this.key=e,this.value=i}clone(e){let{key:i,value:s}=this;return Es(i)&&(i=i.clone(e)),Es(s)&&(s=s.clone(e)),new Ln(i,s)}toJSON(e,i){const s=i!=null&&i.mapAsMap?new Map:{};return Kk(i,s,this)}toString(e,i,s){return e!=null&&e.doc?cq(this,e,i,s):JSON.stringify(this)}}function Yk(t,e,i){return(e.inFlow??t.flow?fq:dq)(t,e,i)}function dq({comment:t,items:e},i,{blockItemPrefix:s,flowChars:n,itemIndent:a,onChompKeep:u,onComment:c}){const{indent:_,options:{commentString:w}}=i,S=Object.assign({},i,{indent:a,type:null});let C=!1;const P=[];for(let j=0;jH=null,()=>C=!0);H&&(te+=hu(te,a,w(H))),C&&H&&(C=!1),P.push(s+te)}let D;if(P.length===0)D=n.start+n.end;else{D=P[0];for(let j=1;jt===P_||typeof t=="symbol"&&t.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ti(Symbol(P_)),{addToJSMap:Qk}),stringify:()=>P_},gq=(t,e)=>(el.identify(e)||Ji(e)&&(!e.type||e.type===ti.PLAIN)&&el.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(i=>i.tag===el.tag&&i.default));function Qk(t,e,i){if(i=t&&Wu(i)?i.resolve(t.doc):i,td(i))for(const s of i.items)kx(t,e,s);else if(Array.isArray(i))for(const s of i)kx(t,e,s);else kx(t,e,i)}function kx(t,e,i){const s=t&&Wu(i)?i.resolve(t.doc):i;if(!ed(s))throw new Error("Merge sources must be maps or map aliases");const n=s.toJSON(null,t,Map);for(const[a,u]of n)e instanceof Map?e.has(a)||e.set(a,u):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:u,writable:!0,enumerable:!0,configurable:!0});return e}function e3(t,e,{key:i,value:s}){if(xs(i)&&i.addToJSMap)i.addToJSMap(t,e,s);else if(gq(t,i))Qk(t,e,s);else{const n=yo(i,"",t);if(e instanceof Map)e.set(n,yo(s,n,t));else if(e instanceof Set)e.add(n);else{const a=mq(i,n,t),u=yo(s,a,t);a in e?Object.defineProperty(e,a,{value:u,writable:!0,enumerable:!0,configurable:!0}):e[a]=u}}return e}function mq(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(xs(t)&&(i!=null&&i.doc)){const s=Jk(i.doc,{});s.anchors=new Set;for(const a of i.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const n=t.toString(s);if(!i.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Gk(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return n}return JSON.stringify(e)}function cT(t,e,i){const s=wg(t,void 0,i),n=wg(e,void 0,i);return new jn(s,n)}class jn{constructor(e,i=null){Object.defineProperty(this,bo,{value:Uk}),this.key=e,this.value=i}clone(e){let{key:i,value:s}=this;return xs(i)&&(i=i.clone(e)),xs(s)&&(s=s.clone(e)),new jn(i,s)}toJSON(e,i){const s=i!=null&&i.mapAsMap?new Map:{};return e3(i,s,this)}toString(e,i,s){return e!=null&&e.doc?pq(this,e,i,s):JSON.stringify(this)}}function t3(t,e,i){return(e.inFlow??t.flow?yq:_q)(t,e,i)}function _q({comment:t,items:e},i,{blockItemPrefix:s,flowChars:n,itemIndent:a,onChompKeep:u,onComment:c}){const{indent:_,options:{commentString:w}}=i,S=Object.assign({},i,{indent:a,type:null});let A=!1;const P=[];for(let U=0;UW=null,()=>A=!0);W&&(ee+=xu(ee,a,w(W))),A&&W&&(A=!1),P.push(s+ee)}let D;if(P.length===0)D=n.start+n.end;else{D=P[0];for(let U=1;UH=null);jS||te.includes(` -`))&&(w=!0),C.push(te),S=C.length}const{start:P,end:D}=i;if(C.length===0)return P+D;if(!w){const j=C.reduce((L,H)=>L+H.length+2,2);w=e.options.lineWidth>0&&j>e.options.lineWidth}if(w){let j=P;for(const L of C)j+=L?` +`+Ga(w(t),_),c&&c()):A&&u&&u(),D}function yq({items:t},e,{flowChars:i,itemIndent:s}){const{indent:n,indentStep:a,flowCollectionPadding:u,options:{commentString:c}}=e;s+=a;const _=Object.assign({},e,{indent:s,inFlow:!0,type:null});let w=!1,S=0;const A=[];for(let U=0;UW=null);US||ee.includes(` +`))&&(w=!0),A.push(ee),S=A.length}const{start:P,end:D}=i;if(A.length===0)return P+D;if(!w){const U=A.reduce((L,W)=>L+W.length+2,2);w=e.options.lineWidth>0&&U>e.options.lineWidth}if(w){let U=P;for(const L of A)U+=L?` ${a}${n}${L}`:` -`;return`${j} -${n}${D}`}else return`${P}${u}${C.join(" ")}${u}${D}`}function Cy({indent:t,options:{commentString:e}},i,s,n){if(s&&n&&(s=s.replace(/^\n+/,"")),s){const a=Za(e(s),t);i.push(a.trimStart())}}function du(t,e){const i=os(e)?e.value:e;for(const s of t)if(ms(s)&&(s.key===e||s.key===i||os(s.key)&&s.key.value===i))return s}class Hr extends Hk{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Jl,e),this.items=[]}static from(e,i,s){const{keepUndefined:n,replacer:a}=s,u=new this(e),c=(_,w)=>{if(typeof a=="function")w=a.call(i,_,w);else if(Array.isArray(a)&&!a.includes(_))return;(w!==void 0||n)&&u.items.push(sT(_,w,s))};if(i instanceof Map)for(const[_,w]of i)c(_,w);else if(i&&typeof i=="object")for(const _ of Object.keys(i))c(_,i[_]);return typeof e.sortMapEntries=="function"&&u.items.sort(e.sortMapEntries),u}add(e,i){var u;let s;ms(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Ln(e,e==null?void 0:e.value):s=new Ln(e.key,e.value);const n=du(this.items,s.key),a=(u=this.schema)==null?void 0:u.sortMapEntries;if(n){if(!i)throw new Error(`Key ${s.key} already set`);os(n.value)&&Wk(s.value)?n.value.value=s.value:n.value=s.value}else if(a){const c=this.items.findIndex(_=>a(s,_)<0);c===-1?this.items.push(s):this.items.splice(c,0,s)}else this.items.push(s)}delete(e){const i=du(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){const s=du(this.items,e),n=s==null?void 0:s.value;return(!i&&os(n)?n.value:n)??void 0}has(e){return!!du(this.items,e)}set(e,i){this.add(new Ln(e,i),!0)}toJSON(e,i,s){const n=s?new s:i!=null&&i.mapAsMap?new Map:{};i!=null&&i.onCreate&&i.onCreate(n);for(const a of this.items)Kk(i,n,a);return n}toString(e,i,s){if(!e)return JSON.stringify(this);for(const n of this.items)if(!ms(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Yk(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:i})}}const Ld={collection:"map",default:!0,nodeClass:Hr,tag:"tag:yaml.org,2002:map",resolve(t,e){return Nd(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>Hr.from(t,e,i)};class ac extends Hk{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Dd,e),this.items=[]}add(e){this.items.push(e)}delete(e){const i=E_(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){const s=E_(e);if(typeof s!="number")return;const n=this.items[s];return!i&&os(n)?n.value:n}has(e){const i=E_(e);return typeof i=="number"&&i=0?e:null}const zd={collection:"seq",default:!0,nodeClass:ac,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Bd(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>ac.from(t,e,i)},B0={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,i,s){return e=Object.assign({actualString:!0},e),Dm(t,e,i,s)}},L0={identify:t=>t==null,createNode:()=>new ti(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ti(null),stringify:({source:t},e)=>typeof t=="string"&&L0.test.test(t)?t:e.options.nullStr},nT={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ti(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&nT.test.test(t)){const s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?i.options.trueStr:i.options.falseStr}};function Do({format:t,minFractionDigits:e,tag:i,value:s}){if(typeof s=="bigint")return String(s);const n=typeof s=="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=JSON.stringify(s);if(!t&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let u=a.indexOf(".");u<0&&(u=a.length,a+=".");let c=e-(a.length-u-1);for(;c-- >0;)a+="0"}return a}const Jk={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Do},Gk={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Do(t)}},Qk={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new ti(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Do},z0=t=>typeof t=="bigint"||Number.isInteger(t),rT=(t,e,i,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),i);function e3(t,e,i){const{value:s}=t;return z0(s)&&s>=0?i+s.toString(e):Do(t)}const t3={identify:t=>z0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>rT(t,2,8,i),stringify:t=>e3(t,8,"0o")},i3={identify:z0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>rT(t,0,10,i),stringify:Do},s3={identify:t=>z0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,i)=>rT(t,2,16,i),stringify:t=>e3(t,16,"0x")},pq=[Ld,zd,B0,L0,nT,t3,i3,s3,Jk,Gk,Qk];function _C(t){return typeof t=="bigint"||Number.isInteger(t)}const A_=({value:t})=>JSON.stringify(t),mq=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:A_},{identify:t=>t==null,createNode:()=>new ti(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:A_},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:A_},{identify:_C,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:i})=>i?BigInt(t):parseInt(t,10),stringify:({value:t})=>_C(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:A_}],gq={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},_q=[Ld,zd].concat(mq,gq),oT={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){const i=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(i.length);for(let n=0;n1&&e("Each pair must have its own sequence indicator");const n=s.items[0]||new Ln(new ti(null));if(s.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${s.commentBefore} +`;return`${U} +${n}${D}`}else return`${P}${u}${A.join(" ")}${u}${D}`}function ky({indent:t,options:{commentString:e}},i,s,n){if(s&&n&&(s=s.replace(/^\n+/,"")),s){const a=Ga(e(s),t);i.push(a.trimStart())}}function wu(t,e){const i=Ji(e)?e.value:e;for(const s of t)if(ms(s)&&(s.key===e||s.key===i||Ji(s.key)&&s.key.value===i))return s}class Zr extends Yk{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ac,e),this.items=[]}static from(e,i,s){const{keepUndefined:n,replacer:a}=s,u=new this(e),c=(_,w)=>{if(typeof a=="function")w=a.call(i,_,w);else if(Array.isArray(a)&&!a.includes(_))return;(w!==void 0||n)&&u.items.push(cT(_,w,s))};if(i instanceof Map)for(const[_,w]of i)c(_,w);else if(i&&typeof i=="object")for(const _ of Object.keys(i))c(_,i[_]);return typeof e.sortMapEntries=="function"&&u.items.sort(e.sortMapEntries),u}add(e,i){var u;let s;ms(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new jn(e,e==null?void 0:e.value):s=new jn(e.key,e.value);const n=wu(this.items,s.key),a=(u=this.schema)==null?void 0:u.sortMapEntries;if(n){if(!i)throw new Error(`Key ${s.key} already set`);Ji(n.value)&&Zk(s.value)?n.value.value=s.value:n.value=s.value}else if(a){const c=this.items.findIndex(_=>a(s,_)<0);c===-1?this.items.push(s):this.items.splice(c,0,s)}else this.items.push(s)}delete(e){const i=wu(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){const s=wu(this.items,e),n=s==null?void 0:s.value;return(!i&&Ji(n)?n.value:n)??void 0}has(e){return!!wu(this.items,e)}set(e,i){this.add(new jn(e,i),!0)}toJSON(e,i,s){const n=s?new s:i!=null&&i.mapAsMap?new Map:{};i!=null&&i.onCreate&&i.onCreate(n);for(const a of this.items)e3(i,n,a);return n}toString(e,i,s){if(!e)return JSON.stringify(this);for(const n of this.items)if(!ms(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t3(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:i})}}const id={collection:"map",default:!0,nodeClass:Zr,tag:"tag:yaml.org,2002:map",resolve(t,e){return ed(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>Zr.from(t,e,i)};class mc extends Yk{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Qf,e),this.items=[]}add(e){this.items.push(e)}delete(e){const i=M_(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){const s=M_(e);if(typeof s!="number")return;const n=this.items[s];return!i&&Ji(n)?n.value:n}has(e){const i=M_(e);return typeof i=="number"&&i=0?e:null}const sd={collection:"seq",default:!0,nodeClass:mc,tag:"tag:yaml.org,2002:seq",resolve(t,e){return td(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>mc.from(t,e,i)},D0={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,i,s){return e=Object.assign({actualString:!0},e),Wg(t,e,i,s)}},F0={identify:t=>t==null,createNode:()=>new ti(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ti(null),stringify:({source:t},e)=>typeof t=="string"&&F0.test.test(t)?t:e.options.nullStr},uT={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ti(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&uT.test.test(t)){const s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?i.options.trueStr:i.options.falseStr}};function Uo({format:t,minFractionDigits:e,tag:i,value:s}){if(typeof s=="bigint")return String(s);const n=typeof s=="number"?s:Number(s);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=JSON.stringify(s);if(!t&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let u=a.indexOf(".");u<0&&(u=a.length,a+=".");let c=e-(a.length-u-1);for(;c-- >0;)a+="0"}return a}const i3={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Uo},s3={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Uo(t)}},n3={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new ti(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Uo},N0=t=>typeof t=="bigint"||Number.isInteger(t),hT=(t,e,i,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),i);function r3(t,e,i){const{value:s}=t;return N0(s)&&s>=0?i+s.toString(e):Uo(t)}const o3={identify:t=>N0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>hT(t,2,8,i),stringify:t=>r3(t,8,"0o")},a3={identify:N0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>hT(t,0,10,i),stringify:Uo},l3={identify:t=>N0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,i)=>hT(t,2,16,i),stringify:t=>r3(t,16,"0x")},bq=[id,sd,D0,F0,uT,o3,a3,l3,i3,s3,n3];function gC(t){return typeof t=="bigint"||Number.isInteger(t)}const R_=({value:t})=>JSON.stringify(t),vq=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:R_},{identify:t=>t==null,createNode:()=>new ti(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:R_},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:R_},{identify:gC,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:i})=>i?BigInt(t):parseInt(t,10),stringify:({value:t})=>gC(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:R_}],xq={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},wq=[id,sd].concat(vq,xq),fT={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){const i=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(i.length);for(let n=0;n1&&e("Each pair must have its own sequence indicator");const n=s.items[0]||new jn(new ti(null));if(s.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${s.commentBefore} ${n.key.commentBefore}`:s.commentBefore),s.comment){const a=n.value??n.key;a.comment=a.comment?`${s.comment} -${a.comment}`:s.comment}s=n}t.items[i]=ms(s)?s:new Ln(s)}}else e("Expected a sequence for this tag");return t}function r3(t,e,i){const{replacer:s}=i,n=new ac(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let u of e){typeof s=="function"&&(u=s.call(e,String(a++),u));let c,_;if(Array.isArray(u))if(u.length===2)c=u[0],_=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const w=Object.keys(u);if(w.length===1)c=w[0],_=u[c];else throw new TypeError(`Expected tuple with one key, not ${w.length} keys`)}else c=u;n.items.push(sT(c,_,i))}return n}const aT={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:n3,createNode:r3};class dd extends ac{constructor(){super(),this.add=Hr.prototype.add.bind(this),this.delete=Hr.prototype.delete.bind(this),this.get=Hr.prototype.get.bind(this),this.has=Hr.prototype.has.bind(this),this.set=Hr.prototype.set.bind(this),this.tag=dd.tag}toJSON(e,i){if(!i)return super.toJSON(e);const s=new Map;i!=null&&i.onCreate&&i.onCreate(s);for(const n of this.items){let a,u;if(ms(n)?(a=ho(n.key,"",i),u=ho(n.value,a,i)):a=ho(n,"",i),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,u)}return s}static from(e,i,s){const n=r3(e,i,s),a=new this;return a.items=n.items,a}}dd.tag="tag:yaml.org,2002:omap";const lT={collection:"seq",identify:t=>t instanceof Map,nodeClass:dd,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const i=n3(t,e),s=[];for(const{key:n}of i.items)os(n)&&(s.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):s.push(n.value));return Object.assign(new dd,i)},createNode:(t,e,i)=>dd.from(t,e,i)};function o3({value:t,source:e},i){return e&&(t?a3:l3).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}const a3={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ti(!0),stringify:o3},l3={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ti(!1),stringify:o3},yq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Do},bq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Do(t)}},vq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new ti(parseFloat(t.replace(/_/g,""))),i=t.indexOf(".");if(i!==-1){const s=t.substring(i+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Do},Fm=t=>typeof t=="bigint"||Number.isInteger(t);function U0(t,e,i,{intAsBigInt:s}){const n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(i){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const u=BigInt(t);return n==="-"?BigInt(-1)*u:u}const a=parseInt(t,i);return n==="-"?-1*a:a}function cT(t,e,i){const{value:s}=t;if(Fm(s)){const n=s.toString(e);return s<0?"-"+i+n.substr(1):i+n}return Do(t)}const xq={identify:Fm,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,i)=>U0(t,2,2,i),stringify:t=>cT(t,2,"0b")},wq={identify:Fm,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,i)=>U0(t,1,8,i),stringify:t=>cT(t,8,"0")},Tq={identify:Fm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>U0(t,0,10,i),stringify:Do},Sq={identify:Fm,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,i)=>U0(t,2,16,i),stringify:t=>cT(t,16,"0x")};class fd extends Hr{constructor(e){super(e),this.tag=fd.tag}add(e){let i;ms(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new Ln(e.key,null):i=new Ln(e,null),du(this.items,i.key)||this.items.push(i)}get(e,i){const s=du(this.items,e);return!i&&ms(s)?os(s.key)?s.key.value:s.key:s}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const s=du(this.items,e);s&&!i?this.items.splice(this.items.indexOf(s),1):!s&&i&&this.items.push(new Ln(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,s);throw new Error("Set items must all have null values")}static from(e,i,s){const{replacer:n}=s,a=new this(e);if(i&&Symbol.iterator in Object(i))for(let u of i)typeof n=="function"&&(u=n.call(i,u,u)),a.items.push(sT(u,null,s));return a}}fd.tag="tag:yaml.org,2002:set";const uT={collection:"map",identify:t=>t instanceof Set,nodeClass:fd,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>fd.from(t,e,i),resolve(t,e){if(Nd(t)){if(t.hasAllNullValues(!0))return Object.assign(new fd,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function hT(t,e){const i=t[0],s=i==="-"||i==="+"?t.substring(1):t,n=u=>e?BigInt(u):Number(u),a=s.replace(/_/g,"").split(":").reduce((u,c)=>u*n(60)+n(c),n(0));return i==="-"?n(-1)*a:a}function c3(t){let{value:e}=t,i=u=>u;if(typeof e=="bigint")i=u=>BigInt(u);else if(isNaN(e)||!isFinite(e))return Do(t);let s="";e<0&&(s="-",e*=i(-1));const n=i(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),s+a.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const u3={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:i})=>hT(t,i),stringify:c3},h3={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>hT(t,!1),stringify:c3},V0={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(V0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,s,n,a,u,c]=e.map(Number),_=e[7]?Number((e[7]+"00").substr(1,3)):0;let w=Date.UTC(i,s-1,n,a||0,u||0,c||0,_);const S=e[8];if(S&&S!=="Z"){let C=hT(S,!1);Math.abs(C)<30&&(C*=60),w-=6e4*C}return new Date(w)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},yC=[Ld,zd,B0,L0,a3,l3,xq,wq,Tq,Sq,yq,bq,vq,oT,lT,aT,uT,u3,h3,V0],bC=new Map([["core",pq],["failsafe",[Ld,zd,B0]],["json",_q],["yaml11",yC],["yaml-1.1",yC]]),vC={binary:oT,bool:nT,float:Qk,floatExp:Gk,floatNaN:Jk,floatTime:h3,int:i3,intHex:s3,intOct:t3,intTime:u3,map:Ld,null:L0,omap:lT,pairs:aT,seq:zd,set:uT,timestamp:V0},Eq={"tag:yaml.org,2002:binary":oT,"tag:yaml.org,2002:omap":lT,"tag:yaml.org,2002:pairs":aT,"tag:yaml.org,2002:set":uT,"tag:yaml.org,2002:timestamp":V0};function Ex(t,e){let i=bC.get(e);if(!i)if(Array.isArray(t))i=[];else{const s=Array.from(bC.keys()).filter(n=>n!=="yaml11").map(n=>JSON.stringify(n)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return i.map(s=>{if(typeof s!="string")return s;const n=vC[s];if(n)return n;const a=Object.keys(vC).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag "${s}"; use one of ${a}`)})}const Aq=(t,e)=>t.keye.key?1:0;class j0{constructor({compat:e,customTags:i,merge:s,resolveKnownTags:n,schema:a,sortMapEntries:u,toStringDefaults:c}){this.compat=Array.isArray(e)?Ex(e,"compat"):e?Ex(null,e):null,this.merge=!!s,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Eq:{},this.tags=Ex(i,this.name),this.toStringOptions=c??null,Object.defineProperty(this,Jl,{value:Ld}),Object.defineProperty(this,el,{value:B0}),Object.defineProperty(this,Dd,{value:zd}),this.sortMapEntries=typeof u=="function"?u:u===!0?Aq:null}clone(){const e=Object.create(j0.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Iq(t,e){var _;const i=[];let s=e.directives===!0;if(e.directives!==!1&&t.directives){const w=t.directives.toString(t);w?(i.push(w),s=!0):t.directives.docStart&&(s=!0)}s&&i.push("---");const n=Xk(t,e),{commentString:a}=n.options;if(t.commentBefore){i.length!==1&&i.unshift("");const w=a(t.commentBefore);i.unshift(Za(w,""))}let u=!1,c=null;if(t.contents){if(Es(t.contents)){if(t.contents.spaceBefore&&s&&i.push(""),t.contents.commentBefore){const C=a(t.contents.commentBefore);i.push(Za(C,""))}n.forceBlockIndent=!!t.comment,c=t.contents.comment}const w=c?void 0:()=>u=!0;let S=Ed(t.contents,n,()=>c=null,w);c&&(S+=hu(S,"",a(c))),(S[0]==="|"||S[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${S}`:i.push(S)}else i.push(Ed(t.contents,n));if((_=t.directives)!=null&&_.docEnd)if(t.comment){const w=a(t.comment);w.includes(` -`)?(i.push("..."),i.push(Za(w,""))):i.push(`... ${w}`)}else i.push("...");else{let w=t.comment;w&&u&&(w=w.replace(/^\n+/,"")),w&&((!u||c)&&i[i.length-1]!==""&&i.push(""),i.push(Za(a(w),"")))}return i.join(` +${a.comment}`:s.comment}s=n}t.items[i]=ms(s)?s:new jn(s)}}else e("Expected a sequence for this tag");return t}function u3(t,e,i){const{replacer:s}=i,n=new mc(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let u of e){typeof s=="function"&&(u=s.call(e,String(a++),u));let c,_;if(Array.isArray(u))if(u.length===2)c=u[0],_=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const w=Object.keys(u);if(w.length===1)c=w[0],_=u[c];else throw new TypeError(`Expected tuple with one key, not ${w.length} keys`)}else c=u;n.items.push(cT(c,_,i))}return n}const dT={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c3,createNode:u3};class kf extends mc{constructor(){super(),this.add=Zr.prototype.add.bind(this),this.delete=Zr.prototype.delete.bind(this),this.get=Zr.prototype.get.bind(this),this.has=Zr.prototype.has.bind(this),this.set=Zr.prototype.set.bind(this),this.tag=kf.tag}toJSON(e,i){if(!i)return super.toJSON(e);const s=new Map;i!=null&&i.onCreate&&i.onCreate(s);for(const n of this.items){let a,u;if(ms(n)?(a=yo(n.key,"",i),u=yo(n.value,a,i)):a=yo(n,"",i),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,u)}return s}static from(e,i,s){const n=u3(e,i,s),a=new this;return a.items=n.items,a}}kf.tag="tag:yaml.org,2002:omap";const pT={collection:"seq",identify:t=>t instanceof Map,nodeClass:kf,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const i=c3(t,e),s=[];for(const{key:n}of i.items)Ji(n)&&(s.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):s.push(n.value));return Object.assign(new kf,i)},createNode:(t,e,i)=>kf.from(t,e,i)};function h3({value:t,source:e},i){return e&&(t?f3:d3).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}const f3={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ti(!0),stringify:h3},d3={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ti(!1),stringify:h3},Tq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Uo},Sq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Uo(t)}},Eq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new ti(parseFloat(t.replace(/_/g,""))),i=t.indexOf(".");if(i!==-1){const s=t.substring(i+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Uo},qg=t=>typeof t=="bigint"||Number.isInteger(t);function B0(t,e,i,{intAsBigInt:s}){const n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(i){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const u=BigInt(t);return n==="-"?BigInt(-1)*u:u}const a=parseInt(t,i);return n==="-"?-1*a:a}function gT(t,e,i){const{value:s}=t;if(qg(s)){const n=s.toString(e);return s<0?"-"+i+n.substr(1):i+n}return Uo(t)}const Aq={identify:qg,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,i)=>B0(t,2,2,i),stringify:t=>gT(t,2,"0b")},Iq={identify:qg,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,i)=>B0(t,1,8,i),stringify:t=>gT(t,8,"0")},Cq={identify:qg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>B0(t,0,10,i),stringify:Uo},Pq={identify:qg,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,i)=>B0(t,2,16,i),stringify:t=>gT(t,16,"0x")};class Of extends Zr{constructor(e){super(e),this.tag=Of.tag}add(e){let i;ms(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new jn(e.key,null):i=new jn(e,null),wu(this.items,i.key)||this.items.push(i)}get(e,i){const s=wu(this.items,e);return!i&&ms(s)?Ji(s.key)?s.key.value:s.key:s}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const s=wu(this.items,e);s&&!i?this.items.splice(this.items.indexOf(s),1):!s&&i&&this.items.push(new jn(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,s);throw new Error("Set items must all have null values")}static from(e,i,s){const{replacer:n}=s,a=new this(e);if(i&&Symbol.iterator in Object(i))for(let u of i)typeof n=="function"&&(u=n.call(i,u,u)),a.items.push(cT(u,null,s));return a}}Of.tag="tag:yaml.org,2002:set";const mT={collection:"map",identify:t=>t instanceof Set,nodeClass:Of,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>Of.from(t,e,i),resolve(t,e){if(ed(t)){if(t.hasAllNullValues(!0))return Object.assign(new Of,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function _T(t,e){const i=t[0],s=i==="-"||i==="+"?t.substring(1):t,n=u=>e?BigInt(u):Number(u),a=s.replace(/_/g,"").split(":").reduce((u,c)=>u*n(60)+n(c),n(0));return i==="-"?n(-1)*a:a}function p3(t){let{value:e}=t,i=u=>u;if(typeof e=="bigint")i=u=>BigInt(u);else if(isNaN(e)||!isFinite(e))return Uo(t);let s="";e<0&&(s="-",e*=i(-1));const n=i(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),s+a.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const g3={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:i})=>_T(t,i),stringify:p3},m3={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>_T(t,!1),stringify:p3},L0={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(L0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,s,n,a,u,c]=e.map(Number),_=e[7]?Number((e[7]+"00").substr(1,3)):0;let w=Date.UTC(i,s-1,n,a||0,u||0,c||0,_);const S=e[8];if(S&&S!=="Z"){let A=_T(S,!1);Math.abs(A)<30&&(A*=60),w-=6e4*A}return new Date(w)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},mC=[id,sd,D0,F0,f3,d3,Aq,Iq,Cq,Pq,Tq,Sq,Eq,fT,el,pT,dT,mT,g3,m3,L0],_C=new Map([["core",bq],["failsafe",[id,sd,D0]],["json",wq],["yaml11",mC],["yaml-1.1",mC]]),yC={binary:fT,bool:uT,float:n3,floatExp:s3,floatNaN:i3,floatTime:m3,int:a3,intHex:l3,intOct:o3,intTime:g3,map:id,merge:el,null:F0,omap:pT,pairs:dT,seq:sd,set:mT,timestamp:L0},Mq={"tag:yaml.org,2002:binary":fT,"tag:yaml.org,2002:merge":el,"tag:yaml.org,2002:omap":pT,"tag:yaml.org,2002:pairs":dT,"tag:yaml.org,2002:set":mT,"tag:yaml.org,2002:timestamp":L0};function Ox(t,e,i){const s=_C.get(e);if(s&&!t)return i&&!s.includes(el)?s.concat(el):s.slice();let n=s;if(!n)if(Array.isArray(t))n=[];else{const a=Array.from(_C.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(const a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return i&&(n=n.concat(el)),n.reduce((a,u)=>{const c=typeof u=="string"?yC[u]:u;if(!c){const _=JSON.stringify(u),w=Object.keys(yC).map(S=>JSON.stringify(S)).join(", ");throw new Error(`Unknown custom tag ${_}; use one of ${w}`)}return a.includes(c)||a.push(c),a},[])}const Rq=(t,e)=>t.keye.key?1:0;class z0{constructor({compat:e,customTags:i,merge:s,resolveKnownTags:n,schema:a,sortMapEntries:u,toStringDefaults:c}){this.compat=Array.isArray(e)?Ox(e,"compat"):e?Ox(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Mq:{},this.tags=Ox(i,this.name,s),this.toStringOptions=c??null,Object.defineProperty(this,ac,{value:id}),Object.defineProperty(this,ya,{value:D0}),Object.defineProperty(this,Qf,{value:sd}),this.sortMapEntries=typeof u=="function"?u:u===!0?Rq:null}clone(){const e=Object.create(z0.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function kq(t,e){var _;const i=[];let s=e.directives===!0;if(e.directives!==!1&&t.directives){const w=t.directives.toString(t);w?(i.push(w),s=!0):t.directives.docStart&&(s=!0)}s&&i.push("---");const n=Jk(t,e),{commentString:a}=n.options;if(t.commentBefore){i.length!==1&&i.unshift("");const w=a(t.commentBefore);i.unshift(Ga(w,""))}let u=!1,c=null;if(t.contents){if(xs(t.contents)){if(t.contents.spaceBefore&&s&&i.push(""),t.contents.commentBefore){const A=a(t.contents.commentBefore);i.push(Ga(A,""))}n.forceBlockIndent=!!t.comment,c=t.contents.comment}const w=c?void 0:()=>u=!0;let S=Hf(t.contents,n,()=>c=null,w);c&&(S+=xu(S,"",a(c))),(S[0]==="|"||S[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${S}`:i.push(S)}else i.push(Hf(t.contents,n));if((_=t.directives)!=null&&_.docEnd)if(t.comment){const w=a(t.comment);w.includes(` +`)?(i.push("..."),i.push(Ga(w,""))):i.push(`... ${w}`)}else i.push("...");else{let w=t.comment;w&&u&&(w=w.replace(/^\n+/,"")),w&&((!u||c)&&i[i.length-1]!==""&&i.push(""),i.push(Ga(a(w),"")))}return i.join(` `)+` -`}class Ud{constructor(e,i,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,po,{value:Ww});let n=null;typeof i=="function"||Array.isArray(i)?n=i:s===void 0&&i&&(s=i,i=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:u}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Qn({version:u}),this.setSchema(u,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){const e=Object.create(Ud.prototype,{[po]:{value:Ww}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Es(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Bh(this.contents)&&this.contents.add(e)}addIn(e,i){Bh(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){const s=jk(this);e.anchor=!i||s.has(i)?$k(i||"a",s):i}return new O0(e.anchor)}createNode(e,i,s){let n;if(typeof i=="function")e=i.call({"":e},"",e),n=i;else if(Array.isArray(i)){const H=G=>typeof G=="number"||G instanceof String||G instanceof Number,te=i.filter(H).map(String);te.length>0&&(i=i.concat(te)),n=i}else s===void 0&&i&&(s=i,i=void 0);const{aliasDuplicateObjects:a,anchorPrefix:u,flow:c,keepUndefined:_,onTagObj:w,tag:S}=s??{},{onAnchor:C,setAnchors:P,sourceObjects:D}=tq(this,u||"a"),j={aliasDuplicateObjects:a??!0,keepUndefined:_??!1,onAnchor:C,onTagObj:w,replacer:n,schema:this.schema,sourceObjects:D},L=fm(e,S,j);return c&&bs(L)&&(L.flow=!0),P(),L}createPair(e,i,s={}){const n=this.createNode(e,null,s),a=this.createNode(i,null,s);return new Ln(n,a)}delete(e){return Bh(this.contents)?this.contents.delete(e):!1}deleteIn(e){return kp(e)?this.contents==null?!1:(this.contents=null,!0):Bh(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return bs(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return kp(e)?!i&&os(this.contents)?this.contents.value:this.contents:bs(this.contents)?this.contents.getIn(e,i):void 0}has(e){return bs(this.contents)?this.contents.has(e):!1}hasIn(e){return kp(e)?this.contents!==void 0:bs(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Iy(this.schema,[e],i):Bh(this.contents)&&this.contents.set(e,i)}setIn(e,i){kp(e)?this.contents=i:this.contents==null?this.contents=Iy(this.schema,Array.from(e),i):Bh(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Qn({version:"1.1"}),s={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Qn({version:e}),s={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(s)this.schema=new j0(Object.assign(s,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,mapAsMap:s,maxAliasCount:n,onAnchor:a,reviver:u}={}){const c={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},_=ho(this.contents,i??"",c);if(typeof a=="function")for(const{count:w,res:S}of c.anchors.values())a(S,w);return typeof u=="function"?Jh(u,{"":_},"",_):_}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return Iq(this,e)}}function Bh(t){if(bs(t))return!0;throw new Error("Expected a YAML collection as document contents")}class dT extends Error{constructor(e,i,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=i}}class fu extends dT{constructor(e,i,s){super("YAMLParseError",e,i,s)}}class d3 extends dT{constructor(e,i,s){super("YAMLWarning",e,i,s)}}const Py=(t,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(c=>e.linePos(c));const{line:s,col:n}=i.linePos[0];i.message+=` at line ${s}, column ${n}`;let a=n-1,u=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&u.length>80){const c=Math.min(a-39,u.length-79);u="…"+u.substring(c),a-=c-1}if(u.length>80&&(u=u.substring(0,79)+"…"),s>1&&/^ *$/.test(u.substring(0,a))){let c=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);c.length>80&&(c=c.substring(0,79)+`… +`}class nd{constructor(e,i,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bo,{value:Zw});let n=null;typeof i=="function"||Array.isArray(i)?n=i:s===void 0&&i&&(s=i,i=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:u}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new ir({version:u}),this.setSchema(u,s),this.contents=e===void 0?null:this.createNode(e,n,s)}clone(){const e=Object.create(nd.prototype,{[bo]:{value:Zw}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=xs(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ef(this.contents)&&this.contents.add(e)}addIn(e,i){ef(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){const s=qk(this);e.anchor=!i||s.has(i)?Xk(i||"a",s):i}return new M0(e.anchor)}createNode(e,i,s){let n;if(typeof i=="function")e=i.call({"":e},"",e),n=i;else if(Array.isArray(i)){const W=G=>typeof G=="number"||G instanceof String||G instanceof Number,ee=i.filter(W).map(String);ee.length>0&&(i=i.concat(ee)),n=i}else s===void 0&&i&&(s=i,i=void 0);const{aliasDuplicateObjects:a,anchorPrefix:u,flow:c,keepUndefined:_,onTagObj:w,tag:S}=s??{},{onAnchor:A,setAnchors:P,sourceObjects:D}=oq(this,u||"a"),U={aliasDuplicateObjects:a??!0,keepUndefined:_??!1,onAnchor:A,onTagObj:w,replacer:n,schema:this.schema,sourceObjects:D},L=wg(e,S,U);return c&&vs(L)&&(L.flow=!0),P(),L}createPair(e,i,s={}){const n=this.createNode(e,null,s),a=this.createNode(i,null,s);return new jn(n,a)}delete(e){return ef(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Vp(e)?this.contents==null?!1:(this.contents=null,!0):ef(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return vs(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Vp(e)?!i&&Ji(this.contents)?this.contents.value:this.contents:vs(this.contents)?this.contents.getIn(e,i):void 0}has(e){return vs(this.contents)?this.contents.has(e):!1}hasIn(e){return Vp(e)?this.contents!==void 0:vs(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Ry(this.schema,[e],i):ef(this.contents)&&this.contents.set(e,i)}setIn(e,i){Vp(e)?this.contents=i:this.contents==null?this.contents=Ry(this.schema,Array.from(e),i):ef(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ir({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ir({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(s)this.schema=new z0(Object.assign(s,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,mapAsMap:s,maxAliasCount:n,onAnchor:a,reviver:u}={}){const c={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},_=yo(this.contents,i??"",c);if(typeof a=="function")for(const{count:w,res:S}of c.anchors.values())a(S,w);return typeof u=="function"?mf(u,{"":_},"",_):_}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return kq(this,e)}}function ef(t){if(vs(t))return!0;throw new Error("Expected a YAML collection as document contents")}class yT extends Error{constructor(e,i,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=i}}class Tu extends yT{constructor(e,i,s){super("YAMLParseError",e,i,s)}}class _3 extends yT{constructor(e,i,s){super("YAMLWarning",e,i,s)}}const Oy=(t,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(c=>e.linePos(c));const{line:s,col:n}=i.linePos[0];i.message+=` at line ${s}, column ${n}`;let a=n-1,u=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&u.length>80){const c=Math.min(a-39,u.length-79);u="…"+u.substring(c),a-=c-1}if(u.length>80&&(u=u.substring(0,79)+"…"),s>1&&/^ *$/.test(u.substring(0,a))){let c=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);c.length>80&&(c=c.substring(0,79)+`… `),u=c+u}if(/[^ ]/.test(u)){let c=1;const _=i.linePos[1];_&&_.line===s&&_.col>n&&(c=Math.max(1,Math.min(_.col-n,80-a)));const w=" ".repeat(a)+"^".repeat(c);i.message+=`: ${u} ${w} -`}};function Ad(t,{flow:e,indicator:i,next:s,offset:n,onError:a,parentIndent:u,startOnNewline:c}){let _=!1,w=c,S=c,C="",P="",D=!1,j=!1,L=null,H=null,te=null,G=null,se=null,ve=null,Se=null;for(const Fe of t)switch(j&&(Fe.type!=="space"&&Fe.type!=="newline"&&Fe.type!=="comma"&&a(Fe.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),L&&(w&&Fe.type!=="comment"&&Fe.type!=="newline"&&a(L,"TAB_AS_INDENT","Tabs are not allowed as indentation"),L=null),Fe.type){case"space":!e&&(i!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&Fe.source.includes(" ")&&(L=Fe),S=!0;break;case"comment":{S||a(Fe,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Be=Fe.source.substring(1)||" ";C?C+=P+Be:C=Be,P="",w=!1;break}case"newline":w?C?C+=Fe.source:_=!0:P+=Fe.source,w=!0,D=!0,(H||te)&&(G=Fe),S=!0;break;case"anchor":H&&a(Fe,"MULTIPLE_ANCHORS","A node can have at most one anchor"),Fe.source.endsWith(":")&&a(Fe.offset+Fe.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),H=Fe,Se===null&&(Se=Fe.offset),w=!1,S=!1,j=!0;break;case"tag":{te&&a(Fe,"MULTIPLE_TAGS","A node can have at most one tag"),te=Fe,Se===null&&(Se=Fe.offset),w=!1,S=!1,j=!0;break}case i:(H||te)&&a(Fe,"BAD_PROP_ORDER",`Anchors and tags must be after the ${Fe.source} indicator`),ve&&a(Fe,"UNEXPECTED_TOKEN",`Unexpected ${Fe.source} in ${e??"collection"}`),ve=Fe,w=i==="seq-item-ind"||i==="explicit-key-ind",S=!1;break;case"comma":if(e){se&&a(Fe,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),se=Fe,w=!1,S=!1;break}default:a(Fe,"UNEXPECTED_TOKEN",`Unexpected ${Fe.type} token`),w=!1,S=!1}const ge=t[t.length-1],De=ge?ge.offset+ge.source.length:n;return j&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),L&&(w&&L.indent<=u||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(L,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:se,found:ve,spaceBefore:_,comment:C,hasNewline:D,anchor:H,tag:te,newlineAfterProp:G,end:De,start:Se??De}}function pm(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const i of e.start)if(i.type==="newline")return!0;if(e.sep){for(const i of e.sep)if(i.type==="newline")return!0}if(pm(e.key)||pm(e.value))return!0}return!1;default:return!0}}function Zw(t,e,i){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&pm(e)&&i(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function f3(t,e,i){const{uniqueKeys:s}=t.options;if(s===!1)return!1;const n=typeof s=="function"?s:(a,u)=>a===u||os(a)&&os(u)&&a.value===u.value&&!(a.value==="<<"&&t.schema.merge);return e.some(a=>n(a.key,i))}const xC="All mapping items must start at the same column";function Cq({composeNode:t,composeEmptyNode:e},i,s,n,a){var S;const u=(a==null?void 0:a.nodeClass)??Hr,c=new u(i.schema);i.atRoot&&(i.atRoot=!1);let _=s.offset,w=null;for(const C of s.items){const{start:P,key:D,sep:j,value:L}=C,H=Ad(P,{indicator:"explicit-key-ind",next:D??(j==null?void 0:j[0]),offset:_,onError:n,parentIndent:s.indent,startOnNewline:!0}),te=!H.found;if(te){if(D&&(D.type==="block-seq"?n(_,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in D&&D.indent!==s.indent&&n(_,"BAD_INDENT",xC)),!H.anchor&&!H.tag&&!j){w=H.end,H.comment&&(c.comment?c.comment+=` -`+H.comment:c.comment=H.comment);continue}(H.newlineAfterProp||pm(D))&&n(D??P[P.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((S=H.found)==null?void 0:S.indent)!==s.indent&&n(_,"BAD_INDENT",xC);const G=H.end,se=D?t(i,D,H,n):e(i,G,P,null,H,n);i.schema.compat&&Zw(s.indent,D,n),f3(i,c.items,se)&&n(G,"DUPLICATE_KEY","Map keys must be unique");const ve=Ad(j??[],{indicator:"map-value-ind",next:L,offset:se.range[2],onError:n,parentIndent:s.indent,startOnNewline:!D||D.type==="block-scalar"});if(_=ve.end,ve.found){te&&((L==null?void 0:L.type)==="block-map"&&!ve.hasNewline&&n(_,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&H.startt&&(t.type==="block-map"||t.type==="block-seq");function Rq({composeNode:t,composeEmptyNode:e},i,s,n,a){const u=s.start.source==="{",c=u?"flow map":"flow sequence",_=(a==null?void 0:a.nodeClass)??(u?Hr:ac),w=new _(i.schema);w.flow=!0;const S=i.atRoot;S&&(i.atRoot=!1);let C=s.offset+s.start.source.length;for(let H=0;H0){const H=Nm(j,L,i.options.strict,n);H.comment&&(w.comment?w.comment+=` -`+H.comment:w.comment=H.comment),w.range=[s.offset,L,H.offset]}else w.range=[s.offset,L,L];return w}function Cx(t,e,i,s,n,a){const u=i.type==="block-map"?Cq(t,e,i,s,a):i.type==="block-seq"?Pq(t,e,i,s,a):Rq(t,e,i,s,a),c=u.constructor;return n==="!"||n===c.tagName?(u.tag=c.tagName,u):(n&&(u.tag=n),u)}function Mq(t,e,i,s,n){var P;const a=s.tag,u=a?e.directives.tagName(a.source,D=>n(a,"TAG_RESOLVE_FAILED",D)):null;if(i.type==="block-seq"){const{anchor:D,newlineAfterProp:j}=s,L=D&&a?D.offset>a.offset?D:a:D??a;L&&(!j||j.offsetD.tag===u&&D.collection===c);if(!_){const D=e.schema.knownTags[u];if(D&&D.collection===c)e.schema.tags.push(Object.assign({},D,{default:!1})),_=D;else return D!=null&&D.collection?n(a,"BAD_COLLECTION_TYPE",`${D.tag} used for ${c} collection, but expects ${D.collection}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),Cx(t,e,i,n,u)}const w=Cx(t,e,i,n,u,_),S=((P=_.resolve)==null?void 0:P.call(_,w,D=>n(a,"TAG_RESOLVE_FAILED",D),e.options))??w,C=Es(S)?S:new ti(S);return C.range=w.range,C.tag=u,_!=null&&_.format&&(C.format=_.format),C}function p3(t,e,i){const s=e.offset,n=kq(e,t.options.strict,i);if(!n)return{value:"",type:null,comment:"",range:[s,s,s]};const a=n.mode===">"?ti.BLOCK_FOLDED:ti.BLOCK_LITERAL,u=e.source?Oq(e.source):[];let c=u.length;for(let L=u.length-1;L>=0;--L){const H=u[L][1];if(H===""||H==="\r")c=L;else break}if(c===0){const L=n.chomp==="+"&&u.length>0?` -`.repeat(Math.max(1,u.length-1)):"";let H=s+n.length;return e.source&&(H+=e.source.length),{value:L,type:a,comment:n.comment,range:[s,H,H]}}let _=e.indent+n.indent,w=e.offset+n.length,S=0;for(let L=0;L_&&(_=H.length);else{H.length<_&&i(w+H.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(_=H.length),S=L,_===0&&!t.atRoot&&i(w,"BAD_INDENT","Block scalar values in collections must be indented");break}w+=H.length+te.length+1}for(let L=u.length-1;L>=c;--L)u[L][0].length>_&&(c=L+1);let C="",P="",D=!1;for(let L=0;L_||te[0]===" "?(P===" "?P=` +`}};function Wf(t,{flow:e,indicator:i,next:s,offset:n,onError:a,parentIndent:u,startOnNewline:c}){let _=!1,w=c,S=c,A="",P="",D=!1,U=!1,L=null,W=null,ee=null,G=null,se=null,fe=null,Se=null;for(const Ne of t)switch(U&&(Ne.type!=="space"&&Ne.type!=="newline"&&Ne.type!=="comma"&&a(Ne.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),U=!1),L&&(w&&Ne.type!=="comment"&&Ne.type!=="newline"&&a(L,"TAB_AS_INDENT","Tabs are not allowed as indentation"),L=null),Ne.type){case"space":!e&&(i!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&Ne.source.includes(" ")&&(L=Ne),S=!0;break;case"comment":{S||a(Ne,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Oe=Ne.source.substring(1)||" ";A?A+=P+Oe:A=Oe,P="",w=!1;break}case"newline":w?A?A+=Ne.source:_=!0:P+=Ne.source,w=!0,D=!0,(W||ee)&&(G=Ne),S=!0;break;case"anchor":W&&a(Ne,"MULTIPLE_ANCHORS","A node can have at most one anchor"),Ne.source.endsWith(":")&&a(Ne.offset+Ne.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),W=Ne,Se===null&&(Se=Ne.offset),w=!1,S=!1,U=!0;break;case"tag":{ee&&a(Ne,"MULTIPLE_TAGS","A node can have at most one tag"),ee=Ne,Se===null&&(Se=Ne.offset),w=!1,S=!1,U=!0;break}case i:(W||ee)&&a(Ne,"BAD_PROP_ORDER",`Anchors and tags must be after the ${Ne.source} indicator`),fe&&a(Ne,"UNEXPECTED_TOKEN",`Unexpected ${Ne.source} in ${e??"collection"}`),fe=Ne,w=i==="seq-item-ind"||i==="explicit-key-ind",S=!1;break;case"comma":if(e){se&&a(Ne,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),se=Ne,w=!1,S=!1;break}default:a(Ne,"UNEXPECTED_TOKEN",`Unexpected ${Ne.type} token`),w=!1,S=!1}const Te=t[t.length-1],Fe=Te?Te.offset+Te.source.length:n;return U&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),L&&(w&&L.indent<=u||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(L,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:se,found:fe,spaceBefore:_,comment:A,hasNewline:D,anchor:W,tag:ee,newlineAfterProp:G,end:Fe,start:Se??Fe}}function Tg(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const i of e.start)if(i.type==="newline")return!0;if(e.sep){for(const i of e.sep)if(i.type==="newline")return!0}if(Tg(e.key)||Tg(e.value))return!0}return!1;default:return!0}}function Gw(t,e,i){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&Tg(e)&&i(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function y3(t,e,i){const{uniqueKeys:s}=t.options;if(s===!1)return!1;const n=typeof s=="function"?s:(a,u)=>a===u||Ji(a)&&Ji(u)&&a.value===u.value;return e.some(a=>n(a.key,i))}const bC="All mapping items must start at the same column";function Oq({composeNode:t,composeEmptyNode:e},i,s,n,a){var S;const u=(a==null?void 0:a.nodeClass)??Zr,c=new u(i.schema);i.atRoot&&(i.atRoot=!1);let _=s.offset,w=null;for(const A of s.items){const{start:P,key:D,sep:U,value:L}=A,W=Wf(P,{indicator:"explicit-key-ind",next:D??(U==null?void 0:U[0]),offset:_,onError:n,parentIndent:s.indent,startOnNewline:!0}),ee=!W.found;if(ee){if(D&&(D.type==="block-seq"?n(_,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in D&&D.indent!==s.indent&&n(_,"BAD_INDENT",bC)),!W.anchor&&!W.tag&&!U){w=W.end,W.comment&&(c.comment?c.comment+=` +`+W.comment:c.comment=W.comment);continue}(W.newlineAfterProp||Tg(D))&&n(D??P[P.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((S=W.found)==null?void 0:S.indent)!==s.indent&&n(_,"BAD_INDENT",bC);i.atKey=!0;const G=W.end,se=D?t(i,D,W,n):e(i,G,P,null,W,n);i.schema.compat&&Gw(s.indent,D,n),i.atKey=!1,y3(i,c.items,se)&&n(G,"DUPLICATE_KEY","Map keys must be unique");const fe=Wf(U??[],{indicator:"map-value-ind",next:L,offset:se.range[2],onError:n,parentIndent:s.indent,startOnNewline:!D||D.type==="block-scalar"});if(_=fe.end,fe.found){ee&&((L==null?void 0:L.type)==="block-map"&&!fe.hasNewline&&n(_,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&W.startt&&(t.type==="block-map"||t.type==="block-seq");function Fq({composeNode:t,composeEmptyNode:e},i,s,n,a){const u=s.start.source==="{",c=u?"flow map":"flow sequence",_=(a==null?void 0:a.nodeClass)??(u?Zr:mc),w=new _(i.schema);w.flow=!0;const S=i.atRoot;S&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let A=s.offset+s.start.source.length;for(let W=0;W0){const W=Xg(U,L,i.options.strict,n);W.comment&&(w.comment?w.comment+=` +`+W.comment:w.comment=W.comment),w.range=[s.offset,L,W.offset]}else w.range=[s.offset,L,L];return w}function Nx(t,e,i,s,n,a){const u=i.type==="block-map"?Oq(t,e,i,s,a):i.type==="block-seq"?Dq(t,e,i,s,a):Fq(t,e,i,s,a),c=u.constructor;return n==="!"||n===c.tagName?(u.tag=c.tagName,u):(n&&(u.tag=n),u)}function Nq(t,e,i,s,n){var P;const a=s.tag,u=a?e.directives.tagName(a.source,D=>n(a,"TAG_RESOLVE_FAILED",D)):null;if(i.type==="block-seq"){const{anchor:D,newlineAfterProp:U}=s,L=D&&a?D.offset>a.offset?D:a:D??a;L&&(!U||U.offsetD.tag===u&&D.collection===c);if(!_){const D=e.schema.knownTags[u];if(D&&D.collection===c)e.schema.tags.push(Object.assign({},D,{default:!1})),_=D;else return D!=null&&D.collection?n(a,"BAD_COLLECTION_TYPE",`${D.tag} used for ${c} collection, but expects ${D.collection}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),Nx(t,e,i,n,u)}const w=Nx(t,e,i,n,u,_),S=((P=_.resolve)==null?void 0:P.call(_,w,D=>n(a,"TAG_RESOLVE_FAILED",D),e.options))??w,A=xs(S)?S:new ti(S);return A.range=w.range,A.tag=u,_!=null&&_.format&&(A.format=_.format),A}function b3(t,e,i){const s=e.offset,n=Bq(e,t.options.strict,i);if(!n)return{value:"",type:null,comment:"",range:[s,s,s]};const a=n.mode===">"?ti.BLOCK_FOLDED:ti.BLOCK_LITERAL,u=e.source?Lq(e.source):[];let c=u.length;for(let L=u.length-1;L>=0;--L){const W=u[L][1];if(W===""||W==="\r")c=L;else break}if(c===0){const L=n.chomp==="+"&&u.length>0?` +`.repeat(Math.max(1,u.length-1)):"";let W=s+n.length;return e.source&&(W+=e.source.length),{value:L,type:a,comment:n.comment,range:[s,W,W]}}let _=e.indent+n.indent,w=e.offset+n.length,S=0;for(let L=0;L_&&(_=W.length);else{W.length<_&&i(w+W.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(_=W.length),S=L,_===0&&!t.atRoot&&i(w,"BAD_INDENT","Block scalar values in collections must be indented");break}w+=W.length+ee.length+1}for(let L=u.length-1;L>=c;--L)u[L][0].length>_&&(c=L+1);let A="",P="",D=!1;for(let L=0;L_||ee[0]===" "?(P===" "?P=` `:!D&&P===` `&&(P=` -`),C+=P+H.slice(_)+te,P=` -`,D=!0):te===""?P===` -`?C+=` +`),A+=P+W.slice(_)+ee,P=` +`,D=!0):ee===""?P===` +`?A+=` `:P=` -`:(C+=P+te,P=" ",D=!1)}switch(n.chomp){case"-":break;case"+":for(let L=c;Li(s+P,D,j);switch(n){case"scalar":c=ti.PLAIN,_=Dq(a,w);break;case"single-quoted-scalar":c=ti.QUOTE_SINGLE,_=Fq(a,w);break;case"double-quoted-scalar":c=ti.QUOTE_DOUBLE,_=Nq(a,w);break;default:return i(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const S=s+a.length,C=Nm(u,S,e,i);return{value:_,type:c,comment:C.comment,range:[s,S,C.offset]}}function Dq(t,e){let i="";switch(t[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${t[0]}`;break}case"@":case"`":{i=`reserved character ${t[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),g3(t)}function Fq(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),g3(t.slice(1,-1)).replace(/''/g,"'")}function g3(t){let e,i;try{e=new RegExp(`(.*?)(?i(s+P,D,U);switch(n){case"scalar":c=ti.PLAIN,_=zq(a,w);break;case"single-quoted-scalar":c=ti.QUOTE_SINGLE,_=Uq(a,w);break;case"double-quoted-scalar":c=ti.QUOTE_DOUBLE,_=Vq(a,w);break;default:return i(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const S=s+a.length,A=Xg(u,S,e,i);return{value:_,type:c,comment:A.comment,range:[s,S,A.offset]}}function zq(t,e){let i="";switch(t[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${t[0]}`;break}case"@":case"`":{i=`reserved character ${t[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),x3(t)}function Uq(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),x3(t.slice(1,-1)).replace(/''/g,"'")}function x3(t){let e,i;try{e=new RegExp(`(.*?)(?a?t.slice(a,s+1):n)}else i+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),i}function Bq(t,e){let i="",s=t[e+1];for(;(s===" "||s===" "||s===` +`)&&(i+=s>a?t.slice(a,s+1):n)}else i+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),i}function jq(t,e){let i="",s=t[e+1];for(;(s===" "||s===" "||s===` `||s==="\r")&&!(s==="\r"&&t[e+2]!==` `);)s===` `&&(i+=` -`),e+=1,s=t[e+1];return i||(i=" "),{fold:i,offset:e}}const Lq={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zq(t,e,i,s){const n=t.substr(e,i),u=n.length===i&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(u)){const c=t.substr(e-2,i+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(u)}function _3(t,e,i,s){const{value:n,type:a,comment:u,range:c}=e.type==="block-scalar"?p3(t,e,s):m3(e,t.options.strict,s),_=i?t.directives.tagName(i.source,C=>s(i,"TAG_RESOLVE_FAILED",C)):null,w=i&&_?Uq(t.schema,n,_,i,s):e.type==="scalar"?Vq(t,n,e,s):t.schema[el];let S;try{const C=w.resolve(n,P=>s(i??e,"TAG_RESOLVE_FAILED",P),t.options);S=os(C)?C:new ti(C)}catch(C){const P=C instanceof Error?C.message:String(C);s(i??e,"TAG_RESOLVE_FAILED",P),S=new ti(n)}return S.range=c,S.source=n,a&&(S.type=a),_&&(S.tag=_),w.format&&(S.format=w.format),u&&(S.comment=u),S}function Uq(t,e,i,s,n){var c;if(i==="!")return t[el];const a=[];for(const _ of t.tags)if(!_.collection&&_.tag===i)if(_.default&&_.test)a.push(_);else return _;for(const _ of a)if((c=_.test)!=null&&c.test(e))return _;const u=t.knownTags[i];return u&&!u.collection?(t.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),t[el])}function Vq({directives:t,schema:e},i,s,n){const a=e.tags.find(u=>{var c;return u.default&&((c=u.test)==null?void 0:c.test(i))})||e[el];if(e.compat){const u=e.compat.find(c=>{var _;return c.default&&((_=c.test)==null?void 0:_.test(i))})??e[el];if(a.tag!==u.tag){const c=t.tagString(a.tag),_=t.tagString(u.tag),w=`Value may be parsed as either ${c} or ${_}`;n(s,"TAG_RESOLVE_FAILED",w,!0)}}return a}function jq(t,e,i){if(e){i===null&&(i=e.length);for(let s=i-1;s>=0;--s){let n=e[s];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++s];(n==null?void 0:n.type)==="space";)t+=n.source.length,n=e[++s];break}}return t}const $q={composeNode:y3,composeEmptyNode:fT};function y3(t,e,i,s){const{spaceBefore:n,comment:a,anchor:u,tag:c}=i;let _,w=!0;switch(e.type){case"alias":_=Wq(t,e,s),(u||c)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":_=_3(t,e,c,s),u&&(_.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":_=Mq($q,t,e,i,s),u&&(_.anchor=u.source.substring(1));break;default:{const S=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",S),_=fT(t,e.offset,void 0,null,i,s),w=!1}}return u&&_.anchor===""&&s(u,"BAD_ALIAS","Anchor cannot be an empty string"),n&&(_.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?_.comment=a:_.commentBefore=a),t.options.keepSourceTokens&&w&&(_.srcToken=e),_}function fT(t,e,i,s,{spaceBefore:n,comment:a,anchor:u,tag:c,end:_},w){const S={type:"scalar",offset:jq(e,i,s),indent:-1,source:""},C=_3(t,S,c,w);return u&&(C.anchor=u.source.substring(1),C.anchor===""&&w(u,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(C.spaceBefore=!0),a&&(C.comment=a,C.range[2]=_),C}function Wq({options:t},{offset:e,source:i,end:s},n){const a=new O0(i.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=e+i.length,c=Nm(s,u,t.strict,n);return a.range=[e,u,c.offset],c.comment&&(a.comment=c.comment),a}function Hq(t,e,{offset:i,start:s,value:n,end:a},u){const c=Object.assign({_directives:e},t),_=new Ud(void 0,c),w={atRoot:!0,directives:_.directives,options:_.options,schema:_.schema},S=Ad(s,{indicator:"doc-start",next:n??(a==null?void 0:a[0]),offset:i,onError:u,parentIndent:0,startOnNewline:!0});S.found&&(_.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!S.hasNewline&&u(S.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),_.contents=n?y3(w,n,S,u):fT(w,S.end,s,null,S,u);const C=_.contents.range[2],P=Nm(a,C,!1,u);return P.comment&&(_.comment=P.comment),_.range=[i,C,P.offset],_}function Tp(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:i}=t;return[e,e+(typeof i=="string"?i.length:1)]}function wC(t){var n;let e="",i=!1,s=!1;for(let a=0;as(i,"TAG_RESOLVE_FAILED",A)):null;let w;t.options.stringKeys&&t.atKey?w=t.schema[ya]:_?w=Wq(t.schema,n,_,i,s):e.type==="scalar"?w=qq(t,n,e,s):w=t.schema[ya];let S;try{const A=w.resolve(n,P=>s(i??e,"TAG_RESOLVE_FAILED",P),t.options);S=Ji(A)?A:new ti(A)}catch(A){const P=A instanceof Error?A.message:String(A);s(i??e,"TAG_RESOLVE_FAILED",P),S=new ti(n)}return S.range=c,S.source=n,a&&(S.type=a),_&&(S.tag=_),w.format&&(S.format=w.format),u&&(S.comment=u),S}function Wq(t,e,i,s,n){var c;if(i==="!")return t[ya];const a=[];for(const _ of t.tags)if(!_.collection&&_.tag===i)if(_.default&&_.test)a.push(_);else return _;for(const _ of a)if((c=_.test)!=null&&c.test(e))return _;const u=t.knownTags[i];return u&&!u.collection?(t.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),t[ya])}function qq({atKey:t,directives:e,schema:i},s,n,a){const u=i.tags.find(c=>{var _;return(c.default===!0||t&&c.default==="key")&&((_=c.test)==null?void 0:_.test(s))})||i[ya];if(i.compat){const c=i.compat.find(_=>{var w;return _.default&&((w=_.test)==null?void 0:w.test(s))})??i[ya];if(u.tag!==c.tag){const _=e.tagString(u.tag),w=e.tagString(c.tag),S=`Value may be parsed as either ${_} or ${w}`;a(n,"TAG_RESOLVE_FAILED",S,!0)}}return u}function Xq(t,e,i){if(e){i===null&&(i=e.length);for(let s=i-1;s>=0;--s){let n=e[s];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++s];(n==null?void 0:n.type)==="space";)t+=n.source.length,n=e[++s];break}}return t}const Zq={composeNode:T3,composeEmptyNode:bT};function T3(t,e,i,s){const n=t.atKey,{spaceBefore:a,comment:u,anchor:c,tag:_}=i;let w,S=!0;switch(e.type){case"alias":w=Yq(t,e,s),(c||_)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":w=w3(t,e,_,s),c&&(w.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":w=Nq(Zq,t,e,i,s),c&&(w.anchor=c.source.substring(1));break;default:{const A=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",A),w=bT(t,e.offset,void 0,null,i,s),S=!1}}return c&&w.anchor===""&&s(c,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!Ji(w)||typeof w.value!="string"||w.tag&&w.tag!=="tag:yaml.org,2002:str")&&s(_??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(w.spaceBefore=!0),u&&(e.type==="scalar"&&e.source===""?w.comment=u:w.commentBefore=u),t.options.keepSourceTokens&&S&&(w.srcToken=e),w}function bT(t,e,i,s,{spaceBefore:n,comment:a,anchor:u,tag:c,end:_},w){const S={type:"scalar",offset:Xq(e,i,s),indent:-1,source:""},A=w3(t,S,c,w);return u&&(A.anchor=u.source.substring(1),A.anchor===""&&w(u,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(A.spaceBefore=!0),a&&(A.comment=a,A.range[2]=_),A}function Yq({options:t},{offset:e,source:i,end:s},n){const a=new M0(i.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=e+i.length,c=Xg(s,u,t.strict,n);return a.range=[e,u,c.offset],c.comment&&(a.comment=c.comment),a}function Kq(t,e,{offset:i,start:s,value:n,end:a},u){const c=Object.assign({_directives:e},t),_=new nd(void 0,c),w={atKey:!1,atRoot:!0,directives:_.directives,options:_.options,schema:_.schema},S=Wf(s,{indicator:"doc-start",next:n??(a==null?void 0:a[0]),offset:i,onError:u,parentIndent:0,startOnNewline:!0});S.found&&(_.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!S.hasNewline&&u(S.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),_.contents=n?T3(w,n,S,u):bT(w,S.end,s,null,S,u);const A=_.contents.range[2],P=Xg(a,A,!1,u);return P.comment&&(_.comment=P.comment),_.range=[i,A,P.offset],_}function kp(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:i}=t;return[e,e+(typeof i=="string"?i.length:1)]}function vC(t){var n;let e="",i=!1,s=!1;for(let a=0;a{const u=Tp(i);a?this.warnings.push(new d3(u,s,n)):this.errors.push(new fu(u,s,n))},this.directives=new Qn({version:e.version||"1.2"}),this.options=e}decorate(e,i){const{comment:s,afterEmptyLine:n}=wC(this.prelude);if(s){const a=e.contents;if(i)e.comment=e.comment?`${e.comment} -${s}`:s;else if(n||e.directives.docStart||!a)e.commentBefore=s;else if(bs(a)&&!a.flow&&a.items.length>0){let u=a.items[0];ms(u)&&(u=u.key);const c=u.commentBefore;u.commentBefore=c?`${s} +`)+(u.substring(1)||" "),i=!0,s=!1;break;case"%":((n=t[a+1])==null?void 0:n[0])!=="#"&&(a+=1),i=!1;break;default:i||(s=!0),i=!1}}return{comment:e,afterEmptyLine:s}}class vT{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,s,n,a)=>{const u=kp(i);a?this.warnings.push(new _3(u,s,n)):this.errors.push(new Tu(u,s,n))},this.directives=new ir({version:e.version||"1.2"}),this.options=e}decorate(e,i){const{comment:s,afterEmptyLine:n}=vC(this.prelude);if(s){const a=e.contents;if(i)e.comment=e.comment?`${e.comment} +${s}`:s;else if(n||e.directives.docStart||!a)e.commentBefore=s;else if(vs(a)&&!a.flow&&a.items.length>0){let u=a.items[0];ms(u)&&(u=u.key);const c=u.commentBefore;u.commentBefore=c?`${s} ${c}`:s}else{const u=a.commentBefore;a.commentBefore=u?`${s} -${u}`:s}}i?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:wC(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,s=-1){for(const n of e)yield*this.next(n);yield*this.end(i,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(i,s,n)=>{const a=Tp(e);a[0]+=i,this.onError(a,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const i=Hq(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new fu(Tp(e),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new fu(Tp(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const i=Nm(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const s=this.doc.comment;this.doc.comment=s?`${s} -${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new fu(Tp(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),n=new Ud(void 0,s);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,i,i],this.decorate(n,!1),yield n}}}function qq(t,e=!0,i){if(t){const s=(n,a,u)=>{const c=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(i)i(c,a,u);else throw new fu([c,c+1],a,u)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return m3(t,e,s);case"block-scalar":return p3({options:{strict:e}},t,s)}}return null}function Xq(t,e){const{implicitKey:i=!1,indent:s,inFlow:n=!1,offset:a=-1,type:u="PLAIN"}=e,c=Dm({type:u,value:t},{implicitKey:i,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),_=e.end??[{type:"newline",offset:-1,indent:s,source:` +${u}`:s}}i?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vC(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,s=-1){for(const n of e)yield*this.next(n);yield*this.end(i,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(i,s,n)=>{const a=kp(e);a[0]+=i,this.onError(a,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const i=Kq(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Tu(kp(e),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Tu(kp(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const i=Xg(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const s=this.doc.comment;this.doc.comment=s?`${s} +${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Tu(kp(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),n=new nd(void 0,s);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,i,i],this.decorate(n,!1),yield n}}}function Jq(t,e=!0,i){if(t){const s=(n,a,u)=>{const c=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(i)i(c,a,u);else throw new Tu([c,c+1],a,u)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return v3(t,e,s);case"block-scalar":return b3({options:{strict:e}},t,s)}}return null}function Gq(t,e){const{implicitKey:i=!1,indent:s,inFlow:n=!1,offset:a=-1,type:u="PLAIN"}=e,c=Wg({type:u,value:t},{implicitKey:i,indent:s>0?" ".repeat(s):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),_=e.end??[{type:"newline",offset:-1,indent:s,source:` `}];switch(c[0]){case"|":case">":{const w=c.indexOf(` -`),S=c.substring(0,w),C=c.substring(w+1)+` -`,P=[{type:"block-scalar-header",offset:a,indent:s,source:S}];return b3(P,_)||P.push({type:"newline",offset:-1,indent:s,source:` -`}),{type:"block-scalar",offset:a,indent:s,props:P,source:C}}case'"':return{type:"double-quoted-scalar",offset:a,indent:s,source:c,end:_};case"'":return{type:"single-quoted-scalar",offset:a,indent:s,source:c,end:_};default:return{type:"scalar",offset:a,indent:s,source:c,end:_}}}function Zq(t,e,i={}){let{afterKey:s=!1,implicitKey:n=!1,inFlow:a=!1,type:u}=i,c="indent"in t?t.indent:null;if(s&&typeof c=="number"&&(c+=2),!u)switch(t.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const w=t.props[0];if(w.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=w.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const _=Dm({type:u,value:e},{implicitKey:n||c===null,indent:c!==null&&c>0?" ".repeat(c):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(_[0]){case"|":case">":Kq(t,_);break;case'"':Px(t,_,"double-quoted-scalar");break;case"'":Px(t,_,"single-quoted-scalar");break;default:Px(t,_,"scalar")}}function Kq(t,e){const i=e.indexOf(` +`),S=c.substring(0,w),A=c.substring(w+1)+` +`,P=[{type:"block-scalar-header",offset:a,indent:s,source:S}];return S3(P,_)||P.push({type:"newline",offset:-1,indent:s,source:` +`}),{type:"block-scalar",offset:a,indent:s,props:P,source:A}}case'"':return{type:"double-quoted-scalar",offset:a,indent:s,source:c,end:_};case"'":return{type:"single-quoted-scalar",offset:a,indent:s,source:c,end:_};default:return{type:"scalar",offset:a,indent:s,source:c,end:_}}}function Qq(t,e,i={}){let{afterKey:s=!1,implicitKey:n=!1,inFlow:a=!1,type:u}=i,c="indent"in t?t.indent:null;if(s&&typeof c=="number"&&(c+=2),!u)switch(t.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const w=t.props[0];if(w.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=w.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const _=Wg({type:u,value:e},{implicitKey:n||c===null,indent:c!==null&&c>0?" ".repeat(c):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(_[0]){case"|":case">":eX(t,_);break;case'"':Bx(t,_,"double-quoted-scalar");break;case"'":Bx(t,_,"single-quoted-scalar");break;default:Bx(t,_,"scalar")}}function eX(t,e){const i=e.indexOf(` `),s=e.substring(0,i),n=e.substring(i+1)+` -`;if(t.type==="block-scalar"){const a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=s,t.source=n}else{const{offset:a}=t,u="indent"in t?t.indent:-1,c=[{type:"block-scalar-header",offset:a,indent:u,source:s}];b3(c,"end"in t?t.end:void 0)||c.push({type:"newline",offset:-1,indent:u,source:` -`});for(const _ of Object.keys(t))_!=="type"&&_!=="offset"&&delete t[_];Object.assign(t,{type:"block-scalar",indent:u,props:c,source:n})}}function b3(t,e){if(e)for(const i of e)switch(i.type){case"space":case"comment":t.push(i);break;case"newline":return t.push(i),!0}return!1}function Px(t,e,i){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=i,t.source=e;break;case"block-scalar":{const s=t.props.slice(1);let n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(const a of s)a.offset+=n;delete t.props,Object.assign(t,{type:i,source:e,end:s});break}case"block-map":case"block-seq":{const n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:i,source:e,end:[n]});break}default:{const s="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(const a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:i,indent:s,source:e,end:n})}}}const Yq=t=>"type"in t?Ry(t):W_(t);function Ry(t){switch(t.type){case"block-scalar":{let e="";for(const i of t.props)e+=Ry(i);return e+t.source}case"block-map":case"block-seq":{let e="";for(const i of t.items)e+=W_(i);return e}case"flow-collection":{let e=t.start.source;for(const i of t.items)e+=W_(i);for(const i of t.end)e+=i.source;return e}case"document":{let e=W_(t);if(t.end)for(const i of t.end)e+=i.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const i of t.end)e+=i.source;return e}}}function W_({start:t,key:e,sep:i,value:s}){let n="";for(const a of t)n+=a.source;if(e&&(n+=Ry(e)),i)for(const a of i)n+=a.source;return s&&(n+=Ry(s)),n}const Kw=Symbol("break visit"),Jq=Symbol("skip children"),v3=Symbol("remove item");function Au(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),x3(Object.freeze([]),t,e)}Au.BREAK=Kw;Au.SKIP=Jq;Au.REMOVE=v3;Au.itemAtPath=(t,e)=>{let i=t;for(const[s,n]of e){const a=i==null?void 0:i[s];if(a&&"items"in a)i=a.items[n];else return}return i};Au.parentCollection=(t,e)=>{const i=Au.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],n=i==null?void 0:i[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function x3(t,e,i){let s=i(e,t);if(typeof s=="symbol")return s;for(const n of["key","value"]){const a=e[n];if(a&&"items"in a){for(let u=0;u!!t&&"items"in t,Qq=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function eX(t){switch(t){case $0:return"";case W0:return"";case H0:return"";case mm:return"";default:return JSON.stringify(t)}}function w3(t){switch(t){case $0:return"byte-order-mark";case W0:return"doc-mode";case H0:return"flow-error-end";case mm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){const a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=s,t.source=n}else{const{offset:a}=t,u="indent"in t?t.indent:-1,c=[{type:"block-scalar-header",offset:a,indent:u,source:s}];S3(c,"end"in t?t.end:void 0)||c.push({type:"newline",offset:-1,indent:u,source:` +`});for(const _ of Object.keys(t))_!=="type"&&_!=="offset"&&delete t[_];Object.assign(t,{type:"block-scalar",indent:u,props:c,source:n})}}function S3(t,e){if(e)for(const i of e)switch(i.type){case"space":case"comment":t.push(i);break;case"newline":return t.push(i),!0}return!1}function Bx(t,e,i){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=i,t.source=e;break;case"block-scalar":{const s=t.props.slice(1);let n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(const a of s)a.offset+=n;delete t.props,Object.assign(t,{type:i,source:e,end:s});break}case"block-map":case"block-seq":{const n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:i,source:e,end:[n]});break}default:{const s="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(const a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:i,indent:s,source:e,end:n})}}}const tX=t=>"type"in t?Dy(t):K_(t);function Dy(t){switch(t.type){case"block-scalar":{let e="";for(const i of t.props)e+=Dy(i);return e+t.source}case"block-map":case"block-seq":{let e="";for(const i of t.items)e+=K_(i);return e}case"flow-collection":{let e=t.start.source;for(const i of t.items)e+=K_(i);for(const i of t.end)e+=i.source;return e}case"document":{let e=K_(t);if(t.end)for(const i of t.end)e+=i.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const i of t.end)e+=i.source;return e}}}function K_({start:t,key:e,sep:i,value:s}){let n="";for(const a of t)n+=a.source;if(e&&(n+=Dy(e)),i)for(const a of i)n+=a.source;return s&&(n+=Dy(s)),n}const Qw=Symbol("break visit"),iX=Symbol("skip children"),E3=Symbol("remove item");function Bu(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),A3(Object.freeze([]),t,e)}Bu.BREAK=Qw;Bu.SKIP=iX;Bu.REMOVE=E3;Bu.itemAtPath=(t,e)=>{let i=t;for(const[s,n]of e){const a=i==null?void 0:i[s];if(a&&"items"in a)i=a.items[n];else return}return i};Bu.parentCollection=(t,e)=>{const i=Bu.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],n=i==null?void 0:i[s];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function A3(t,e,i){let s=i(e,t);if(typeof s=="symbol")return s;for(const n of["key","value"]){const a=e[n];if(a&&"items"in a){for(let u=0;u!!t&&"items"in t,nX=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function rX(t){switch(t){case U0:return"";case V0:return"";case j0:return"";case Sg:return"";default:return JSON.stringify(t)}}function I3(t){switch(t){case U0:return"byte-order-mark";case V0:return"doc-mode";case j0:return"flow-error-end";case Sg:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const tX=Object.freeze(Object.defineProperty({__proto__:null,BOM:$0,DOCUMENT:W0,FLOW_END:H0,SCALAR:mm,createScalarToken:Xq,isCollection:Gq,isScalar:Qq,prettyToken:eX,resolveAsScalar:qq,setScalarValue:Zq,stringify:Yq,tokenType:w3,visit:Au},Symbol.toStringTag,{value:"Module"}));function Ao(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const TC=new Set("0123456789ABCDEFabcdef"),iX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),I_=new Set(",[]{}"),sX=new Set(` ,[]{} -\r `),Rx=t=>!t||sX.has(t);class T3{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,i=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!i;let s=this.next??"stream";for(;s&&(i||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i===" ";)i=this.buffer[++e];return!i||i==="#"||i===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const oX=Object.freeze(Object.defineProperty({__proto__:null,BOM:U0,DOCUMENT:V0,FLOW_END:j0,SCALAR:Sg,createScalarToken:Gq,isCollection:sX,isScalar:nX,prettyToken:rX,resolveAsScalar:Jq,setScalarValue:Qq,stringify:tX,tokenType:I3,visit:Bu},Symbol.toStringTag,{value:"Module"}));function Mo(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const xC=new Set("0123456789ABCDEFabcdef"),aX=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),k_=new Set(",[]{}"),lX=new Set(` ,[]{} +\r `),Lx=t=>!t||lX.has(t);class C3{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,i=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!i;let s=this.next??"stream";for(;s&&(i||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i===" ";)i=this.buffer[++e];return!i||i==="#"||i===` `?!0:i==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let i=this.buffer[e];if(this.indentNext>0){let s=0;for(;i===" ";)i=this.buffer[++s+e];if(i==="\r"){const n=this.buffer[s+e+1];if(n===` `||!n&&!this.atEnd)return e+s+1}return i===` -`||s>=this.indentNext||!i&&!this.atEnd?e+s:-1}if(i==="-"||i==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&Ao(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Ao(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ao(i)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rx),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,s=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=s=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>0);const n=this.getLine();if(n===null)return this.setNext("flow");if((s!==-1&&s=this.indentNext||!i&&!this.atEnd?e+s:-1}if(i==="-"||i==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&Mo(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Mo(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Mo(i)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Lx),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,s=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=s=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>0);const n=this.getLine();if(n===null)return this.setNext("flow");if((s!==-1&&s"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Ao(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":i+=1;break;case` +`,a)}n!==-1&&(i=n-(s[n-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const i=this.buffer[++e];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Mo(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":i+=1;break;case` `:e=a,i=0;break;case"\r":{const u=this.buffer[a+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===` `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(` `,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(s=this.buffer[n];s===" ";)s=this.buffer[++n];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===` `;)s=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let a=e-1,u=this.buffer[a];u==="\r"&&(u=this.buffer[--a]);const c=a;for(;u===" ";)u=this.buffer[--a];if(u===` -`&&a>=this.pos&&a+1+i>c)e=a;else break}while(!0);return yield mm,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let i=this.pos-1,s=this.pos-1,n;for(;n=this.buffer[++s];)if(n===":"){const a=this.buffer[s+1];if(Ao(a)||e&&I_.has(a))break;i=s}else if(Ao(n)){let a=this.buffer[s+1];if(n==="\r"&&(a===` +`&&a>=this.pos&&a+1+i>c)e=a;else break}while(!0);return yield Sg,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let i=this.pos-1,s=this.pos-1,n;for(;n=this.buffer[++s];)if(n===":"){const a=this.buffer[s+1];if(Mo(a)||e&&k_.has(a))break;i=s}else if(Mo(n)){let a=this.buffer[s+1];if(n==="\r"&&(a===` `?(s+=1,n=` -`,a=this.buffer[s+1]):i=s),a==="#"||e&&I_.has(a))break;if(n===` -`){const u=this.continueScalar(s+1);if(u===-1)break;s=Math.max(s,u-2)}}else{if(e&&I_.has(n))break;i=s}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield mm,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Rx))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,i=this.charAt(1);if(Ao(i)||e&&I_.has(i))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,i=this.buffer[e];for(;!Ao(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(iX.has(i))i=this.buffer[++e];else if(i==="%"&&TC.has(this.buffer[e+1])&&TC.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` +`,a=this.buffer[s+1]):i=s),a==="#"||e&&k_.has(a))break;if(n===` +`){const u=this.continueScalar(s+1);if(u===-1)break;s=Math.max(s,u-2)}}else{if(e&&k_.has(n))break;i=s}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Sg,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Lx))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,i=this.charAt(1);if(Mo(i)||e&&k_.has(i))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,i=this.buffer[e];for(;!Mo(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(aX.has(i))i=this.buffer[++e];else if(i==="%"&&xC.has(this.buffer[e+1])&&xC.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let i=this.pos-1,s;do s=this.buffer[++i];while(s===" "||e&&s===" ");const n=i-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=i),n}*pushUntil(e){let i=this.pos,s=this.buffer[i];for(;!e(s);)s=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class S3{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,s=this.lineStarts.length;for(;i>1;this.lineStarts[a]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((i=t[++e])==null?void 0:i.type)==="space";);return t.splice(e,t.length)}function EC(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!ru(e.start,"explicit-key-ind")&&!ru(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,E3(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class mT{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new T3,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,i))yield*this.next(s);i||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const i=w3(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const i=e??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const s=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in s?s.indent:0:i.type==="flow-collection"&&s.type==="document"&&(i.indent=0),i.type==="flow-collection"&&EC(i),s.type){case"document":s.value=i;break;case"block-scalar":s.props.push(i);break;case"block-map":{const n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=i;else{Object.assign(n,{key:i,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{const n=s.items[s.items.length-1];n.value?s.items.push({start:[],value:i}):n.value=i;break}case"flow-collection":{const n=s.items[s.items.length-1];!n||n.value?s.items.push({start:[],key:i,sep:[]}):n.sep?n.value=i:Object.assign(n,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const n=i.items[i.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&SC(n.start)===-1&&(i.indent===0||n.start.every(a=>a.type!=="comment"||a.indent0&&(yield this.buffer.substr(this.pos,n),this.pos=i),n}*pushUntil(e){let i=this.pos,s=this.buffer[i];for(;!e(s);)s=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class P3{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,s=this.lineStarts.length;for(;i>1;this.lineStarts[a]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((i=t[++e])==null?void 0:i.type)==="space";);return t.splice(e,t.length)}function TC(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!gu(e.start,"explicit-key-ind")&&!gu(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,M3(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class xT{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new C3,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,i))yield*this.next(s);i||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const i=I3(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const i=e??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const s=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in s?s.indent:0:i.type==="flow-collection"&&s.type==="document"&&(i.indent=0),i.type==="flow-collection"&&TC(i),s.type){case"document":s.value=i;break;case"block-scalar":s.props.push(i);break;case"block-map":{const n=s.items[s.items.length-1];if(n.value){s.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=i;else{Object.assign(n,{key:i,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{const n=s.items[s.items.length-1];n.value?s.items.push({start:[],value:i}):n.value=i;break}case"flow-collection":{const n=s.items[s.items.length-1];!n||n.value?s.items.push({start:[],key:i,sep:[]}):n.sep?n.value=i:Object.assign(n,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const n=i.items[i.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&wC(n.start)===-1&&(i.indent===0||n.start.every(a=>a.type!=="comment"||a.indent=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,a=n&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(a&&i.sep&&!i.value){const c=[];for(let _=0;_e.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(u=i.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":a||i.value?(u.push(this.sourceToken),e.items.push({start:u}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):a||i.value?(u.push(this.sourceToken),e.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ru(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(E3(i.key)&&!ru(i.sep,"newline")){const c=Lh(i.start),_=i.key,w=i.sep;w.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:_,sep:w}]})}else u.length>0?i.sep=i.sep.concat(u,this.sourceToken):i.sep.push(this.sourceToken);else if(ru(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const c=Lh(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||a?e.items.push({start:u,key:null,sep:[this.sourceToken]}):ru(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);a||i.value?(e.items.push({start:u,key:c,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(c):(Object.assign(i,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(e);if(c){n&&c.type!=="block-seq"&&e.items.push({start:u}),this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){const n="end"in i.value?i.value.end:void 0,a=Array.isArray(n)?n[n.length-1]:void 0;(a==null?void 0:a.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){const n=e.items[e.items.length-2],a=(s=n==null?void 0:n.value)==null?void 0:s.end;if(Array.isArray(a)){Array.prototype.push.apply(a,i.start),a.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||ru(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){const n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:n,sep:[]}):i.sep?this.stack.push(n):Object.assign(i,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const n=C_(s),a=Lh(n);EC(e);const u=e.end.splice(1,e.end.length);u.push(this.sourceToken);const c={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(` +`,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const n="end"in i.value?i.value.end:void 0,a=Array.isArray(n)?n[n.length-1]:void 0;(a==null?void 0:a.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){const n=e.items[e.items.length-2],a=(s=n==null?void 0:n.value)==null?void 0:s.end;if(Array.isArray(a)){Array.prototype.push.apply(a,i.start),a.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,a=n&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(a&&i.sep&&!i.value){const c=[];for(let _=0;_e.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(u=i.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":a||i.value?(u.push(this.sourceToken),e.items.push({start:u}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):a||i.value?(u.push(this.sourceToken),e.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gu(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(M3(i.key)&&!gu(i.sep,"newline")){const c=tf(i.start),_=i.key,w=i.sep;w.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:_,sep:w}]})}else u.length>0?i.sep=i.sep.concat(u,this.sourceToken):i.sep.push(this.sourceToken);else if(gu(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const c=tf(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||a?e.items.push({start:u,key:null,sep:[this.sourceToken]}):gu(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);a||i.value?(e.items.push({start:u,key:c,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(c):(Object.assign(i,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(e);if(c){n&&c.type!=="block-seq"&&e.items.push({start:u}),this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){const n="end"in i.value?i.value.end:void 0,a=Array.isArray(n)?n[n.length-1]:void 0;(a==null?void 0:a.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){const n=e.items[e.items.length-2],a=(s=n==null?void 0:n.value)==null?void 0:s.end;if(Array.isArray(a)){Array.prototype.push.apply(a,i.start),a.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||gu(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){const n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:n,sep:[]}):i.sep?this.stack.push(n):Object.assign(i,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const n=O_(s),a=tf(n);TC(e);const u=e.end.splice(1,e.end.length);u.push(this.sourceToken);const c={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(` `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(` -`,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=C_(e),s=Lh(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=C_(e),s=Lh(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function A3(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new S3||null,prettyErrors:e}}function nX(t,e={}){const{lineCounter:i,prettyErrors:s}=A3(e),n=new mT(i==null?void 0:i.addNewLine),a=new pT(e),u=Array.from(a.compose(n.parse(t)));if(s&&i)for(const c of u)c.errors.forEach(Py(t,i)),c.warnings.forEach(Py(t,i));return u.length>0?u:Object.assign([],{empty:!0},a.streamInfo())}function I3(t,e={}){const{lineCounter:i,prettyErrors:s}=A3(e),n=new mT(i==null?void 0:i.addNewLine),a=new pT(e);let u=null;for(const c of a.compose(n.parse(t),!0,t.length))if(!u)u=c;else if(u.options.logLevel!=="silent"){u.errors.push(new fu(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(Py(t,i)),u.warnings.forEach(Py(t,i))),u}function rX(t,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const n=I3(t,i);if(!n)return null;if(n.warnings.forEach(a=>Zk(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},i))}function oX(t,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const n=Math.round(i);i=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){const{keepUndefined:n}=i??e??{};if(!n)return}return new Ud(t,s,i).toString(i)}const aX=Object.freeze(Object.defineProperty({__proto__:null,Alias:O0,CST:tX,Composer:pT,Document:Ud,Lexer:T3,LineCounter:S3,Pair:Ln,Parser:mT,Scalar:ti,Schema:j0,YAMLError:dT,YAMLMap:Hr,YAMLParseError:fu,YAMLSeq:ac,YAMLWarning:d3,isAlias:Du,isCollection:bs,isDocument:Fd,isMap:Nd,isNode:Es,isPair:ms,isScalar:os,isSeq:Bd,parse:rX,parseAllDocuments:nX,parseDocument:I3,stringify:oX,visit:oc,visitAsync:k0},Symbol.toStringTag,{value:"Module"}));var C3={exports:{}};/** +`,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=O_(e),s=tf(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=O_(e),s=tf(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function R3(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new P3||null,prettyErrors:e}}function cX(t,e={}){const{lineCounter:i,prettyErrors:s}=R3(e),n=new xT(i==null?void 0:i.addNewLine),a=new vT(e),u=Array.from(a.compose(n.parse(t)));if(s&&i)for(const c of u)c.errors.forEach(Oy(t,i)),c.warnings.forEach(Oy(t,i));return u.length>0?u:Object.assign([],{empty:!0},a.streamInfo())}function k3(t,e={}){const{lineCounter:i,prettyErrors:s}=R3(e),n=new xT(i==null?void 0:i.addNewLine),a=new vT(e);let u=null;for(const c of a.compose(n.parse(t),!0,t.length))if(!u)u=c;else if(u.options.logLevel!=="silent"){u.errors.push(new Tu(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(Oy(t,i)),u.warnings.forEach(Oy(t,i))),u}function uX(t,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const n=k3(t,i);if(!n)return null;if(n.warnings.forEach(a=>Gk(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:s},i))}function hX(t,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const n=Math.round(i);i=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){const{keepUndefined:n}=i??e??{};if(!n)return}return qu(t)&&!s?t.toString(i):new nd(t,s,i).toString(i)}const fX=Object.freeze(Object.defineProperty({__proto__:null,Alias:M0,CST:oX,Composer:vT,Document:nd,Lexer:C3,LineCounter:P3,Pair:jn,Parser:xT,Scalar:ti,Schema:z0,YAMLError:yT,YAMLMap:Zr,YAMLParseError:Tu,YAMLSeq:mc,YAMLWarning:_3,isAlias:Wu,isCollection:vs,isDocument:qu,isMap:ed,isNode:xs,isPair:ms,isScalar:Ji,isSeq:td,parse:uX,parseAllDocuments:cX,parseDocument:k3,stringify:hX,visit:gc,visitAsync:P0},Symbol.toStringTag,{value:"Module"}));var O3={exports:{}};/** * MapLibre GL JS - * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.5.2/LICENSE.txt - */(function(t,e){(function(i,s){t.exports=s()})(IW,function(){var i={},s={};function n(u,c,_){if(s[u]=_,u==="index"){var w="var sharedModule = {}; ("+s.shared+")(sharedModule); ("+s.worker+")(sharedModule);",S={};return s.shared(S),s.index(i,S),typeof window<"u"&&i.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),i}}n("shared",["exports"],function(u){function c(l,r,h,f){return new(h||(h=Promise))(function(g,v){function x(R){try{A(f.next(R))}catch(O){v(O)}}function T(R){try{A(f.throw(R))}catch(O){v(O)}}function A(R){var O;R.done?g(R.value):(O=R.value,O instanceof h?O:new h(function(F){F(O)})).then(x,T)}A((f=f.apply(l,r||[])).next())})}function _(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}typeof SuppressedError=="function"&&SuppressedError;var w=S;function S(l,r){this.x=l,this.y=r}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,r){return this.clone()._rotateAround(l,r)},matMult:function(l){return this.clone()._matMult(l)},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(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var r=l.x-this.x,h=l.y-this.y;return r*r+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,r){return Math.atan2(this.x*r-this.y*l,this.x*l+this.y*r)},_matMult:function(l){var r=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=r,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var r=Math.cos(l),h=Math.sin(l),f=h*this.x+r*this.y;return this.x=r*this.x-h*this.y,this.y=f,this},_rotateAround:function(l,r){var h=Math.cos(l),f=Math.sin(l),g=r.y+f*(this.x-r.x)+h*(this.y-r.y);return this.x=r.x+h*(this.x-r.x)-f*(this.y-r.y),this.y=g,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},S.convert=function(l){return l instanceof S?l:Array.isArray(l)?new S(l[0],l[1]):l};var C=_(w),P=D;function D(l,r,h,f){this.cx=3*l,this.bx=3*(h-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(f-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=r,this.p2x=h,this.p2y=f}D.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,r){if(r===void 0&&(r=1e-6),l<0)return 0;if(l>1)return 1;for(var h=l,f=0;f<8;f++){var g=this.sampleCurveX(h)-l;if(Math.abs(g)g?x=h:T=h,h=.5*(T-x)+x;return h},solve:function(l,r){return this.sampleCurveY(this.solveCurveX(l,r))}};var j=_(P);let L,H;function te(){return L==null&&(L=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),L}function G(){if(H==null&&(H=!1,te())){const r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let f=0;f<5*5;f++){const g=4*f;r.fillStyle=`rgb(${g},${g+1},${g+2})`,r.fillRect(f%5,Math.floor(f/5),1,1)}const h=r.getImageData(0,0,5,5).data;for(let f=0;f<5*5*4;f++)if(f%4!=3&&h[f]!==f){H=!0;break}}}return H||!1}function se(l,r,h,f){const g=new j(l,r,h,f);return v=>g.solve(v)}const ve=se(.25,.1,.25,1);function Se(l,r,h){return Math.min(h,Math.max(r,l))}function ge(l,r,h){const f=h-r,g=((l-r)%f+f)%f+r;return g===r?h:g}function De(l,...r){for(const h of r)for(const f in h)l[f]=h[f];return l}let Fe=1;function Be(l,r,h){const f={};for(const g in l)f[g]=r.call(this,l[g],g,l);return f}function Qe(l,r,h){const f={};for(const g in l)r.call(this,l[g],g,l)&&(f[g]=l[g]);return f}function He(l){return Array.isArray(l)?l.map(He):typeof l=="object"&&l?Be(l,He):l}const Xe={};function dt(l){Xe[l]||(typeof console<"u"&&console.warn(l),Xe[l]=!0)}function yt(l,r,h){return(h.y-l.y)*(r.x-l.x)>(r.y-l.y)*(h.x-l.x)}function Ft(l){return typeof WorkerGlobalScope<"u"&&l!==void 0&&l instanceof WorkerGlobalScope}let jt=null;function kt(l){return typeof ImageBitmap<"u"&&l instanceof ImageBitmap}const Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function bi(l,r,h,f,g){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const v=new VideoFrame(l,{timestamp:0});try{const x=v==null?void 0:v.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const T=x.startsWith("BGR"),A=new Uint8ClampedArray(f*g*4);if(yield v.copyTo(A,function(R,O,F,z,$){const q=4*Math.max(-O,0),K=(Math.max(0,F)-F)*z*4+q,ae=4*z,de=Math.max(0,O),Re=Math.max(0,F);return{rect:{x:de,y:Re,width:Math.min(R.width,O+z)-de,height:Math.min(R.height,F+$)-Re},layout:[{offset:K,stride:ae}]}}(l,r,h,f,g)),T)for(let R=0;RFt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,gi=function(l,r){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){const f=An(l.url);if(f)return f(l,r);if(Ft(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:l,targetMapId:In},r)}if(!(/^file:/.test(h=l.url)||/^file:/.test(as())&&!/^\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(f,g){return c(this,void 0,void 0,function*(){const v=new Request(f.url,{method:f.method||"GET",body:f.body,credentials:f.credentials,headers:f.headers,cache:f.cache,referrer:as(),signal:g.signal});f.type!=="json"||v.headers.has("Accept")||v.headers.set("Accept","application/json");const x=yield fetch(v);if(!x.ok){const R=yield x.blob();throw new hi(x.status,x.statusText,f.url,R)}let T;T=f.type==="arrayBuffer"||f.type==="image"?x.arrayBuffer():f.type==="json"?x.json():x.text();const A=yield T;if(g.signal.aborted)throw Hs();return{data:A,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(l,r);if(Ft(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:l,mustQueue:!0,targetMapId:In},r)}var h;return function(f,g){return new Promise((v,x)=>{var T;const A=new XMLHttpRequest;A.open(f.method||"GET",f.url,!0),f.type!=="arrayBuffer"&&f.type!=="image"||(A.responseType="arraybuffer");for(const R in f.headers)A.setRequestHeader(R,f.headers[R]);f.type==="json"&&(A.responseType="text",!((T=f.headers)===null||T===void 0)&&T.Accept||A.setRequestHeader("Accept","application/json")),A.withCredentials=f.credentials==="include",A.onerror=()=>{x(new Error(A.statusText))},A.onload=()=>{if(!g.signal.aborted)if((A.status>=200&&A.status<300||A.status===0)&&A.response!==null){let R=A.response;if(f.type==="json")try{R=JSON.parse(A.response)}catch(O){return void x(O)}v({data:R,cacheControl:A.getResponseHeader("Cache-Control"),expires:A.getResponseHeader("Expires")})}else{const R=new Blob([A.response],{type:A.getResponseHeader("Content-Type")});x(new hi(A.status,A.statusText,f.url,R))}},g.signal.addEventListener("abort",()=>{A.abort(),x(Hs())}),A.send(f.body)})}(l,r)};function Ii(l){if(!l||l.indexOf("://")<=0||l.indexOf("data:image/")===0||l.indexOf("blob:")===0)return!0;const r=new URL(l),h=window.location;return r.protocol===h.protocol&&r.host===h.host}function Wn(l,r,h){h[l]&&h[l].indexOf(r)!==-1||(h[l]=h[l]||[],h[l].push(r))}function Bs(l,r,h){if(h&&h[l]){const f=h[l].indexOf(r);f!==-1&&h[l].splice(f,1)}}class pe{constructor(r,h={}){De(this,h),this.type=r}}class xe extends pe{constructor(r,h={}){super("error",De({error:r},h))}}class Ue{on(r,h){return this._listeners=this._listeners||{},Wn(r,h,this._listeners),this}off(r,h){return Bs(r,h,this._listeners),Bs(r,h,this._oneTimeListeners),this}once(r,h){return h?(this._oneTimeListeners=this._oneTimeListeners||{},Wn(r,h,this._oneTimeListeners),this):new Promise(f=>this.once(r,f))}fire(r,h){typeof r=="string"&&(r=new pe(r,h||{}));const f=r.type;if(this.listens(f)){r.target=this;const g=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const T of g)T.call(this,r);const v=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const T of v)Bs(f,T,this._oneTimeListeners),T.call(this,r);const x=this._eventedParent;x&&(De(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(r))}else r instanceof xe&&console.error(r.error);return this}listens(r){return this._listeners&&this._listeners[r]&&this._listeners[r].length>0||this._oneTimeListeners&&this._oneTimeListeners[r]&&this._oneTimeListeners[r].length>0||this._eventedParent&&this._eventedParent.listens(r)}setEventedParent(r,h){return this._eventedParent=r,this._eventedParentData=h,this}}var he={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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"},volatile:{type:"boolean",default:!1},"*":{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"},volatile:{type:"boolean",default:!1},"*":{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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},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},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const qe=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function it(l,r){const h={};for(const f in l)f!=="ref"&&(h[f]=l[f]);return qe.forEach(f=>{f in r&&(h[f]=r[f])}),h}function Ze(l,r){if(Array.isArray(l)){if(!Array.isArray(r)||l.length!==r.length)return!1;for(let h=0;h`:l.itemType.kind==="value"?"array":`array<${r}>`}return l.kind}const Y=[Cs,ot,Wt,Ot,vi,Cr,Qi,V(Bt),Pr,Hn,ce];function re(l,r){if(r.kind==="error")return null;if(l.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!re(l.itemType,r.itemType))&&(typeof l.N!="number"||l.N===r.N))return null}else{if(l.kind===r.kind)return null;if(l.kind==="value"){for(const h of Y)if(!re(h,r))return null}}return`Expected ${U(l)} but found ${U(r)} instead.`}function ye(l,r){return r.some(h=>h.kind===l.kind)}function Te(l,r){return r.some(h=>h==="null"?l===null:h==="array"?Array.isArray(l):h==="object"?l&&!Array.isArray(l)&&typeof l=="object":h===typeof l)}function Ce(l,r){return l.kind==="array"&&r.kind==="array"?l.itemType.kind===r.itemType.kind&&typeof l.N=="number":l.kind===r.kind}const fe=.96422,ze=.82521,We=4/29,Oe=6/29,nt=3*Oe*Oe,It=Oe*Oe*Oe,Mt=Math.PI/180,Xt=180/Math.PI;function oi(l){return(l%=360)<0&&(l+=360),l}function Ht([l,r,h,f]){let g,v;const x=Ni((.2225045*(l=xi(l))+.7168786*(r=xi(r))+.0606169*(h=xi(h)))/1);l===r&&r===h?g=v=x:(g=Ni((.4360747*l+.3850649*r+.1430804*h)/fe),v=Ni((.0139322*l+.0971045*r+.7141733*h)/ze));const T=116*x-16;return[T<0?0:T,500*(g-x),200*(x-v),f]}function xi(l){return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Ni(l){return l>It?Math.pow(l,1/3):l/nt+We}function es([l,r,h,f]){let g=(l+16)/116,v=isNaN(r)?g:g+r/500,x=isNaN(h)?g:g-h/200;return g=1*li(g),v=fe*li(v),x=ze*li(x),[Zt(3.1338561*v-1.6168667*g-.4906146*x),Zt(-.9787684*v+1.9161415*g+.033454*x),Zt(.0719453*v-.2289914*g+1.4052427*x),f]}function Zt(l){return(l=l<=.00304?12.92*l:1.055*Math.pow(l,1/2.4)-.055)<0?0:l>1?1:l}function li(l){return l>Oe?l*l*l:nt*(l-We)}function _i(l){return parseInt(l.padEnd(2,l),16)/255}function ts(l,r){return vs(r?l/100:l,0,1)}function vs(l,r,h){return Math.min(Math.max(r,l),h)}function Ls(l){return!l.some(Number.isNaN)}const xa={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class ui{constructor(r,h,f,g=1,v=!0){this.r=r,this.g=h,this.b=f,this.a=g,v||(this.r*=g,this.g*=g,this.b*=g,g||this.overwriteGetter("rgb",[r,h,f,g]))}static parse(r){if(r instanceof ui)return r;if(typeof r!="string")return;const h=function(f){if((f=f.toLowerCase().trim())==="transparent")return[0,0,0,0];const g=xa[f];if(g){const[x,T,A]=g;return[x/255,T/255,A/255,1]}if(f.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(f)){const x=f.length<6?1:2;let T=1;return[_i(f.slice(T,T+=x)),_i(f.slice(T,T+=x)),_i(f.slice(T,T+=x)),_i(f.slice(T,T+x)||"ff")]}if(f.startsWith("rgb")){const x=f.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[T,A,R,O,F,z,$,q,K,ae,de,Re]=x,be=[O||" ",$||" ",ae].join("");if(be===" "||be===" /"||be===",,"||be===",,,"){const Ee=[R,z,K].join(""),Le=Ee==="%%%"?100:Ee===""?255:0;if(Le){const Je=[vs(+A/Le,0,1),vs(+F/Le,0,1),vs(+q/Le,0,1),de?ts(+de,Re):1];if(Ls(Je))return Je}}return}}const v=f.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(v){const[x,T,A,R,O,F,z,$,q]=v,K=[A||" ",O||" ",z].join("");if(K===" "||K===" /"||K===",,"||K===",,,"){const ae=[+T,vs(+R,0,100),vs(+F,0,100),$?ts(+$,q):1];if(Ls(ae))return function([de,Re,be,Ee]){function Le(Je){const mt=(Je+de/30)%12,Dt=Re*Math.min(be,1-be);return be-Dt*Math.max(-1,Math.min(mt-3,9-mt,1))}return de=oi(de),Re/=100,be/=100,[Le(0),Le(8),Le(4),Ee]}(ae)}}}(r);return h?new ui(...h,!1):void 0}get rgb(){const{r,g:h,b:f,a:g}=this,v=g||1/0;return this.overwriteGetter("rgb",[r/v,h/v,f/v,g])}get hcl(){return this.overwriteGetter("hcl",function(r){const[h,f,g,v]=Ht(r),x=Math.sqrt(f*f+g*g);return[Math.round(1e4*x)?oi(Math.atan2(g,f)*Xt):NaN,x,h,v]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ht(this.rgb))}overwriteGetter(r,h){return Object.defineProperty(this,r,{value:h}),h}toString(){const[r,h,f,g]=this.rgb;return`rgba(${[r,h,f].map(v=>Math.round(255*v)).join(",")},${g})`}}ui.black=new ui(0,0,0,1),ui.white=new ui(1,1,1,1),ui.transparent=new ui(0,0,0,0),ui.red=new ui(1,0,0,1);class Gs{constructor(r,h,f){this.sensitivity=r?h?"variant":"case":h?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(r,h){return this.collator.compare(r,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Gr{constructor(r,h,f,g,v){this.text=r,this.image=h,this.scale=f,this.fontStack=g,this.textColor=v}}class ds{constructor(r){this.sections=r}static fromString(r){return new ds([new Gr(r,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof ds?r:ds.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}}class ls{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof ls)return r;if(typeof r=="number")return new ls([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(const h of r)if(typeof h!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new ls(r)}}toString(){return JSON.stringify(this.values)}}const wa=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class is{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof is)return r;if(Array.isArray(r)&&!(r.length<1)&&r.length%2==0){for(let h=0;h=0&&l<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof h=="number"&&h>=0&&h<=255?f===void 0||typeof f=="number"&&f>=0&&f<=1?null:`Invalid rgba value [${[l,r,h,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof f=="number"?[l,r,h,f]:[l,r,h]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function No(l){if(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"||l instanceof ui||l instanceof Gs||l instanceof ds||l instanceof ls||l instanceof is||l instanceof Bi)return!0;if(Array.isArray(l)){for(const r of l)if(!No(r))return!1;return!0}if(typeof l=="object"){for(const r in l)if(!No(l[r]))return!1;return!0}return!1}function Ki(l){if(l===null)return Cs;if(typeof l=="string")return Wt;if(typeof l=="boolean")return Ot;if(typeof l=="number")return ot;if(l instanceof ui)return vi;if(l instanceof Gs)return cr;if(l instanceof ds)return Cr;if(l instanceof ls)return Pr;if(l instanceof is)return ce;if(l instanceof Bi)return Hn;if(Array.isArray(l)){const r=l.length;let h;for(const f of l){const g=Ki(f);if(h){if(h===g)continue;h=Bt;break}h=g}return V(h||Bt,r)}return Qi}function _s(l){const r=typeof l;return l===null?"":r==="string"||r==="number"||r==="boolean"?String(l):l instanceof ui||l instanceof ds||l instanceof ls||l instanceof is||l instanceof Bi?l.toString():JSON.stringify(l)}class ur{constructor(r,h){this.type=r,this.value=h}static parse(r,h){if(r.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!No(r[1]))return h.error("invalid value");const f=r[1];let g=Ki(f);const v=h.expectedType;return g.kind!=="array"||g.N!==0||!v||v.kind!=="array"||typeof v.N=="number"&&v.N!==0||(g=v),new ur(g,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Yi{constructor(r){this.name="ExpressionEvaluationError",this.message=r}toJSON(){return this.message}}const Bo={string:Wt,number:ot,boolean:Ot,object:Qi};class Qs{constructor(r,h){this.type=r,this.args=h}static parse(r,h){if(r.length<2)return h.error("Expected at least one argument.");let f,g=1;const v=r[0];if(v==="array"){let T,A;if(r.length>2){const R=r[1];if(typeof R!="string"||!(R in Bo)||R==="object")return h.error('The item type argument of "array" must be one of string, number, boolean',1);T=Bo[R],g++}else T=Bt;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return h.error('The length argument to "array" must be a positive integer literal',2);A=r[2],g++}f=V(T,A)}else{if(!Bo[v])throw new Error(`Types doesn't contain name = ${v}`);f=Bo[v]}const x=[];for(;gr.outputDefined())}}const bo={"to-boolean":Ot,"to-color":vi,"to-number":ot,"to-string":Wt};class qn{constructor(r,h){this.type=r,this.args=h}static parse(r,h){if(r.length<2)return h.error("Expected at least one argument.");const f=r[0];if(!bo[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if((f==="to-boolean"||f==="to-string")&&r.length!==2)return h.error("Expected one argument.");const g=bo[f],v=[];for(let x=1;x4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:Ta(h[0],h[1],h[2],h[3]),!f))return new ui(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new Yi(f||`Could not parse color from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"padding":{let h;for(const f of this.args){h=f.evaluate(r);const g=ls.parse(h);if(g)return g}throw new Yi(`Could not parse padding from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"variableAnchorOffsetCollection":{let h;for(const f of this.args){h=f.evaluate(r);const g=is.parse(h);if(g)return g}throw new Yi(`Could not parse variableAnchorOffsetCollection from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"number":{let h=null;for(const f of this.args){if(h=f.evaluate(r),h===null)return 0;const g=Number(h);if(!isNaN(g))return g}throw new Yi(`Could not convert ${JSON.stringify(h)} to number.`)}case"formatted":return ds.fromString(_s(this.args[0].evaluate(r)));case"resolvedImage":return Bi.fromString(_s(this.args[0].evaluate(r)));default:return _s(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}const hr=["Unknown","Point","LineString","Polygon"];class Sa{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?hr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(r){let h=this._parseColorCache[r];return h||(h=this._parseColorCache[r]=ui.parse(r)),h}}class Rr{constructor(r,h,f=[],g,v=new Mi,x=[]){this.registry=r,this.path=f,this.key=f.map(T=>`[${T}]`).join(""),this.scope=v,this.errors=x,this.expectedType=g,this._isConstant=h}parse(r,h,f,g,v={}){return h?this.concat(h,f,g)._parse(r,v):this._parse(r,v)}_parse(r,h){function f(g,v,x){return x==="assert"?new Qs(v,[g]):x==="coerce"?new qn(v,[g]):g}if(r!==null&&typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"||(r=["literal",r]),Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const g=r[0];if(typeof g!="string")return this.error(`Expression name must be a string, but found ${typeof g} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const v=this.registry[g];if(v){let x=v.parse(r,this);if(!x)return null;if(this.expectedType){const T=this.expectedType,A=x.type;if(T.kind!=="string"&&T.kind!=="number"&&T.kind!=="boolean"&&T.kind!=="object"&&T.kind!=="array"||A.kind!=="value")if(T.kind!=="color"&&T.kind!=="formatted"&&T.kind!=="resolvedImage"||A.kind!=="value"&&A.kind!=="string")if(T.kind!=="padding"||A.kind!=="value"&&A.kind!=="number"&&A.kind!=="array")if(T.kind!=="variableAnchorOffsetCollection"||A.kind!=="value"&&A.kind!=="array"){if(this.checkSubtype(T,A))return null}else x=f(x,T,h.typeAnnotation||"coerce");else x=f(x,T,h.typeAnnotation||"coerce");else x=f(x,T,h.typeAnnotation||"coerce");else x=f(x,T,h.typeAnnotation||"assert")}if(!(x instanceof ur)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const T=new Sa;try{x=new ur(x.type,x.evaluate(T))}catch(A){return this.error(A.message),null}}return x}return this.error(`Unknown expression "${g}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(r===void 0?"'undefined' value invalid. Use null instead.":typeof r=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof r} instead.`)}concat(r,h,f){const g=typeof r=="number"?this.path.concat(r):this.path,v=f?this.scope.concat(f):this.scope;return new Rr(this.registry,this._isConstant,g,h||null,v,this.errors)}error(r,...h){const f=`${this.key}${h.map(g=>`[${g}]`).join("")}`;this.errors.push(new ri(f,r))}checkSubtype(r,h){const f=re(r,h);return f&&this.error(f),f}}class ai{constructor(r,h){this.type=h.type,this.bindings=[].concat(r),this.result=h}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(const h of this.bindings)r(h[1]);r(this.result)}static parse(r,h){if(r.length<4)return h.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);const f=[];for(let v=1;v=f.length)throw new Yi(`Array index out of bounds: ${h} > ${f.length-1}.`);if(h!==Math.floor(h))throw new Yi(`Array index must be an integer, but found ${h} instead.`);return f[h]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}}class Aa{constructor(r,h){this.type=Ot,this.needle=r,this.haystack=h}static parse(r,h){if(r.length!==3)return h.error(`Expected 2 arguments, but found ${r.length-1} instead.`);const f=h.parse(r[1],1,Bt),g=h.parse(r[2],2,Bt);return f&&g?ye(f.type,[Ot,Wt,ot,Cs,Bt])?new Aa(f,g):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(f.type)} instead`):null}evaluate(r){const h=this.needle.evaluate(r),f=this.haystack.evaluate(r);if(!f)return!1;if(!Te(h,["boolean","string","number","null"]))throw new Yi(`Expected first argument to be of type boolean, string, number or null, but found ${U(Ki(h))} instead.`);if(!Te(f,["string","array"]))throw new Yi(`Expected second argument to be of type array or string, but found ${U(Ki(f))} instead.`);return f.indexOf(h)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}}class X{constructor(r,h,f){this.type=ot,this.needle=r,this.haystack=h,this.fromIndex=f}static parse(r,h){if(r.length<=2||r.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const f=h.parse(r[1],1,Bt),g=h.parse(r[2],2,Bt);if(!f||!g)return null;if(!ye(f.type,[Ot,Wt,ot,Cs,Bt]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${U(f.type)} instead`);if(r.length===4){const v=h.parse(r[3],3,ot);return v?new X(f,g,v):null}return new X(f,g)}evaluate(r){const h=this.needle.evaluate(r),f=this.haystack.evaluate(r);if(!Te(h,["boolean","string","number","null"]))throw new Yi(`Expected first argument to be of type boolean, string, number or null, but found ${U(Ki(h))} instead.`);if(!Te(f,["string","array"]))throw new Yi(`Expected second argument to be of type array or string, but found ${U(Ki(f))} instead.`);if(this.fromIndex){const g=this.fromIndex.evaluate(r);return f.indexOf(h,g)}return f.indexOf(h)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}}class Q{constructor(r,h,f,g,v,x){this.inputType=r,this.type=h,this.input=f,this.cases=g,this.outputs=v,this.otherwise=x}static parse(r,h){if(r.length<5)return h.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return h.error("Expected an even number of arguments.");let f,g;h.expectedType&&h.expectedType.kind!=="value"&&(g=h.expectedType);const v={},x=[];for(let R=2;RNumber.MAX_SAFE_INTEGER)return z.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof q=="number"&&Math.floor(q)!==q)return z.error("Numeric branch labels must be integer values.");if(f){if(z.checkSubtype(f,Ki(q)))return null}else f=Ki(q);if(v[String(q)]!==void 0)return z.error("Branch labels must be unique.");v[String(q)]=x.length}const $=h.parse(F,R,g);if(!$)return null;g=g||$.type,x.push($)}const T=h.parse(r[1],1,Bt);if(!T)return null;const A=h.parse(r[r.length-1],r.length-1,g);return A?T.type.kind!=="value"&&h.concat(1).checkSubtype(f,T.type)?null:new Q(f,g,T,v,x,A):null}evaluate(r){const h=this.input.evaluate(r);return(Ki(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}}class me{constructor(r,h,f){this.type=r,this.branches=h,this.otherwise=f}static parse(r,h){if(r.length<4)return h.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return h.error("Expected an odd number of arguments.");let f;h.expectedType&&h.expectedType.kind!=="value"&&(f=h.expectedType);const g=[];for(let x=1;xh.outputDefined())&&this.otherwise.outputDefined()}}class Ne{constructor(r,h,f,g){this.type=r,this.input=h,this.beginIndex=f,this.endIndex=g}static parse(r,h){if(r.length<=2||r.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${r.length-1} instead.`);const f=h.parse(r[1],1,Bt),g=h.parse(r[2],2,ot);if(!f||!g)return null;if(!ye(f.type,[V(Bt),Wt,Bt]))return h.error(`Expected first argument to be of type array or string, but found ${U(f.type)} instead`);if(r.length===4){const v=h.parse(r[3],3,ot);return v?new Ne(f.type,f,g,v):null}return new Ne(f.type,f,g)}evaluate(r){const h=this.input.evaluate(r),f=this.beginIndex.evaluate(r);if(!Te(h,["string","array"]))throw new Yi(`Expected first argument to be of type array or string, but found ${U(Ki(h))} instead.`);if(this.endIndex){const g=this.endIndex.evaluate(r);return h.slice(f,g)}return h.slice(f)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}}function Ge(l,r){const h=l.length-1;let f,g,v=0,x=h,T=0;for(;v<=x;)if(T=Math.floor((v+x)/2),f=l[T],g=l[T+1],f<=r){if(T===h||rr))throw new Yi("Input is not a number.");x=T-1}return 0}class xt{constructor(r,h,f){this.type=r,this.input=h,this.labels=[],this.outputs=[];for(const[g,v]of f)this.labels.push(g),this.outputs.push(v)}static parse(r,h){if(r.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return h.error("Expected an even number of arguments.");const f=h.parse(r[1],1,ot);if(!f)return null;const g=[];let v=null;h.expectedType&&h.expectedType.kind!=="value"&&(v=h.expectedType);for(let x=1;x=T)return h.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',R);const F=h.parse(A,O,v);if(!F)return null;v=v||F.type,g.push([T,F])}return new xt(v,f,g)}evaluate(r){const h=this.labels,f=this.outputs;if(h.length===1)return f[0].evaluate(r);const g=this.input.evaluate(r);if(g<=h[0])return f[0].evaluate(r);const v=h.length;return g>=h[v-1]?f[v-1].evaluate(r):f[Ge(h,g)].evaluate(r)}eachChild(r){r(this.input);for(const h of this.outputs)r(h)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function ii(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var xs=ws;function ws(l,r,h,f){this.cx=3*l,this.bx=3*(h-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(f-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=r,this.p2x=h,this.p2y=f}ws.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,r){if(r===void 0&&(r=1e-6),l<0)return 0;if(l>1)return 1;for(var h=l,f=0;f<8;f++){var g=this.sampleCurveX(h)-l;if(Math.abs(g)g?x=h:T=h,h=.5*(T-x)+x;return h},solve:function(l,r){return this.sampleCurveY(this.solveCurveX(l,r))}};var qs=ii(xs);function Ps(l,r,h){return l+h*(r-l)}function Sc(l,r,h){return l.map((f,g)=>Ps(f,r[g],h))}const Xn={number:Ps,color:function(l,r,h,f="rgb"){switch(f){case"rgb":{const[g,v,x,T]=Sc(l.rgb,r.rgb,h);return new ui(g,v,x,T,!1)}case"hcl":{const[g,v,x,T]=l.hcl,[A,R,O,F]=r.hcl;let z,$;if(isNaN(g)||isNaN(A))isNaN(g)?isNaN(A)?z=NaN:(z=A,x!==1&&x!==0||($=R)):(z=g,O!==1&&O!==0||($=v));else{let Re=A-g;A>g&&Re>180?Re-=360:A180&&(Re+=360),z=g+h*Re}const[q,K,ae,de]=function([Re,be,Ee,Le]){return Re=isNaN(Re)?0:Re*Mt,es([Ee,Math.cos(Re)*be,Math.sin(Re)*be,Le])}([z,$??Ps(v,R,h),Ps(x,O,h),Ps(T,F,h)]);return new ui(q,K,ae,de,!1)}case"lab":{const[g,v,x,T]=es(Sc(l.lab,r.lab,h));return new ui(g,v,x,T,!1)}}},array:Sc,padding:function(l,r,h){return new ls(Sc(l.values,r.values,h))},variableAnchorOffsetCollection:function(l,r,h){const f=l.values,g=r.values;if(f.length!==g.length)throw new Yi(`Cannot interpolate values of different length. from: ${l.toString()}, to: ${r.toString()}`);const v=[];for(let x=0;xtypeof O!="number"||O<0||O>1))return h.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);g={name:"cubic-bezier",controlPoints:R}}}if(r.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return h.error("Expected an even number of arguments.");if(v=h.parse(v,2,ot),!v)return null;const T=[];let A=null;f==="interpolate-hcl"||f==="interpolate-lab"?A=vi:h.expectedType&&h.expectedType.kind!=="value"&&(A=h.expectedType);for(let R=0;R=O)return h.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);const q=h.parse(F,$,A);if(!q)return null;A=A||q.type,T.push([O,q])}return Ce(A,ot)||Ce(A,vi)||Ce(A,Pr)||Ce(A,ce)||Ce(A,V(ot))?new Zn(A,f,g,v,T):h.error(`Type ${U(A)} is not interpolatable.`)}evaluate(r){const h=this.labels,f=this.outputs;if(h.length===1)return f[0].evaluate(r);const g=this.input.evaluate(r);if(g<=h[0])return f[0].evaluate(r);const v=h.length;if(g>=h[v-1])return f[v-1].evaluate(r);const x=Ge(h,g),T=Zn.interpolationFactor(this.interpolation,g,h[x],h[x+1]),A=f[x].evaluate(r),R=f[x+1].evaluate(r);switch(this.operator){case"interpolate":return Xn[this.type.kind](A,R,T);case"interpolate-hcl":return Xn.color(A,R,T,"hcl");case"interpolate-lab":return Xn.color(A,R,T,"lab")}}eachChild(r){r(this.input);for(const h of this.outputs)r(h)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}}function Ec(l,r,h,f){const g=f-h,v=l-h;return g===0?0:r===1?v/g:(Math.pow(r,v)-1)/(Math.pow(r,g)-1)}class Wu{constructor(r,h){this.type=r,this.args=h}static parse(r,h){if(r.length<2)return h.error("Expectected at least one argument.");let f=null;const g=h.expectedType;g&&g.kind!=="value"&&(f=g);const v=[];for(const T of r.slice(1)){const A=h.parse(T,1+v.length,f,void 0,{typeAnnotation:"omit"});if(!A)return null;f=f||A.type,v.push(A)}if(!f)throw new Error("No output type");const x=g&&v.some(T=>re(g,T.type));return new Wu(x?Bt:f,v)}evaluate(r){let h,f=null,g=0;for(const v of this.args)if(g++,f=v.evaluate(r),f&&f instanceof Bi&&!f.available&&(h||(h=f.name),f=null,g===this.args.length&&(f=h)),f!==null)break;return f}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}}function Gm(l,r){return l==="=="||l==="!="?r.kind==="boolean"||r.kind==="string"||r.kind==="number"||r.kind==="null"||r.kind==="value":r.kind==="string"||r.kind==="number"||r.kind==="value"}function Qm(l,r,h,f){return f.compare(r,h)===0}function Ia(l,r,h){const f=l!=="=="&&l!=="!=";return class P3{constructor(v,x,T){this.type=Ot,this.lhs=v,this.rhs=x,this.collator=T,this.hasUntypedArgument=v.type.kind==="value"||x.type.kind==="value"}static parse(v,x){if(v.length!==3&&v.length!==4)return x.error("Expected two or three arguments.");const T=v[0];let A=x.parse(v[1],1,Bt);if(!A)return null;if(!Gm(T,A.type))return x.concat(1).error(`"${T}" comparisons are not supported for type '${U(A.type)}'.`);let R=x.parse(v[2],2,Bt);if(!R)return null;if(!Gm(T,R.type))return x.concat(2).error(`"${T}" comparisons are not supported for type '${U(R.type)}'.`);if(A.type.kind!==R.type.kind&&A.type.kind!=="value"&&R.type.kind!=="value")return x.error(`Cannot compare types '${U(A.type)}' and '${U(R.type)}'.`);f&&(A.type.kind==="value"&&R.type.kind!=="value"?A=new Qs(R.type,[A]):A.type.kind!=="value"&&R.type.kind==="value"&&(R=new Qs(A.type,[R])));let O=null;if(v.length===4){if(A.type.kind!=="string"&&R.type.kind!=="string"&&A.type.kind!=="value"&&R.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(O=x.parse(v[3],3,cr),!O)return null}return new P3(A,R,O)}evaluate(v){const x=this.lhs.evaluate(v),T=this.rhs.evaluate(v);if(f&&this.hasUntypedArgument){const A=Ki(x),R=Ki(T);if(A.kind!==R.kind||A.kind!=="string"&&A.kind!=="number")throw new Yi(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${A.kind}, ${R.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const A=Ki(x),R=Ki(T);if(A.kind!=="string"||R.kind!=="string")return r(v,x,T)}return this.collator?h(v,x,T,this.collator.evaluate(v)):r(v,x,T)}eachChild(v){v(this.lhs),v(this.rhs),this.collator&&v(this.collator)}outputDefined(){return!0}}}const eg=Ia("==",function(l,r,h){return r===h},Qm),Ob=Ia("!=",function(l,r,h){return r!==h},function(l,r,h,f){return!Qm(0,r,h,f)}),Db=Ia("<",function(l,r,h){return r",function(l,r,h){return r>h},function(l,r,h,f){return f.compare(r,h)>0}),ig=Ia("<=",function(l,r,h){return r<=h},function(l,r,h,f){return f.compare(r,h)<=0}),Fb=Ia(">=",function(l,r,h){return r>=h},function(l,r,h,f){return f.compare(r,h)>=0});class Hu{constructor(r,h,f){this.type=cr,this.locale=f,this.caseSensitive=r,this.diacriticSensitive=h}static parse(r,h){if(r.length!==2)return h.error("Expected one argument.");const f=r[1];if(typeof f!="object"||Array.isArray(f))return h.error("Collator options argument must be an object.");const g=h.parse(f["case-sensitive"]!==void 0&&f["case-sensitive"],1,Ot);if(!g)return null;const v=h.parse(f["diacritic-sensitive"]!==void 0&&f["diacritic-sensitive"],1,Ot);if(!v)return null;let x=null;return f.locale&&(x=h.parse(f.locale,1,Wt),!x)?null:new Hu(g,v,x)}evaluate(r){return new Gs(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}}class sf{constructor(r,h,f,g,v){this.type=Wt,this.number=r,this.locale=h,this.currency=f,this.minFractionDigits=g,this.maxFractionDigits=v}static parse(r,h){if(r.length!==3)return h.error("Expected two arguments.");const f=h.parse(r[1],1,ot);if(!f)return null;const g=r[2];if(typeof g!="object"||Array.isArray(g))return h.error("NumberFormat options argument must be an object.");let v=null;if(g.locale&&(v=h.parse(g.locale,1,Wt),!v))return null;let x=null;if(g.currency&&(x=h.parse(g.currency,1,Wt),!x))return null;let T=null;if(g["min-fraction-digits"]&&(T=h.parse(g["min-fraction-digits"],1,ot),!T))return null;let A=null;return g["max-fraction-digits"]&&(A=h.parse(g["max-fraction-digits"],1,ot),!A)?null:new sf(f,v,x,T,A)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}}class qu{constructor(r){this.type=Cr,this.sections=r}static parse(r,h){if(r.length<2)return h.error("Expected at least one argument.");const f=r[1];if(!Array.isArray(f)&&typeof f=="object")return h.error("First argument must be an image or text section.");const g=[];let v=!1;for(let x=1;x<=r.length-1;++x){const T=r[x];if(v&&typeof T=="object"&&!Array.isArray(T)){v=!1;let A=null;if(T["font-scale"]&&(A=h.parse(T["font-scale"],1,ot),!A))return null;let R=null;if(T["text-font"]&&(R=h.parse(T["text-font"],1,V(Wt)),!R))return null;let O=null;if(T["text-color"]&&(O=h.parse(T["text-color"],1,vi),!O))return null;const F=g[g.length-1];F.scale=A,F.font=R,F.textColor=O}else{const A=h.parse(r[x],1,Bt);if(!A)return null;const R=A.type.kind;if(R!=="string"&&R!=="value"&&R!=="null"&&R!=="resolvedImage")return h.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");v=!0,g.push({content:A,scale:null,font:null,textColor:null})}}return new qu(g)}evaluate(r){return new ds(this.sections.map(h=>{const f=h.content.evaluate(r);return Ki(f)===Hn?new Gr("",f,null,null,null):new Gr(_s(f),null,h.scale?h.scale.evaluate(r):null,h.font?h.font.evaluate(r).join(","):null,h.textColor?h.textColor.evaluate(r):null)}))}eachChild(r){for(const h of this.sections)r(h.content),h.scale&&r(h.scale),h.font&&r(h.font),h.textColor&&r(h.textColor)}outputDefined(){return!1}}class nf{constructor(r){this.type=Hn,this.input=r}static parse(r,h){if(r.length!==2)return h.error("Expected two arguments.");const f=h.parse(r[1],1,Wt);return f?new nf(f):h.error("No image name provided.")}evaluate(r){const h=this.input.evaluate(r),f=Bi.fromString(h);return f&&r.availableImages&&(f.available=r.availableImages.indexOf(h)>-1),f}eachChild(r){r(this.input)}outputDefined(){return!1}}class rf{constructor(r){this.type=ot,this.input=r}static parse(r,h){if(r.length!==2)return h.error(`Expected 1 argument, but found ${r.length-1} instead.`);const f=h.parse(r[1],1);return f?f.type.kind!=="array"&&f.type.kind!=="string"&&f.type.kind!=="value"?h.error(`Expected argument of type string or array, but found ${U(f.type)} instead.`):new rf(f):null}evaluate(r){const h=this.input.evaluate(r);if(typeof h=="string"||Array.isArray(h))return h.length;throw new Yi(`Expected value to be of type string or array, but found ${U(Ki(h))} instead.`)}eachChild(r){r(this.input)}outputDefined(){return!1}}const Qr=8192;function of(l,r){const h=(180+l[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,g=Math.pow(2,r.z);return[Math.round(h*g*Qr),Math.round(f*g*Qr)]}function ol(l,r){const h=Math.pow(2,r.z);return[(g=(l[0]/Qr+r.x)/h,360*g-180),(f=(l[1]/Qr+r.y)/h,360/Math.PI*Math.atan(Math.exp((180-360*f)*Math.PI/180))-90)];var f,g}function ci(l,r){l[0]=Math.min(l[0],r[0]),l[1]=Math.min(l[1],r[1]),l[2]=Math.max(l[2],r[0]),l[3]=Math.max(l[3],r[1])}function Ac(l,r){return!(l[0]<=r[0]||l[2]>=r[2]||l[1]<=r[1]||l[3]>=r[3])}function Nb(l,r,h){const f=l[0]-r[0],g=l[1]-r[1],v=l[0]-h[0],x=l[1]-h[1];return f*x-v*g==0&&f*v<=0&&g*x<=0}function Xu(l,r,h,f){return(g=[f[0]-h[0],f[1]-h[1]])[0]*(v=[r[0]-l[0],r[1]-l[1]])[1]-g[1]*v[0]!=0&&!(!ng(l,r,h,f)||!ng(h,f,l,r));var g,v}function Bb(l,r,h){for(const f of h)for(let g=0;g(g=l)[1]!=(x=T[A+1])[1]>g[1]&&g[0]<(x[0]-v[0])*(g[1]-v[1])/(x[1]-v[1])+v[0]&&(f=!f)}var g,v,x;return f}function Lb(l,r){for(const h of r)if(al(l,h))return!0;return!1}function sg(l,r){for(const h of l)if(!al(h,r))return!1;for(let h=0;h0&&T<0||x<0&&T>0}function af(l,r,h){const f=[];for(let g=0;gh[2]){const g=.5*f;let v=l[0]-h[0]>g?-f:h[0]-l[0]>g?f:0;v===0&&(v=l[0]-h[2]>g?-f:h[2]-l[0]>g?f:0),l[0]+=v}ci(r,l)}function ag(l,r,h,f){const g=Math.pow(2,f.z)*Qr,v=[f.x*Qr,f.y*Qr],x=[];for(const T of l)for(const A of T){const R=[A.x+v[0],A.y+v[1]];og(R,r,h,g),x.push(R)}return x}function lg(l,r,h,f){const g=Math.pow(2,f.z)*Qr,v=[f.x*Qr,f.y*Qr],x=[];for(const A of l){const R=[];for(const O of A){const F=[O.x+v[0],O.y+v[1]];ci(r,F),R.push(F)}x.push(R)}if(r[2]-r[0]<=g/2){(T=r)[0]=T[1]=1/0,T[2]=T[3]=-1/0;for(const A of x)for(const R of A)og(R,r,h,g)}var T;return x}class Ca{constructor(r,h){this.type=Ot,this.geojson=r,this.geometries=h}static parse(r,h){if(r.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(No(r[1])){const f=r[1];if(f.type==="FeatureCollection"){const g=[];for(const v of f.features){const{type:x,coordinates:T}=v.geometry;x==="Polygon"&&g.push(T),x==="MultiPolygon"&&g.push(...T)}if(g.length)return new Ca(f,{type:"MultiPolygon",coordinates:g})}else if(f.type==="Feature"){const g=f.geometry.type;if(g==="Polygon"||g==="MultiPolygon")return new Ca(f,f.geometry)}else if(f.type==="Polygon"||f.type==="MultiPolygon")return new Ca(f,f)}return h.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(h,f){const g=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],x=h.canonicalID();if(f.type==="Polygon"){const T=af(f.coordinates,v,x),A=ag(h.geometry(),g,v,x);if(!Ac(g,v))return!1;for(const R of A)if(!al(R,T))return!1}if(f.type==="MultiPolygon"){const T=rg(f.coordinates,v,x),A=ag(h.geometry(),g,v,x);if(!Ac(g,v))return!1;for(const R of A)if(!Lb(R,T))return!1}return!0}(r,this.geometries);if(r.geometryType()==="LineString")return function(h,f){const g=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],x=h.canonicalID();if(f.type==="Polygon"){const T=af(f.coordinates,v,x),A=lg(h.geometry(),g,v,x);if(!Ac(g,v))return!1;for(const R of A)if(!sg(R,T))return!1}if(f.type==="MultiPolygon"){const T=rg(f.coordinates,v,x),A=lg(h.geometry(),g,v,x);if(!Ac(g,v))return!1;for(const R of A)if(!zb(R,T))return!1}return!0}(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let cg=class{constructor(l=[],r=Ub){if(this.data=l,this.length=this.data.length,this.compare=r,this.length>0)for(let h=(this.length>>1)-1;h>=0;h--)this._down(h)}push(l){this.data.push(l),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const l=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),l}peek(){return this.data[0]}_up(l){const{data:r,compare:h}=this,f=r[l];for(;l>0;){const g=l-1>>1,v=r[g];if(h(f,v)>=0)break;r[l]=v,l=g}r[l]=f}_down(l){const{data:r,compare:h}=this,f=this.length>>1,g=r[l];for(;l=0)break;r[l]=x,l=v}r[l]=g}};function Ub(l,r){return lr?1:0}function Vb(l,r,h,f,g){ug(l,r,h,f||l.length-1,g||jb)}function ug(l,r,h,f,g){for(;f>h;){if(f-h>600){var v=f-h+1,x=r-h+1,T=Math.log(v),A=.5*Math.exp(2*T/3),R=.5*Math.sqrt(T*A*(v-A)/v)*(x-v/2<0?-1:1);ug(l,r,Math.max(h,Math.floor(r-x*A/v+R)),Math.min(f,Math.floor(r+(v-x)*A/v+R)),g)}var O=l[r],F=h,z=f;for(Ic(l,h,r),g(l[f],O)>0&&Ic(l,h,f);F0;)z--}g(l[h],O)===0?Ic(l,h,z):Ic(l,++z,f),z<=r&&(h=z+1),r<=z&&(f=z-1)}}function Ic(l,r,h){var f=l[r];l[r]=l[h],l[h]=f}function jb(l,r){return lr?1:0}function Zu(l,r){if(l.length<=1)return[l];const h=[];let f,g;for(const v of l){const x=Wb(v);x!==0&&(v.area=Math.abs(x),g===void 0&&(g=x<0),g===x<0?(f&&h.push(f),f=[v]):f.push(v))}if(f&&h.push(f),r>1)for(let v=0;v1?(R=r[A+1][0],O=r[A+1][1]):$>0&&(R+=F/this.kx*$,O+=z/this.ky*$)),F=this.wrap(h[0]-R)*this.kx,z=(h[1]-O)*this.ky;const q=F*F+z*z;q180;)r-=360;return r}}function pg(l,r){return r[0]-l[0]}function Ku(l){return l[1]-l[0]+1}function vo(l,r){return l[1]>=l[0]&&l[1]l[1])return[null,null];const h=Ku(l);if(r){if(h===2)return[l,null];const g=Math.floor(h/2);return[[l[0],l[0]+g],[l[0]+g,l[1]]]}if(h===1)return[l,null];const f=Math.floor(h/2)-1;return[[l[0],l[0]+f],[l[0]+f+1,l[1]]]}function cf(l,r){if(!vo(r,l.length))return[1/0,1/0,-1/0,-1/0];const h=[1/0,1/0,-1/0,-1/0];for(let f=r[0];f<=r[1];++f)ci(h,l[f]);return h}function uf(l){const r=[1/0,1/0,-1/0,-1/0];for(const h of l)for(const f of h)ci(r,f);return r}function mg(l){return l[0]!==-1/0&&l[1]!==-1/0&&l[2]!==1/0&&l[3]!==1/0}function hf(l,r,h){if(!mg(l)||!mg(r))return NaN;let f=0,g=0;return l[2]r[2]&&(f=l[0]-r[2]),l[1]>r[3]&&(g=l[1]-r[3]),l[3]=f)return f;if(Ac(g,v)){if(Pc(l,r))return 0}else if(Pc(r,l))return 0;let x=1/0;for(const T of l)for(let A=0,R=T.length,O=R-1;A0;){const A=x.pop();if(A[0]>=v)continue;const R=A[1],O=r?50:100;if(Ku(R)<=O){if(!vo(R,l.length))return NaN;if(r){const F=Li(l,R,h,f);if(isNaN(F)||F===0)return F;v=Math.min(v,F)}else for(let F=R[0];F<=R[1];++F){const z=Ji(l[F],h,f);if(v=Math.min(v,z),v===0)return 0}}else{const F=Cc(R,r);pf(x,v,f,l,T,F[0]),pf(x,v,f,l,T,F[1])}}return v}function Gu(l,r,h,f,g,v=1/0){let x=Math.min(v,g.distance(l[0],h[0]));if(x===0)return x;const T=new cg([[0,[0,l.length-1],[0,h.length-1]]],pg);for(;T.length>0;){const A=T.pop();if(A[0]>=x)continue;const R=A[1],O=A[2],F=r?50:100,z=f?50:100;if(Ku(R)<=F&&Ku(O)<=z){if(!vo(R,l.length)&&vo(O,h.length))return NaN;let $;if(r&&f)$=si(l,R,h,O,g),x=Math.min(x,$);else if(r&&!f){const q=l.slice(R[0],R[1]+1);for(let K=O[0];K<=O[1];++K)if($=ki(h[K],q,g),x=Math.min(x,$),x===0)return x}else if(!r&&f){const q=h.slice(O[0],O[1]+1);for(let K=R[0];K<=R[1];++K)if($=ki(l[K],q,g),x=Math.min(x,$),x===0)return x}else $=ff(l,R,h,O,g),x=Math.min(x,$)}else{const $=Cc(R,r),q=Cc(O,f);Yu(T,x,g,l,h,$[0],q[0]),Yu(T,x,g,l,h,$[0],q[1]),Yu(T,x,g,l,h,$[1],q[0]),Yu(T,x,g,l,h,$[1],q[1])}}return x}function mf(l){return l.type==="MultiPolygon"?l.coordinates.map(r=>({type:"Polygon",coordinates:r})):l.type==="MultiLineString"?l.coordinates.map(r=>({type:"LineString",coordinates:r})):l.type==="MultiPoint"?l.coordinates.map(r=>({type:"Point",coordinates:r})):[l]}class Lo{constructor(r,h){this.type=ot,this.geojson=r,this.geometries=h}static parse(r,h){if(r.length!==2)return h.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(No(r[1])){const f=r[1];if(f.type==="FeatureCollection")return new Lo(f,f.features.map(g=>mf(g.geometry)).flat());if(f.type==="Feature")return new Lo(f,mf(f.geometry));if("type"in f&&"coordinates"in f)return new Lo(f,mf(f))}return h.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return function(h,f){const g=h.geometry(),v=g.flat().map(A=>ol([A.x,A.y],h.canonical));if(g.length===0)return NaN;const x=new lf(v[0][1]);let T=1/0;for(const A of f){switch(A.type){case"Point":T=Math.min(T,Gu(v,!1,[A.coordinates],!1,x,T));break;case"LineString":T=Math.min(T,Gu(v,!1,A.coordinates,!0,x,T));break;case"Polygon":T=Math.min(T,Ju(v,!1,A.coordinates,x,T))}if(T===0)return T}return T}(r,this.geometries);if(r.geometryType()==="LineString")return function(h,f){const g=h.geometry(),v=g.flat().map(A=>ol([A.x,A.y],h.canonical));if(g.length===0)return NaN;const x=new lf(v[0][1]);let T=1/0;for(const A of f){switch(A.type){case"Point":T=Math.min(T,Gu(v,!0,[A.coordinates],!1,x,T));break;case"LineString":T=Math.min(T,Gu(v,!0,A.coordinates,!0,x,T));break;case"Polygon":T=Math.min(T,Ju(v,!0,A.coordinates,x,T))}if(T===0)return T}return T}(r,this.geometries);if(r.geometryType()==="Polygon")return function(h,f){const g=h.geometry();if(g.length===0||g[0].length===0)return NaN;const v=Zu(g,0).map(A=>A.map(R=>R.map(O=>ol([O.x,O.y],h.canonical)))),x=new lf(v[0][0][0][1]);let T=1/0;for(const A of f)for(const R of v){switch(A.type){case"Point":T=Math.min(T,Ju([A.coordinates],!1,R,x,T));break;case"LineString":T=Math.min(T,Ju(A.coordinates,!0,R,x,T));break;case"Polygon":T=Math.min(T,gg(R,A.coordinates,x,T))}if(T===0)return T}return T}(r,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Pa={"==":eg,"!=":Ob,">":tg,"<":Db,">=":Fb,"<=":ig,array:Qs,at:Tc,boolean:Qs,case:me,coalesce:Wu,collator:Hu,format:qu,image:nf,in:Aa,"index-of":X,interpolate:Zn,"interpolate-hcl":Zn,"interpolate-lab":Zn,length:rf,let:ai,literal:ur,match:Q,number:Qs,"number-format":sf,object:Qs,slice:Ne,step:xt,string:Qs,"to-boolean":qn,"to-color":qn,"to-number":qn,"to-string":qn,var:Ea,within:Ca,distance:Lo};class Kn{constructor(r,h,f,g){this.name=r,this.type=h,this._evaluate=f,this.args=g}evaluate(r){return this._evaluate(r,this.args)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,h){const f=r[0],g=Kn.definitions[f];if(!g)return h.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const v=Array.isArray(g)?g[0]:g.type,x=Array.isArray(g)?[[g[1],g[2]]]:g.overloads,T=x.filter(([R])=>!Array.isArray(R)||R.length===r.length-1);let A=null;for(const[R,O]of T){A=new Rr(h.registry,eh,h.path,null,h.scope);const F=[];let z=!1;for(let $=1;${return z=F,Array.isArray(z)?`(${z.map(U).join(", ")})`:`(${U(z.type)}...)`;var z}).join(" | "),O=[];for(let F=1;F{h=r?h&&eh(f):h&&f instanceof ur}),!!h&&th(l)&&ih(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function th(l){if(l instanceof Kn&&(l.name==="get"&&l.args.length===1||l.name==="feature-state"||l.name==="has"&&l.args.length===1||l.name==="properties"||l.name==="geometry-type"||l.name==="id"||/^filter-/.test(l.name))||l instanceof Ca||l instanceof Lo)return!1;let r=!0;return l.eachChild(h=>{r&&!th(h)&&(r=!1)}),r}function Rc(l){if(l instanceof Kn&&l.name==="feature-state")return!1;let r=!0;return l.eachChild(h=>{r&&!Rc(h)&&(r=!1)}),r}function ih(l,r){if(l instanceof Kn&&r.indexOf(l.name)>=0)return!1;let h=!0;return l.eachChild(f=>{h&&!ih(f,r)&&(h=!1)}),h}function _g(l){return{result:"success",value:l}}function ll(l){return{result:"error",value:l}}function Ma(l){return l["property-type"]==="data-driven"||l["property-type"]==="cross-faded-data-driven"}function yf(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function cl(l){return!!l.expression&&l.expression.interpolated}function di(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":l===null?"null":typeof l}function Mc(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function yg(l){return l}function bg(l,r){const h=r.type==="color",f=l.stops&&typeof l.stops[0][0]=="object",g=f||!(f||l.property!==void 0),v=l.type||(cl(r)?"exponential":"interval");if(h||r.type==="padding"){const O=h?ui.parse:ls.parse;(l=Gt({},l)).stops&&(l.stops=l.stops.map(F=>[F[0],O(F[1])])),l.default=O(l.default?l.default:r.default)}if(l.colorSpace&&(x=l.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${l.colorSpace}"`);var x;let T,A,R;if(v==="exponential")T=bf;else if(v==="interval")T=nh;else if(v==="categorical"){T=sh,A=Object.create(null);for(const O of l.stops)A[O[0]]=O[1];R=typeof l.stops[0][0]}else{if(v!=="identity")throw new Error(`Unknown function type "${v}"`);T=vf}if(f){const O={},F=[];for(let q=0;qq[0]),evaluate:({zoom:q},K)=>bf({stops:z,base:l.base},r,q).evaluate(q,K)}}if(g){const O=v==="exponential"?{name:"exponential",base:l.base!==void 0?l.base:1}:null;return{kind:"camera",interpolationType:O,interpolationFactor:Zn.interpolationFactor.bind(void 0,O),zoomStops:l.stops.map(F=>F[0]),evaluate:({zoom:F})=>T(l,r,F,A,R)}}return{kind:"source",evaluate(O,F){const z=F&&F.properties?F.properties[l.property]:void 0;return z===void 0?ka(l.default,r.default):T(l,r,z,A,R)}}}function ka(l,r,h){return l!==void 0?l:r!==void 0?r:h!==void 0?h:void 0}function sh(l,r,h,f,g){return ka(typeof h===g?f[h]:void 0,l.default,r.default)}function nh(l,r,h){if(di(h)!=="number")return ka(l.default,r.default);const f=l.stops.length;if(f===1||h<=l.stops[0][0])return l.stops[0][1];if(h>=l.stops[f-1][0])return l.stops[f-1][1];const g=Ge(l.stops.map(v=>v[0]),h);return l.stops[g][1]}function bf(l,r,h){const f=l.base!==void 0?l.base:1;if(di(h)!=="number")return ka(l.default,r.default);const g=l.stops.length;if(g===1||h<=l.stops[0][0])return l.stops[0][1];if(h>=l.stops[g-1][0])return l.stops[g-1][1];const v=Ge(l.stops.map(O=>O[0]),h),x=function(O,F,z,$){const q=$-z,K=O-z;return q===0?0:F===1?K/q:(Math.pow(F,K)-1)/(Math.pow(F,q)-1)}(h,f,l.stops[v][0],l.stops[v+1][0]),T=l.stops[v][1],A=l.stops[v+1][1],R=Xn[r.type]||yg;return typeof T.evaluate=="function"?{evaluate(...O){const F=T.evaluate.apply(void 0,O),z=A.evaluate.apply(void 0,O);if(F!==void 0&&z!==void 0)return R(F,z,x,l.colorSpace)}}:R(T,A,x,l.colorSpace)}function vf(l,r,h){switch(r.type){case"color":h=ui.parse(h);break;case"formatted":h=ds.fromString(h.toString());break;case"resolvedImage":h=Bi.fromString(h.toString());break;case"padding":h=ls.parse(h);break;default:di(h)===r.type||r.type==="enum"&&r.values[h]||(h=void 0)}return ka(h,l.default,r.default)}Kn.register(Pa,{error:[{kind:"error"},[Wt],(l,[r])=>{throw new Yi(r.evaluate(l))}],typeof:[Wt,[Bt],(l,[r])=>U(Ki(r.evaluate(l)))],"to-rgba":[V(ot,4),[vi],(l,[r])=>{const[h,f,g,v]=r.evaluate(l).rgb;return[255*h,255*f,255*g,v]}],rgb:[vi,[ot,ot,ot],gf],rgba:[vi,[ot,ot,ot,ot],gf],has:{type:Ot,overloads:[[[Wt],(l,[r])=>Qu(r.evaluate(l),l.properties())],[[Wt,Qi],(l,[r,h])=>Qu(r.evaluate(l),h.evaluate(l))]]},get:{type:Bt,overloads:[[[Wt],(l,[r])=>_f(r.evaluate(l),l.properties())],[[Wt,Qi],(l,[r,h])=>_f(r.evaluate(l),h.evaluate(l))]]},"feature-state":[Bt,[Wt],(l,[r])=>_f(r.evaluate(l),l.featureState||{})],properties:[Qi,[],l=>l.properties()],"geometry-type":[Wt,[],l=>l.geometryType()],id:[Bt,[],l=>l.id()],zoom:[ot,[],l=>l.globals.zoom],"heatmap-density":[ot,[],l=>l.globals.heatmapDensity||0],"line-progress":[ot,[],l=>l.globals.lineProgress||0],accumulated:[Bt,[],l=>l.globals.accumulated===void 0?null:l.globals.accumulated],"+":[ot,Ra(ot),(l,r)=>{let h=0;for(const f of r)h+=f.evaluate(l);return h}],"*":[ot,Ra(ot),(l,r)=>{let h=1;for(const f of r)h*=f.evaluate(l);return h}],"-":{type:ot,overloads:[[[ot,ot],(l,[r,h])=>r.evaluate(l)-h.evaluate(l)],[[ot],(l,[r])=>-r.evaluate(l)]]},"/":[ot,[ot,ot],(l,[r,h])=>r.evaluate(l)/h.evaluate(l)],"%":[ot,[ot,ot],(l,[r,h])=>r.evaluate(l)%h.evaluate(l)],ln2:[ot,[],()=>Math.LN2],pi:[ot,[],()=>Math.PI],e:[ot,[],()=>Math.E],"^":[ot,[ot,ot],(l,[r,h])=>Math.pow(r.evaluate(l),h.evaluate(l))],sqrt:[ot,[ot],(l,[r])=>Math.sqrt(r.evaluate(l))],log10:[ot,[ot],(l,[r])=>Math.log(r.evaluate(l))/Math.LN10],ln:[ot,[ot],(l,[r])=>Math.log(r.evaluate(l))],log2:[ot,[ot],(l,[r])=>Math.log(r.evaluate(l))/Math.LN2],sin:[ot,[ot],(l,[r])=>Math.sin(r.evaluate(l))],cos:[ot,[ot],(l,[r])=>Math.cos(r.evaluate(l))],tan:[ot,[ot],(l,[r])=>Math.tan(r.evaluate(l))],asin:[ot,[ot],(l,[r])=>Math.asin(r.evaluate(l))],acos:[ot,[ot],(l,[r])=>Math.acos(r.evaluate(l))],atan:[ot,[ot],(l,[r])=>Math.atan(r.evaluate(l))],min:[ot,Ra(ot),(l,r)=>Math.min(...r.map(h=>h.evaluate(l)))],max:[ot,Ra(ot),(l,r)=>Math.max(...r.map(h=>h.evaluate(l)))],abs:[ot,[ot],(l,[r])=>Math.abs(r.evaluate(l))],round:[ot,[ot],(l,[r])=>{const h=r.evaluate(l);return h<0?-Math.round(-h):Math.round(h)}],floor:[ot,[ot],(l,[r])=>Math.floor(r.evaluate(l))],ceil:[ot,[ot],(l,[r])=>Math.ceil(r.evaluate(l))],"filter-==":[Ot,[Wt,Bt],(l,[r,h])=>l.properties()[r.value]===h.value],"filter-id-==":[Ot,[Bt],(l,[r])=>l.id()===r.value],"filter-type-==":[Ot,[Wt],(l,[r])=>l.geometryType()===r.value],"filter-<":[Ot,[Wt,Bt],(l,[r,h])=>{const f=l.properties()[r.value],g=h.value;return typeof f==typeof g&&f{const h=l.id(),f=r.value;return typeof h==typeof f&&h":[Ot,[Wt,Bt],(l,[r,h])=>{const f=l.properties()[r.value],g=h.value;return typeof f==typeof g&&f>g}],"filter-id->":[Ot,[Bt],(l,[r])=>{const h=l.id(),f=r.value;return typeof h==typeof f&&h>f}],"filter-<=":[Ot,[Wt,Bt],(l,[r,h])=>{const f=l.properties()[r.value],g=h.value;return typeof f==typeof g&&f<=g}],"filter-id-<=":[Ot,[Bt],(l,[r])=>{const h=l.id(),f=r.value;return typeof h==typeof f&&h<=f}],"filter->=":[Ot,[Wt,Bt],(l,[r,h])=>{const f=l.properties()[r.value],g=h.value;return typeof f==typeof g&&f>=g}],"filter-id->=":[Ot,[Bt],(l,[r])=>{const h=l.id(),f=r.value;return typeof h==typeof f&&h>=f}],"filter-has":[Ot,[Bt],(l,[r])=>r.value in l.properties()],"filter-has-id":[Ot,[],l=>l.id()!==null&&l.id()!==void 0],"filter-type-in":[Ot,[V(Wt)],(l,[r])=>r.value.indexOf(l.geometryType())>=0],"filter-id-in":[Ot,[V(Bt)],(l,[r])=>r.value.indexOf(l.id())>=0],"filter-in-small":[Ot,[Wt,V(Bt)],(l,[r,h])=>h.value.indexOf(l.properties()[r.value])>=0],"filter-in-large":[Ot,[Wt,V(Bt)],(l,[r,h])=>function(f,g,v,x){for(;v<=x;){const T=v+x>>1;if(g[T]===f)return!0;g[T]>f?x=T-1:v=T+1}return!1}(l.properties()[r.value],h.value,0,h.value.length-1)],all:{type:Ot,overloads:[[[Ot,Ot],(l,[r,h])=>r.evaluate(l)&&h.evaluate(l)],[Ra(Ot),(l,r)=>{for(const h of r)if(!h.evaluate(l))return!1;return!0}]]},any:{type:Ot,overloads:[[[Ot,Ot],(l,[r,h])=>r.evaluate(l)||h.evaluate(l)],[Ra(Ot),(l,r)=>{for(const h of r)if(h.evaluate(l))return!0;return!1}]]},"!":[Ot,[Ot],(l,[r])=>!r.evaluate(l)],"is-supported-script":[Ot,[Wt],(l,[r])=>{const h=l.globals&&l.globals.isSupportedScript;return!h||h(r.evaluate(l))}],upcase:[Wt,[Wt],(l,[r])=>r.evaluate(l).toUpperCase()],downcase:[Wt,[Wt],(l,[r])=>r.evaluate(l).toLowerCase()],concat:[Wt,Ra(Bt),(l,r)=>r.map(h=>_s(h.evaluate(l))).join("")],"resolved-locale":[Wt,[cr],(l,[r])=>r.evaluate(l).resolvedLocale()]});class rh{constructor(r,h){var f;this.expression=r,this._warningHistory={},this._evaluator=new Sa,this._defaultValue=h?(f=h).type==="color"&&Mc(f.default)?new ui(0,0,0,0):f.type==="color"?ui.parse(f.default)||null:f.type==="padding"?ls.parse(f.default)||null:f.type==="variableAnchorOffsetCollection"?is.parse(f.default)||null:f.default===void 0?null:f.default:null,this._enumValues=h&&h.type==="enum"?h.values:null}evaluateWithoutErrorHandling(r,h,f,g,v,x){return this._evaluator.globals=r,this._evaluator.feature=h,this._evaluator.featureState=f,this._evaluator.canonical=g,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(r,h,f,g,v,x){this._evaluator.globals=r,this._evaluator.feature=h||null,this._evaluator.featureState=f||null,this._evaluator.canonical=g,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=x||null;try{const T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new Yi(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(T)} instead.`);return T}catch(T){return this._warningHistory[T.message]||(this._warningHistory[T.message]=!0,typeof console<"u"&&console.warn(T.message)),this._defaultValue}}}function kc(l){return Array.isArray(l)&&l.length>0&&typeof l[0]=="string"&&l[0]in Pa}function Oa(l,r){const h=new Rr(Pa,eh,[],r?function(g){const v={color:vi,string:Wt,number:ot,enum:Wt,boolean:Ot,formatted:Cr,padding:Pr,resolvedImage:Hn,variableAnchorOffsetCollection:ce};return g.type==="array"?V(v[g.value]||Bt,g.length):v[g.type]}(r):void 0),f=h.parse(l,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return f?_g(new rh(f,r)):ll(h.errors)}class xf{constructor(r,h){this.kind=r,this._styleExpression=h,this.isStateDependent=r!=="constant"&&!Rc(h.expression)}evaluateWithoutErrorHandling(r,h,f,g,v,x){return this._styleExpression.evaluateWithoutErrorHandling(r,h,f,g,v,x)}evaluate(r,h,f,g,v,x){return this._styleExpression.evaluate(r,h,f,g,v,x)}}class wf{constructor(r,h,f,g){this.kind=r,this.zoomStops=f,this._styleExpression=h,this.isStateDependent=r!=="camera"&&!Rc(h.expression),this.interpolationType=g}evaluateWithoutErrorHandling(r,h,f,g,v,x){return this._styleExpression.evaluateWithoutErrorHandling(r,h,f,g,v,x)}evaluate(r,h,f,g,v,x){return this._styleExpression.evaluate(r,h,f,g,v,x)}interpolationFactor(r,h,f){return this.interpolationType?Zn.interpolationFactor(this.interpolationType,r,h,f):0}}function vg(l,r){const h=Oa(l,r);if(h.result==="error")return h;const f=h.value.expression,g=th(f);if(!g&&!Ma(r))return ll([new ri("","data expressions not supported")]);const v=ih(f,["zoom"]);if(!v&&!yf(r))return ll([new ri("","zoom expressions not supported")]);const x=ah(f);return x||v?x instanceof ri?ll([x]):x instanceof Zn&&!cl(r)?ll([new ri("",'"interpolate" expressions cannot be used with this property')]):_g(x?new wf(g?"camera":"composite",h.value,x.labels,x instanceof Zn?x.interpolation:void 0):new xf(g?"constant":"source",h.value)):ll([new ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class oh{constructor(r,h){this._parameters=r,this._specification=h,Gt(this,bg(this._parameters,this._specification))}static deserialize(r){return new oh(r._parameters,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification}}}function ah(l){let r=null;if(l instanceof ai)r=ah(l.result);else if(l instanceof Wu){for(const h of l.args)if(r=ah(h),r)break}else(l instanceof xt||l instanceof Zn)&&l.input instanceof Kn&&l.input.name==="zoom"&&(r=l);return r instanceof ri||l.eachChild(h=>{const f=ah(h);f instanceof ri?r=f:!r&&f?r=new ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&f&&r!==f&&(r=new ri("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function ul(l){if(l===!0||l===!1)return!0;if(!Array.isArray(l)||l.length===0)return!1;switch(l[0]){case"has":return l.length>=2&&l[1]!=="$id"&&l[1]!=="$type";case"in":return l.length>=3&&(typeof l[1]!="string"||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return l.length!==3||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const r of l.slice(1))if(!ul(r)&&typeof r!="boolean")return!1;return!0;default:return!0}}const lh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mn(l){if(l==null)return{filter:()=>!0,needGeometry:!1};ul(l)||(l=ch(l));const r=Oa(l,lh);if(r.result==="error")throw new Error(r.value.map(h=>`${h.key}: ${h.message}`).join(", "));return{filter:(h,f,g)=>r.value.evaluate(h,f,{},g),needGeometry:Tf(l)}}function Oc(l,r){return lr?1:0}function Tf(l){if(!Array.isArray(l))return!1;if(l[0]==="within"||l[0]==="distance")return!0;for(let r=1;r"||r==="<="||r===">="?Sf(l[1],l[2],r):r==="any"?(h=l.slice(1),["any"].concat(h.map(ch))):r==="all"?["all"].concat(l.slice(1).map(ch)):r==="none"?["all"].concat(l.slice(1).map(ch).map(dl)):r==="in"?hl(l[1],l.slice(2)):r==="!in"?dl(hl(l[1],l.slice(2))):r==="has"?Ef(l[1]):r!=="!has"||dl(Ef(l[1]));var h}function Sf(l,r,h){switch(l){case"$type":return[`filter-type-${h}`,r];case"$id":return[`filter-id-${h}`,r];default:return[`filter-${h}`,l,r]}}function hl(l,r){if(r.length===0)return!1;switch(l){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(h=>typeof h!=typeof r[0])?["filter-in-large",l,["literal",r.sort(Oc)]]:["filter-in-small",l,["literal",r]]}}function Ef(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function dl(l){return["!",l]}function Af(l){const r=typeof l;if(r==="number"||r==="boolean"||r==="string"||l==null)return JSON.stringify(l);if(Array.isArray(l)){let g="[";for(const v of l)g+=`${Af(v)},`;return`${g}]`}const h=Object.keys(l).sort();let f="{";for(let g=0;gf.maximum?[new je(r,h,`${h} is greater than the maximum value ${f.maximum}`)]:[]}function Cf(l){const r=l.valueSpec,h=zi(l.value.type);let f,g,v,x={};const T=h!=="categorical"&&l.value.property===void 0,A=!T,R=di(l.value.stops)==="array"&&di(l.value.stops[0])==="array"&&di(l.value.stops[0][0])==="object",O=Cn({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function($){if(h==="identity")return[new je($.key,$.value,'identity function may not have a "stops" property')];let q=[];const K=$.value;return q=q.concat(uh({key:$.key,value:K,valueSpec:$.valueSpec,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:F})),di(K)==="array"&&K.length===0&&q.push(new je($.key,K,"array must have at least one stop")),q},default:function($){return $.validateSpec({key:$.key,value:$.value,valueSpec:r,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec})}}});return h==="identity"&&T&&O.push(new je(l.key,l.value,'missing required property "property"')),h==="identity"||l.value.stops||O.push(new je(l.key,l.value,'missing required property "stops"')),h==="exponential"&&l.valueSpec.expression&&!cl(l.valueSpec)&&O.push(new je(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(A&&!Ma(l.valueSpec)?O.push(new je(l.key,l.value,"property functions not supported")):T&&!yf(l.valueSpec)&&O.push(new je(l.key,l.value,"zoom functions not supported"))),h!=="categorical"&&!R||l.value.property!==void 0||O.push(new je(l.key,l.value,'"property" property is required')),O;function F($){let q=[];const K=$.value,ae=$.key;if(di(K)!=="array")return[new je(ae,K,`array expected, ${di(K)} found`)];if(K.length!==2)return[new je(ae,K,`array length 2 expected, length ${K.length} found`)];if(R){if(di(K[0])!=="object")return[new je(ae,K,`object expected, ${di(K[0])} found`)];if(K[0].zoom===void 0)return[new je(ae,K,"object stop key must have zoom")];if(K[0].value===void 0)return[new je(ae,K,"object stop key must have value")];if(v&&v>zi(K[0].zoom))return[new je(ae,K[0].zoom,"stop zoom values must appear in ascending order")];zi(K[0].zoom)!==v&&(v=zi(K[0].zoom),g=void 0,x={}),q=q.concat(Cn({key:`${ae}[0]`,value:K[0],valueSpec:{zoom:{}},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:Dc,value:z}}))}else q=q.concat(z({key:`${ae}[0]`,value:K[0],valueSpec:{},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec},K));return kc(Da(K[1]))?q.concat([new je(`${ae}[1]`,K[1],"expressions are not allowed in function stops.")]):q.concat($.validateSpec({key:`${ae}[1]`,value:K[1],valueSpec:r,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec}))}function z($,q){const K=di($.value),ae=zi($.value),de=$.value!==null?$.value:q;if(f){if(K!==f)return[new je($.key,de,`${K} stop domain type must match previous stop domain type ${f}`)]}else f=K;if(K!=="number"&&K!=="string"&&K!=="boolean")return[new je($.key,de,"stop domain value must be a number, string, or boolean")];if(K!=="number"&&h!=="categorical"){let Re=`number expected, ${K} found`;return Ma(r)&&h===void 0&&(Re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new je($.key,de,Re)]}return h!=="categorical"||K!=="number"||isFinite(ae)&&Math.floor(ae)===ae?h!=="categorical"&&K==="number"&&g!==void 0&&aenew je(`${l.key}${f.key}`,l.value,f.message));const h=r.value.expression||r.value._styleExpression.expression;if(l.expressionContext==="property"&&l.propertyKey==="text-font"&&!h.outputDefined())return[new je(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if(l.expressionContext==="property"&&l.propertyType==="layout"&&!Rc(h))return[new je(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if(l.expressionContext==="filter"&&!Rc(h))return[new je(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&l.expressionContext.indexOf("cluster")===0){if(!ih(h,["zoom","feature-state"]))return[new je(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(l.expressionContext==="cluster-initial"&&!th(h))return[new je(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Fc(l){const r=l.key,h=l.value,f=l.valueSpec,g=[];return Array.isArray(f.values)?f.values.indexOf(zi(h))===-1&&g.push(new je(r,h,`expected one of [${f.values.join(", ")}], ${JSON.stringify(h)} found`)):Object.keys(f.values).indexOf(zi(h))===-1&&g.push(new je(r,h,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(h)} found`)),g}function Nc(l){return ul(Da(l.value))?Fa(Gt({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Bc(l)}function Bc(l){const r=l.value,h=l.key;if(di(r)!=="array")return[new je(h,r,`array expected, ${di(r)} found`)];const f=l.styleSpec;let g,v=[];if(r.length<1)return[new je(h,r,"filter array must have at least 1 element")];switch(v=v.concat(Fc({key:`${h}[0]`,value:r[0],valueSpec:f.filter_operator,style:l.style,styleSpec:l.styleSpec})),zi(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&zi(r[1])==="$type"&&v.push(new je(h,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&v.push(new je(h,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(g=di(r[1]),g!=="string"&&v.push(new je(`${h}[1]`,r[1],`string expected, ${g} found`)));for(let x=2;x{R in h&&r.push(new je(f,h[R],`"${R}" is prohibited for ref layers`))}),g.layers.forEach(R=>{zi(R.id)===T&&(A=R)}),A?A.ref?r.push(new je(f,h.ref,"ref cannot reference another ref layer")):x=zi(A.type):r.push(new je(f,h.ref,`ref layer "${T}" not found`))}else if(x!=="background")if(h.source){const A=g.sources&&g.sources[h.source],R=A&&zi(A.type);A?R==="vector"&&x==="raster"?r.push(new je(f,h.source,`layer "${h.id}" requires a raster source`)):R!=="raster-dem"&&x==="hillshade"?r.push(new je(f,h.source,`layer "${h.id}" requires a raster-dem source`)):R==="raster"&&x!=="raster"?r.push(new je(f,h.source,`layer "${h.id}" requires a vector source`)):R!=="vector"||h["source-layer"]?R==="raster-dem"&&x!=="hillshade"?r.push(new je(f,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!h.paint||!h.paint["line-gradient"]||R==="geojson"&&A.lineMetrics||r.push(new je(f,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new je(f,h,`layer "${h.id}" must specify a "source-layer"`)):r.push(new je(f,h.source,`source "${h.source}" not found`))}else r.push(new je(f,h,'missing required property "source"'));return r=r.concat(Cn({key:f,value:h,valueSpec:v.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${f}.type`,value:h.type,valueSpec:v.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:h,objectKey:"type"}),filter:Nc,layout:A=>Cn({layer:h,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":R=>Mf(Gt({layerType:x},R))}}),paint:A=>Cn({layer:h,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":R=>Rf(Gt({layerType:x},R))}})}})),r}function xo(l){const r=l.value,h=l.key,f=di(r);return f!=="string"?[new je(h,r,`string expected, ${f} found`)]:[]}const Of={promoteId:function({key:l,value:r}){if(di(r)==="string")return xo({key:l,value:r});{const h=[];for(const f in r)h.push(...xo({key:`${l}.${f}`,value:r[f]}));return h}}};function wg(l){const r=l.value,h=l.key,f=l.styleSpec,g=l.style,v=l.validateSpec;if(!r.type)return[new je(h,r,'"type" is required')];const x=zi(r.type);let T;switch(x){case"vector":case"raster":return T=Cn({key:h,value:r,valueSpec:f[`source_${x.replace("-","_")}`],style:l.style,styleSpec:f,objectElementValidators:Of,validateSpec:v}),T;case"raster-dem":return T=function(A){var R;const O=(R=A.sourceName)!==null&&R!==void 0?R:"",F=A.value,z=A.styleSpec,$=z.source_raster_dem,q=A.style;let K=[];const ae=di(F);if(F===void 0)return K;if(ae!=="object")return K.push(new je("source_raster_dem",F,`object expected, ${ae} found`)),K;const de=zi(F.encoding)==="custom",Re=["redFactor","greenFactor","blueFactor","baseShift"],be=A.value.encoding?`"${A.value.encoding}"`:"Default";for(const Ee in F)!de&&Re.includes(Ee)?K.push(new je(Ee,F[Ee],`In "${O}": "${Ee}" is only valid when "encoding" is set to "custom". ${be} encoding found`)):$[Ee]?K=K.concat(A.validateSpec({key:Ee,value:F[Ee],valueSpec:$[Ee],validateSpec:A.validateSpec,style:q,styleSpec:z})):K.push(new je(Ee,F[Ee],`unknown property "${Ee}"`));return K}({sourceName:h,value:r,style:l.style,styleSpec:f,validateSpec:v}),T;case"geojson":if(T=Cn({key:h,value:r,valueSpec:f.source_geojson,style:g,styleSpec:f,validateSpec:v,objectElementValidators:Of}),r.cluster)for(const A in r.clusterProperties){const[R,O]=r.clusterProperties[A],F=typeof R=="string"?[R,["accumulated"],["get",A]]:R;T.push(...Fa({key:`${h}.${A}.map`,value:O,validateSpec:v,expressionContext:"cluster-map"})),T.push(...Fa({key:`${h}.${A}.reduce`,value:F,validateSpec:v,expressionContext:"cluster-reduce"}))}return T;case"video":return Cn({key:h,value:r,valueSpec:f.source_video,style:g,validateSpec:v,styleSpec:f});case"image":return Cn({key:h,value:r,valueSpec:f.source_image,style:g,validateSpec:v,styleSpec:f});case"canvas":return[new je(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Fc({key:`${h}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:g,validateSpec:v,styleSpec:f})}}function Df(l){const r=l.value,h=l.styleSpec,f=h.light,g=l.style;let v=[];const x=di(r);if(r===void 0)return v;if(x!=="object")return v=v.concat([new je("light",r,`object expected, ${x} found`)]),v;for(const T in r){const A=T.match(/^(.*)-transition$/);v=v.concat(A&&f[A[1]]&&f[A[1]].transition?l.validateSpec({key:T,value:r[T],valueSpec:h.transition,validateSpec:l.validateSpec,style:g,styleSpec:h}):f[T]?l.validateSpec({key:T,value:r[T],valueSpec:f[T],validateSpec:l.validateSpec,style:g,styleSpec:h}):[new je(T,r[T],`unknown property "${T}"`)])}return v}function Tg(l){const r=l.value,h=l.styleSpec,f=h.sky,g=l.style,v=di(r);if(r===void 0)return[];if(v!=="object")return[new je("sky",r,`object expected, ${v} found`)];let x=[];for(const T in r)x=x.concat(f[T]?l.validateSpec({key:T,value:r[T],valueSpec:f[T],style:g,styleSpec:h}):[new je(T,r[T],`unknown property "${T}"`)]);return x}function Ff(l){const r=l.value,h=l.styleSpec,f=h.terrain,g=l.style;let v=[];const x=di(r);if(r===void 0)return v;if(x!=="object")return v=v.concat([new je("terrain",r,`object expected, ${x} found`)]),v;for(const T in r)v=v.concat(f[T]?l.validateSpec({key:T,value:r[T],valueSpec:f[T],validateSpec:l.validateSpec,style:g,styleSpec:h}):[new je(T,r[T],`unknown property "${T}"`)]);return v}function Nf(l){let r=[];const h=l.value,f=l.key;if(Array.isArray(h)){const g=[],v=[];for(const x in h)h[x].id&&g.includes(h[x].id)&&r.push(new je(f,h,`all the sprites' ids must be unique, but ${h[x].id} is duplicated`)),g.push(h[x].id),h[x].url&&v.includes(h[x].url)&&r.push(new je(f,h,`all the sprites' URLs must be unique, but ${h[x].url} is duplicated`)),v.push(h[x].url),r=r.concat(Cn({key:`${f}[${x}]`,value:h[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return r}return xo({key:f,value:h})}const Bf={"*":()=>[],array:uh,boolean:function(l){const r=l.value,h=l.key,f=di(r);return f!=="boolean"?[new je(h,r,`boolean expected, ${f} found`)]:[]},number:Dc,color:function(l){const r=l.key,h=l.value,f=di(h);return f!=="string"?[new je(r,h,`color expected, ${f} found`)]:ui.parse(String(h))?[]:[new je(r,h,`color expected, "${h}" found`)]},constants:xg,enum:Fc,filter:Nc,function:Cf,layer:kf,object:Cn,source:wg,light:Df,sky:Tg,terrain:Ff,projection:function(l){const r=l.value,h=l.styleSpec,f=h.projection,g=l.style,v=di(r);if(r===void 0)return[];if(v!=="object")return[new je("projection",r,`object expected, ${v} found`)];let x=[];for(const T in r)x=x.concat(f[T]?l.validateSpec({key:T,value:r[T],valueSpec:f[T],style:g,styleSpec:h}):[new je(T,r[T],`unknown property "${T}"`)]);return x},string:xo,formatted:function(l){return xo(l).length===0?[]:Fa(l)},resolvedImage:function(l){return xo(l).length===0?[]:Fa(l)},padding:function(l){const r=l.key,h=l.value;if(di(h)==="array"){if(h.length<1||h.length>4)return[new je(r,h,`padding requires 1 to 4 values; ${h.length} values found`)];const f={type:"number"};let g=[];for(let v=0;v[]}})),l.constants&&(h=h.concat(xg({key:"constants",value:l.constants,style:l,styleSpec:r,validateSpec:Lc}))),Lf(h)}function Mr(l){return function(r){return l({...r,validateSpec:Lc})}}function Lf(l){return[].concat(l).sort((r,h)=>r.line-h.line)}function kr(l){return function(...r){return Lf(l.apply(this,r))}}dr.source=kr(Mr(wg)),dr.sprite=kr(Mr(Nf)),dr.glyphs=kr(Mr(Sg)),dr.light=kr(Mr(Df)),dr.sky=kr(Mr(Tg)),dr.terrain=kr(Mr(Ff)),dr.layer=kr(Mr(kf)),dr.filter=kr(Mr(Nc)),dr.paintProperty=kr(Mr(Rf)),dr.layoutProperty=kr(Mr(Mf));const wo=dr,Hb=wo.light,zf=wo.sky,qb=wo.paintProperty,Xb=wo.layoutProperty;function Uf(l,r){let h=!1;if(r&&r.length)for(const f of r)l.fire(new xe(new Error(f.message))),h=!0;return h}class fl{constructor(r,h,f){const g=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;const x=new Int32Array(this.arrayBuffer);r=x[0],this.d=(h=x[1])+2*(f=x[2]);for(let A=0;A=F[q+0]&&g>=F[q+1])?(T[$]=!0,x.push(O[$])):T[$]=!1}}}}_forEachCell(r,h,f,g,v,x,T,A){const R=this._convertToCellCoord(r),O=this._convertToCellCoord(h),F=this._convertToCellCoord(f),z=this._convertToCellCoord(g);for(let $=R;$<=F;$++)for(let q=O;q<=z;q++){const K=this.d*q+$;if((!A||A(this._convertFromCellCoord($),this._convertFromCellCoord(q),this._convertFromCellCoord($+1),this._convertFromCellCoord(q+1)))&&v.call(this,r,h,f,g,K,x,T,A))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const r=this.cells,h=3+this.cells.length+1+1;let f=0;for(let x=0;x=0)continue;const x=l[v];g[v]=eo[h].shallow.indexOf(v)>=0?x:zc(x,r)}l instanceof Error&&(g.message=l.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return h!=="Object"&&(g.$name=h),g}function to(l){if(Ag(l))return l;if(Array.isArray(l))return l.map(to);if(typeof l!="object")throw new Error("can't deserialize object of type "+typeof l);const r=Vf(l)||"Object";if(!eo[r])throw new Error(`can't deserialize unregistered class ${r}`);const{klass:h}=eo[r];if(!h)throw new Error(`can't deserialize unregistered class ${r}`);if(h.deserialize)return h.deserialize(l);const f=Object.create(h.prototype);for(const g of Object.keys(l)){if(g==="$name")continue;const v=l[g];f[g]=eo[r].shallow.indexOf(g)>=0?v:to(v)}return f}class Ig{constructor(){this.first=!0}update(r,h){const f=Math.floor(r);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=r,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=h):this.lastFloorZooml>=128&&l<=255,Arabic:l=>l>=1536&&l<=1791,"Arabic Supplement":l=>l>=1872&&l<=1919,"Arabic Extended-A":l=>l>=2208&&l<=2303,"Hangul Jamo":l=>l>=4352&&l<=4607,"Unified Canadian Aboriginal Syllabics":l=>l>=5120&&l<=5759,Khmer:l=>l>=6016&&l<=6143,"Unified Canadian Aboriginal Syllabics Extended":l=>l>=6320&&l<=6399,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"CJK Radicals Supplement":l=>l>=11904&&l<=12031,"Kangxi Radicals":l=>l>=12032&&l<=12255,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Hiragana:l=>l>=12352&&l<=12447,Katakana:l=>l>=12448&&l<=12543,Bopomofo:l=>l>=12544&&l<=12591,"Hangul Compatibility Jamo":l=>l>=12592&&l<=12687,Kanbun:l=>l>=12688&&l<=12703,"Bopomofo Extended":l=>l>=12704&&l<=12735,"CJK Strokes":l=>l>=12736&&l<=12783,"Katakana Phonetic Extensions":l=>l>=12784&&l<=12799,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"CJK Unified Ideographs Extension A":l=>l>=13312&&l<=19903,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"CJK Unified Ideographs":l=>l>=19968&&l<=40959,"Yi Syllables":l=>l>=40960&&l<=42127,"Yi Radicals":l=>l>=42128&&l<=42191,"Hangul Jamo Extended-A":l=>l>=43360&&l<=43391,"Hangul Syllables":l=>l>=44032&&l<=55215,"Hangul Jamo Extended-B":l=>l>=55216&&l<=55295,"Private Use Area":l=>l>=57344&&l<=63743,"CJK Compatibility Ideographs":l=>l>=63744&&l<=64255,"Arabic Presentation Forms-A":l=>l>=64336&&l<=65023,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Arabic Presentation Forms-B":l=>l>=65136&&l<=65279,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function jf(l){for(const r of l)if($f(r.charCodeAt(0)))return!0;return!1}function Zb(l){for(const r of l)if(!Cg(r.charCodeAt(0)))return!1;return!0}function Cg(l){return!(ft.Arabic(l)||ft["Arabic Supplement"](l)||ft["Arabic Extended-A"](l)||ft["Arabic Presentation Forms-A"](l)||ft["Arabic Presentation Forms-B"](l))}function $f(l){return!(l!==746&&l!==747&&(l<4352||!(ft["Bopomofo Extended"](l)||ft.Bopomofo(l)||ft["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||ft["CJK Compatibility Ideographs"](l)||ft["CJK Compatibility"](l)||ft["CJK Radicals Supplement"](l)||ft["CJK Strokes"](l)||!(!ft["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||l===12336)||ft["CJK Unified Ideographs Extension A"](l)||ft["CJK Unified Ideographs"](l)||ft["Enclosed CJK Letters and Months"](l)||ft["Hangul Compatibility Jamo"](l)||ft["Hangul Jamo Extended-A"](l)||ft["Hangul Jamo Extended-B"](l)||ft["Hangul Jamo"](l)||ft["Hangul Syllables"](l)||ft.Hiragana(l)||ft["Ideographic Description Characters"](l)||ft.Kanbun(l)||ft["Kangxi Radicals"](l)||ft["Katakana Phonetic Extensions"](l)||ft.Katakana(l)&&l!==12540||!(!ft["Halfwidth and Fullwidth Forms"](l)||l===65288||l===65289||l===65293||l>=65306&&l<=65310||l===65339||l===65341||l===65343||l>=65371&&l<=65503||l===65507||l>=65512&&l<=65519)||!(!ft["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||ft["Unified Canadian Aboriginal Syllabics"](l)||ft["Unified Canadian Aboriginal Syllabics Extended"](l)||ft["Vertical Forms"](l)||ft["Yijing Hexagram Symbols"](l)||ft["Yi Syllables"](l)||ft["Yi Radicals"](l))))}function Pg(l){return!($f(l)||function(r){return!!(ft["Latin-1 Supplement"](r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||ft["General Punctuation"](r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||ft["Letterlike Symbols"](r)||ft["Number Forms"](r)||ft["Miscellaneous Technical"](r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||ft["Control Pictures"](r)&&r!==9251||ft["Optical Character Recognition"](r)||ft["Enclosed Alphanumerics"](r)||ft["Geometric Shapes"](r)||ft["Miscellaneous Symbols"](r)&&!(r>=9754&&r<=9759)||ft["Miscellaneous Symbols and Arrows"](r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||ft["CJK Symbols and Punctuation"](r)||ft.Katakana(r)||ft["Private Use Area"](r)||ft["CJK Compatibility Forms"](r)||ft["Small Form Variants"](r)||ft["Halfwidth and Fullwidth Forms"](r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)}(l))}function zo(l){return l>=1424&&l<=2303||ft["Arabic Presentation Forms-A"](l)||ft["Arabic Presentation Forms-B"](l)}function Rg(l,r){return!(!r&&zo(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||ft.Khmer(l))}function Wf(l){for(const r of l)if(zo(r.charCodeAt(0)))return!0;return!1}const Uo=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(l){this.pluginStatus=l.pluginStatus,this.pluginURL=l.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(l){this.applyArabicShaping=l.applyArabicShaping,this.processBidirectionalText=l.processBidirectionalText,this.processStyledBidirectionalText=l.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Oi{constructor(r,h){this.zoom=r,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ig,this.transition={})}isSupportedScript(r){return function(h,f){for(const g of h)if(!Rg(g.charCodeAt(0),f))return!1;return!0}(r,Uo.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const r=this.zoom,h=r-Math.floor(r),f=this.crossFadingFactor();return r>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*h}}}class hh{constructor(r,h){this.property=r,this.value=h,this.expression=function(f,g){if(Mc(f))return new oh(f,g);if(kc(f)){const v=vg(f,g);if(v.result==="error")throw new Error(v.value.map(x=>`${x.key}: ${x.message}`).join(", "));return v.value}{let v=f;return g.type==="color"&&typeof f=="string"?v=ui.parse(f):g.type!=="padding"||typeof f!="number"&&!Array.isArray(f)?g.type==="variableAnchorOffsetCollection"&&Array.isArray(f)&&(v=is.parse(f)):v=ls.parse(f),{kind:"constant",evaluate:()=>v}}}(h===void 0?r.specification.default:h,r.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(r,h,f){return this.property.possiblyEvaluate(this,r,h,f)}}class pl{constructor(r){this.property=r,this.value=new hh(r,void 0)}transitioned(r,h){return new Mg(this.property,this.value,h,De({},r.transition,this.transition),r.now)}untransitioned(){return new Mg(this.property,this.value,null,{},0)}}class ml{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitionablePropertyValues)}getValue(r){return He(this._values[r].value.value)}setValue(r,h){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new pl(this._values[r].property)),this._values[r].value=new hh(this._values[r].property,h===null?void 0:He(h))}getTransition(r){return He(this._values[r].transition)}setTransition(r,h){Object.prototype.hasOwnProperty.call(this._values,r)||(this._values[r]=new pl(this._values[r].property)),this._values[r].transition=He(h)||void 0}serialize(){const r={};for(const h of Object.keys(this._values)){const f=this.getValue(h);f!==void 0&&(r[h]=f);const g=this.getTransition(h);g!==void 0&&(r[`${h}-transition`]=g)}return r}transitioned(r,h){const f=new Hf(this._properties);for(const g of Object.keys(this._values))f._values[g]=this._values[g].transitioned(r,h._values[g]);return f}untransitioned(){const r=new Hf(this._properties);for(const h of Object.keys(this._values))r._values[h]=this._values[h].untransitioned();return r}}class Mg{constructor(r,h,f,g,v){this.property=r,this.value=h,this.begin=v+g.delay||0,this.end=this.begin+g.duration||0,r.specification.transition&&(g.delay||g.duration)&&(this.prior=f)}possiblyEvaluate(r,h,f){const g=r.now||0,v=this.value.possiblyEvaluate(r,h,f),x=this.prior;if(x){if(g>this.end)return this.prior=null,v;if(this.value.isDataDriven())return this.prior=null,v;if(g=1)return 1;const R=A*A,O=R*A;return 4*(A<.5?O:3*(A-R)+O-.75)}(T))}}return v}}class Hf{constructor(r){this._properties=r,this._values=Object.create(r.defaultTransitioningPropertyValues)}possiblyEvaluate(r,h,f){const g=new dh(this._properties);for(const v of Object.keys(this._values))g._values[v]=this._values[v].possiblyEvaluate(r,h,f);return g}hasTransition(){for(const r of Object.keys(this._values))if(this._values[r].prior)return!0;return!1}}class Uc{constructor(r){this._properties=r,this._values=Object.create(r.defaultPropertyValues)}hasValue(r){return this._values[r].value!==void 0}getValue(r){return He(this._values[r].value)}setValue(r,h){this._values[r]=new hh(this._values[r].property,h===null?void 0:He(h))}serialize(){const r={};for(const h of Object.keys(this._values)){const f=this.getValue(h);f!==void 0&&(r[h]=f)}return r}possiblyEvaluate(r,h,f){const g=new dh(this._properties);for(const v of Object.keys(this._values))g._values[v]=this._values[v].possiblyEvaluate(r,h,f);return g}}class io{constructor(r,h,f){this.property=r,this.value=h,this.parameters=f}isConstant(){return this.value.kind==="constant"}constantOr(r){return this.value.kind==="constant"?this.value.value:r}evaluate(r,h,f,g){return this.property.evaluate(this.value,this.parameters,r,h,f,g)}}class dh{constructor(r){this._properties=r,this._values=Object.create(r.defaultPossiblyEvaluatedValues)}get(r){return this._values[r]}}class Ct{constructor(r){this.specification=r}possiblyEvaluate(r,h){if(r.isDataDriven())throw new Error("Value should not be data driven");return r.expression.evaluate(h)}interpolate(r,h,f){const g=Xn[this.specification.type];return g?g(r,h,f):r}}class Nt{constructor(r,h){this.specification=r,this.overrides=h}possiblyEvaluate(r,h,f,g){return new io(this,r.expression.kind==="constant"||r.expression.kind==="camera"?{kind:"constant",value:r.expression.evaluate(h,null,{},f,g)}:r.expression,h)}interpolate(r,h,f){if(r.value.kind!=="constant"||h.value.kind!=="constant")return r;if(r.value.value===void 0||h.value.value===void 0)return new io(this,{kind:"constant",value:void 0},r.parameters);const g=Xn[this.specification.type];if(g){const v=g(r.value.value,h.value.value,f);return new io(this,{kind:"constant",value:v},r.parameters)}return r}evaluate(r,h,f,g,v,x){return r.kind==="constant"?r.value:r.evaluate(h,f,g,v,x)}}class b extends Nt{possiblyEvaluate(r,h,f,g){if(r.value===void 0)return new io(this,{kind:"constant",value:void 0},h);if(r.expression.kind==="constant"){const v=r.expression.evaluate(h,null,{},f,g),x=r.property.specification.type==="resolvedImage"&&typeof v!="string"?v.name:v,T=this._calculate(x,x,x,h);return new io(this,{kind:"constant",value:T},h)}if(r.expression.kind==="camera"){const v=this._calculate(r.expression.evaluate({zoom:h.zoom-1}),r.expression.evaluate({zoom:h.zoom}),r.expression.evaluate({zoom:h.zoom+1}),h);return new io(this,{kind:"constant",value:v},h)}return new io(this,r.expression,h)}evaluate(r,h,f,g,v,x){if(r.kind==="source"){const T=r.evaluate(h,f,g,v,x);return this._calculate(T,T,T,h)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(h.zoom)-1},f,g),r.evaluate({zoom:Math.floor(h.zoom)},f,g),r.evaluate({zoom:Math.floor(h.zoom)+1},f,g),h):r.value}_calculate(r,h,f,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:r,to:h}:{from:f,to:h}}interpolate(r){return r}}class o{constructor(r){this.specification=r}possiblyEvaluate(r,h,f,g){if(r.value!==void 0){if(r.expression.kind==="constant"){const v=r.expression.evaluate(h,null,{},f,g);return this._calculate(v,v,v,h)}return this._calculate(r.expression.evaluate(new Oi(Math.floor(h.zoom-1),h)),r.expression.evaluate(new Oi(Math.floor(h.zoom),h)),r.expression.evaluate(new Oi(Math.floor(h.zoom+1),h)),h)}}_calculate(r,h,f,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:r,to:h}:{from:f,to:h}}interpolate(r){return r}}class d{constructor(r){this.specification=r}possiblyEvaluate(r,h,f,g){return!!r.expression.evaluate(h,null,{},f,g)}interpolate(){return!1}}class p{constructor(r){this.properties=r,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const h in r){const f=r[h];f.specification.overridable&&this.overridableProperties.push(h);const g=this.defaultPropertyValues[h]=new hh(f,void 0),v=this.defaultTransitionablePropertyValues[h]=new pl(f);this.defaultTransitioningPropertyValues[h]=v.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=g.possiblyEvaluate({})}}}vt("DataDrivenProperty",Nt),vt("DataConstantProperty",Ct),vt("CrossFadedDataDrivenProperty",b),vt("CrossFadedProperty",o),vt("ColorRampProperty",d);const m="-transition";class y extends Ue{constructor(r,h){if(super(),this.id=r.id,this.type=r.type,this._featureFilter={filter:()=>!0,needGeometry:!1},r.type!=="custom"&&(this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),h.layout&&(this._unevaluatedLayout=new Uc(h.layout)),h.paint)){this._transitionablePaint=new ml(h.paint);for(const f in r.paint)this.setPaintProperty(f,r.paint[f],{validate:!1});for(const f in r.layout)this.setLayoutProperty(f,r.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new dh(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,h,f={}){h!=null&&this._validate(Xb,`layers.${this.id}.layout.${r}`,r,h,f)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,h):this.visibility=h)}getPaintProperty(r){return r.endsWith(m)?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)}setPaintProperty(r,h,f={}){if(h!=null&&this._validate(qb,`layers.${this.id}.paint.${r}`,r,h,f))return!1;if(r.endsWith(m))return this._transitionablePaint.setTransition(r.slice(0,-11),h||void 0),!1;{const g=this._transitionablePaint._values[r],v=g.property.specification["property-type"]==="cross-faded-data-driven",x=g.value.isDataDriven(),T=g.value;this._transitionablePaint.setValue(r,h),this._handleSpecialPaintPropertyUpdate(r);const A=this._transitionablePaint._values[r].value;return A.isDataDriven()||x||v||this._handleOverridablePaintPropertyUpdate(r,T,A)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,h,f){return!1}isHidden(r){return!!(this.minzoom&&r=this.maxzoom)||this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,h){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,h)}serialize(){const r={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&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Qe(r,(h,f)=>!(h===void 0||f==="layout"&&!Object.keys(h).length||f==="paint"&&!Object.keys(h).length))}_validate(r,h,f,g,v={}){return(!v||v.validate!==!1)&&Uf(this,r.call(wo,{key:h,layerType:this.type,objectKey:f,value:g,styleSpec:he,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const r in this.paint._values){const h=this.paint.get(r);if(h instanceof io&&Ma(h.property.specification)&&(h.value.kind==="source"||h.value.kind==="composite")&&h.value.isStateDependent)return!0}return!1}}const E={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class I{constructor(r,h){this._structArray=r,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class M{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(r,h){return r._trim(),h&&(r.isTransferred=!0,h.push(r.arrayBuffer)),{length:r.length,arrayBuffer:r.arrayBuffer}}static deserialize(r){const h=Object.create(this.prototype);return h.arrayBuffer=r.arrayBuffer,h.length=r.length,h.capacity=r.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(r){this.reserve(r),this.length=r}reserve(r){if(r>this.capacity){this.capacity=Math.max(r,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function k(l,r=1){let h=0,f=0;return{members:l.map(g=>{const v=E[g.type].BYTES_PER_ELEMENT,x=h=N(h,Math.max(r,v)),T=g.components||1;return f=Math.max(f,v),h+=v*T,{name:g.name,type:g.type,components:T,offset:x}}),size:N(h,Math.max(f,r)),alignment:r}}function N(l,r){return Math.ceil(l/r)*r}class B extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h){const f=this.length;return this.resize(f+1),this.emplace(f,r,h)}emplace(r,h,f){const g=2*r;return this.int16[g+0]=h,this.int16[g+1]=f,r}}B.prototype.bytesPerElement=4,vt("StructArrayLayout2i4",B);class W extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,h,f)}emplace(r,h,f,g){const v=3*r;return this.int16[v+0]=h,this.int16[v+1]=f,this.int16[v+2]=g,r}}W.prototype.bytesPerElement=6,vt("StructArrayLayout3i6",W);class Z extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,h,f,g)}emplace(r,h,f,g,v){const x=4*r;return this.int16[x+0]=h,this.int16[x+1]=f,this.int16[x+2]=g,this.int16[x+3]=v,r}}Z.prototype.bytesPerElement=8,vt("StructArrayLayout4i8",Z);class ee extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,r,h,f,g,v,x)}emplace(r,h,f,g,v,x,T){const A=6*r;return this.int16[A+0]=h,this.int16[A+1]=f,this.int16[A+2]=g,this.int16[A+3]=v,this.int16[A+4]=x,this.int16[A+5]=T,r}}ee.prototype.bytesPerElement=12,vt("StructArrayLayout2i4i12",ee);class le extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,r,h,f,g,v,x)}emplace(r,h,f,g,v,x,T){const A=4*r,R=8*r;return this.int16[A+0]=h,this.int16[A+1]=f,this.uint8[R+4]=g,this.uint8[R+5]=v,this.uint8[R+6]=x,this.uint8[R+7]=T,r}}le.prototype.bytesPerElement=8,vt("StructArrayLayout2i4ub8",le);class oe extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,h){const f=this.length;return this.resize(f+1),this.emplace(f,r,h)}emplace(r,h,f){const g=2*r;return this.float32[g+0]=h,this.float32[g+1]=f,r}}oe.prototype.bytesPerElement=8,vt("StructArrayLayout2f8",oe);class ue extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x,T,A,R,O){const F=this.length;return this.resize(F+1),this.emplace(F,r,h,f,g,v,x,T,A,R,O)}emplace(r,h,f,g,v,x,T,A,R,O,F){const z=10*r;return this.uint16[z+0]=h,this.uint16[z+1]=f,this.uint16[z+2]=g,this.uint16[z+3]=v,this.uint16[z+4]=x,this.uint16[z+5]=T,this.uint16[z+6]=A,this.uint16[z+7]=R,this.uint16[z+8]=O,this.uint16[z+9]=F,r}}ue.prototype.bytesPerElement=20,vt("StructArrayLayout10ui20",ue);class _e extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x,T,A,R,O,F,z){const $=this.length;return this.resize($+1),this.emplace($,r,h,f,g,v,x,T,A,R,O,F,z)}emplace(r,h,f,g,v,x,T,A,R,O,F,z,$){const q=12*r;return this.int16[q+0]=h,this.int16[q+1]=f,this.int16[q+2]=g,this.int16[q+3]=v,this.uint16[q+4]=x,this.uint16[q+5]=T,this.uint16[q+6]=A,this.uint16[q+7]=R,this.int16[q+8]=O,this.int16[q+9]=F,this.int16[q+10]=z,this.int16[q+11]=$,r}}_e.prototype.bytesPerElement=24,vt("StructArrayLayout4i4ui4i24",_e);class ne extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,h,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,h,f)}emplace(r,h,f,g){const v=3*r;return this.float32[v+0]=h,this.float32[v+1]=f,this.float32[v+2]=g,r}}ne.prototype.bytesPerElement=12,vt("StructArrayLayout3f12",ne);class we extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){const h=this.length;return this.resize(h+1),this.emplace(h,r)}emplace(r,h){return this.uint32[1*r+0]=h,r}}we.prototype.bytesPerElement=4,vt("StructArrayLayout1ul4",we);class Pe extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x,T,A,R){const O=this.length;return this.resize(O+1),this.emplace(O,r,h,f,g,v,x,T,A,R)}emplace(r,h,f,g,v,x,T,A,R,O){const F=10*r,z=5*r;return this.int16[F+0]=h,this.int16[F+1]=f,this.int16[F+2]=g,this.int16[F+3]=v,this.int16[F+4]=x,this.int16[F+5]=T,this.uint32[z+3]=A,this.uint16[F+8]=R,this.uint16[F+9]=O,r}}Pe.prototype.bytesPerElement=20,vt("StructArrayLayout6i1ul2ui20",Pe);class ke extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,r,h,f,g,v,x)}emplace(r,h,f,g,v,x,T){const A=6*r;return this.int16[A+0]=h,this.int16[A+1]=f,this.int16[A+2]=g,this.int16[A+3]=v,this.int16[A+4]=x,this.int16[A+5]=T,r}}ke.prototype.bytesPerElement=12,vt("StructArrayLayout2i2i2i12",ke);class $e extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v){const x=this.length;return this.resize(x+1),this.emplace(x,r,h,f,g,v)}emplace(r,h,f,g,v,x){const T=4*r,A=8*r;return this.float32[T+0]=h,this.float32[T+1]=f,this.float32[T+2]=g,this.int16[A+6]=v,this.int16[A+7]=x,r}}$e.prototype.bytesPerElement=16,vt("StructArrayLayout2f1f2i16",$e);class et extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,h,f,g,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,r,h,f,g,v,x)}emplace(r,h,f,g,v,x,T){const A=16*r,R=4*r,O=8*r;return this.uint8[A+0]=h,this.uint8[A+1]=f,this.float32[R+1]=g,this.float32[R+2]=v,this.int16[O+6]=x,this.int16[O+7]=T,r}}et.prototype.bytesPerElement=16,vt("StructArrayLayout2ub2f2i16",et);class pt extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,h,f)}emplace(r,h,f,g){const v=3*r;return this.uint16[v+0]=h,this.uint16[v+1]=f,this.uint16[v+2]=g,r}}pt.prototype.bytesPerElement=6,vt("StructArrayLayout3ui6",pt);class gt extends M{_refreshViews(){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)}emplaceBack(r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de){const Re=this.length;return this.resize(Re+1),this.emplace(Re,r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de)}emplace(r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de,Re){const be=24*r,Ee=12*r,Le=48*r;return this.int16[be+0]=h,this.int16[be+1]=f,this.uint16[be+2]=g,this.uint16[be+3]=v,this.uint32[Ee+2]=x,this.uint32[Ee+3]=T,this.uint32[Ee+4]=A,this.uint16[be+10]=R,this.uint16[be+11]=O,this.uint16[be+12]=F,this.float32[Ee+7]=z,this.float32[Ee+8]=$,this.uint8[Le+36]=q,this.uint8[Le+37]=K,this.uint8[Le+38]=ae,this.uint32[Ee+10]=de,this.int16[be+22]=Re,r}}gt.prototype.bytesPerElement=48,vt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",gt);class tt extends M{_refreshViews(){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)}emplaceBack(r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de,Re,be,Ee,Le,Je,mt,Dt,ht,ct,At,wt){const bt=this.length;return this.resize(bt+1),this.emplace(bt,r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de,Re,be,Ee,Le,Je,mt,Dt,ht,ct,At,wt)}emplace(r,h,f,g,v,x,T,A,R,O,F,z,$,q,K,ae,de,Re,be,Ee,Le,Je,mt,Dt,ht,ct,At,wt,bt){const Ve=32*r,Pt=16*r;return this.int16[Ve+0]=h,this.int16[Ve+1]=f,this.int16[Ve+2]=g,this.int16[Ve+3]=v,this.int16[Ve+4]=x,this.int16[Ve+5]=T,this.int16[Ve+6]=A,this.int16[Ve+7]=R,this.uint16[Ve+8]=O,this.uint16[Ve+9]=F,this.uint16[Ve+10]=z,this.uint16[Ve+11]=$,this.uint16[Ve+12]=q,this.uint16[Ve+13]=K,this.uint16[Ve+14]=ae,this.uint16[Ve+15]=de,this.uint16[Ve+16]=Re,this.uint16[Ve+17]=be,this.uint16[Ve+18]=Ee,this.uint16[Ve+19]=Le,this.uint16[Ve+20]=Je,this.uint16[Ve+21]=mt,this.uint16[Ve+22]=Dt,this.uint32[Pt+12]=ht,this.float32[Pt+13]=ct,this.float32[Pt+14]=At,this.uint16[Ve+30]=wt,this.uint16[Ve+31]=bt,r}}tt.prototype.bytesPerElement=64,vt("StructArrayLayout8i15ui1ul2f2ui64",tt);class rt extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){const h=this.length;return this.resize(h+1),this.emplace(h,r)}emplace(r,h){return this.float32[1*r+0]=h,r}}rt.prototype.bytesPerElement=4,vt("StructArrayLayout1f4",rt);class Tt extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,h,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,h,f)}emplace(r,h,f,g){const v=3*r;return this.uint16[6*r+0]=h,this.float32[v+1]=f,this.float32[v+2]=g,r}}Tt.prototype.bytesPerElement=12,vt("StructArrayLayout1ui2f12",Tt);class qt extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h,f){const g=this.length;return this.resize(g+1),this.emplace(g,r,h,f)}emplace(r,h,f,g){const v=4*r;return this.uint32[2*r+0]=h,this.uint16[v+2]=f,this.uint16[v+3]=g,r}}qt.prototype.bytesPerElement=8,vt("StructArrayLayout1ul2ui8",qt);class at extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,h){const f=this.length;return this.resize(f+1),this.emplace(f,r,h)}emplace(r,h,f){const g=2*r;return this.uint16[g+0]=h,this.uint16[g+1]=f,r}}at.prototype.bytesPerElement=4,vt("StructArrayLayout2ui4",at);class ut extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){const h=this.length;return this.resize(h+1),this.emplace(h,r)}emplace(r,h){return this.uint16[1*r+0]=h,r}}ut.prototype.bytesPerElement=2,vt("StructArrayLayout1ui2",ut);class zt extends M{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,h,f,g){const v=this.length;return this.resize(v+1),this.emplace(v,r,h,f,g)}emplace(r,h,f,g,v){const x=4*r;return this.float32[x+0]=h,this.float32[x+1]=f,this.float32[x+2]=g,this.float32[x+3]=v,r}}zt.prototype.bytesPerElement=16,vt("StructArrayLayout4f16",zt);class Ui extends I{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new C(this.anchorPointX,this.anchorPointY)}}Ui.prototype.size=20;class Qt extends Pe{get(r){return new Ui(this,r)}}vt("CollisionBoxArray",Qt);class ni extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(r){this._structArray.uint8[this._pos1+37]=r}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(r){this._structArray.uint8[this._pos1+38]=r}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(r){this._structArray.uint32[this._pos4+10]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ni.prototype.size=48;class Vi extends gt{get(r){return new ni(this,r)}}vt("PlacedSymbolArray",Vi);class en extends I{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(r){this._structArray.uint32[this._pos4+12]=r}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}en.prototype.size=64;class Or extends tt{get(r){return new en(this,r)}}vt("SymbolInstanceArray",Or);class ji extends rt{getoffsetX(r){return this.float32[1*r+0]}}vt("GlyphOffsetArray",ji);class Pn extends W{getx(r){return this.int16[3*r+0]}gety(r){return this.int16[3*r+1]}gettileUnitDistanceFromAnchor(r){return this.int16[3*r+2]}}vt("SymbolLineVertexArray",Pn);class gn extends I{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}gn.prototype.size=12;class tn extends Tt{get(r){return new gn(this,r)}}vt("TextAnchorOffsetArray",tn);class sn extends I{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}sn.prototype.size=8;class Dr extends qt{get(r){return new sn(this,r)}}vt("FeatureIndexArray",Dr);class Na extends B{}class fh extends B{}class gl extends B{}class Ba extends ee{}class ph extends le{}class qf extends oe{}class Xs extends ue{}class Fr extends _e{}class Vo extends ne{}class _l extends we{}class nn extends ke{}class rn extends et{}class zs extends pt{}class ss extends at{}const yl=k([{name:"a_pos",components:2,type:"Int16"}],4),{members:Xf}=yl;class Rs{constructor(r=[]){this.segments=r}prepareSegment(r,h,f,g){let v=this.segments[this.segments.length-1];return r>Rs.MAX_VERTEX_ARRAY_LENGTH&&dt(`Max vertices per segment is ${Rs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}`),(!v||v.vertexLength+r>Rs.MAX_VERTEX_ARRAY_LENGTH||v.sortKey!==g)&&(v={vertexOffset:h.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},g!==void 0&&(v.sortKey=g),this.segments.push(v)),v}get(){return this.segments}destroy(){for(const r of this.segments)for(const h in r.vaos)r.vaos[h].destroy()}static simpleSegment(r,h,f,g){return new Rs([{vertexOffset:r,primitiveOffset:h,vertexLength:f,primitiveLength:g,vaos:{},sortKey:0}])}}function kg(l,r){return 256*(l=Se(Math.floor(l),0,255))+Se(Math.floor(r),0,255)}Rs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,vt("SegmentVector",Rs);const mh=k([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var gh={exports:{}},jo={exports:{}};jo.exports=function(l,r){var h,f,g,v,x,T,A,R;for(f=l.length-(h=3&l.length),g=r,x=3432918353,T=461845907,R=0;R>>16)*x&65535)<<16)&4294967295)<<15|A>>>17))*T+(((A>>>16)*T&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(v>>>16)&65535)<<16);switch(A=0,h){case 3:A^=(255&l.charCodeAt(R+2))<<16;case 2:A^=(255&l.charCodeAt(R+1))<<8;case 1:g^=A=(65535&(A=(A=(65535&(A^=255&l.charCodeAt(R)))*x+(((A>>>16)*x&65535)<<16)&4294967295)<<15|A>>>17))*T+(((A>>>16)*T&65535)<<16)&4294967295}return g^=l.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0};var Og=jo.exports,Zf={exports:{}};Zf.exports=function(l,r){for(var h,f=l.length,g=r^f,v=0;f>=4;)h=1540483477*(65535&(h=255&l.charCodeAt(v)|(255&l.charCodeAt(++v))<<8|(255&l.charCodeAt(++v))<<16|(255&l.charCodeAt(++v))<<24))+((1540483477*(h>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),f-=4,++v;switch(f){case 3:g^=(255&l.charCodeAt(v+2))<<16;case 2:g^=(255&l.charCodeAt(v+1))<<8;case 1:g=1540483477*(65535&(g^=255&l.charCodeAt(v)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0};var Kf=Og,Yf=Zf.exports;gh.exports=Kf,gh.exports.murmur3=Kf,gh.exports.murmur2=Yf;var _h=_(gh.exports);class bl{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,h,f,g){this.ids.push(qS(r)),this.positions.push(h,f,g)}getPositions(r){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const h=qS(r);let f=0,g=this.ids.length-1;for(;f>1;this.ids[x]>=h?g=x:f=x+1}const v=[];for(;this.ids[f]===h;)v.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return v}static serialize(r,h){const f=new Float64Array(r.ids),g=new Uint32Array(r.positions);return Kb(f,g,0,f.length-1),h&&h.push(f.buffer,g.buffer),{ids:f,positions:g}}static deserialize(r){const h=new bl;return h.ids=r.ids,h.positions=r.positions,h.indexed=!0,h}}function qS(l){const r=+l;return!isNaN(r)&&r<=Number.MAX_SAFE_INTEGER?r:_h(String(l))}function Kb(l,r,h,f){for(;h>1];let v=h-1,x=f+1;for(;;){do v++;while(l[v]g);if(v>=x)break;Dg(l,v,x),Dg(r,3*v,3*x),Dg(r,3*v+1,3*x+1),Dg(r,3*v+2,3*x+2)}x-h`u_${g}`),this.type=f}setUniform(r,h,f){r.set(f.constantOr(this.value))}getBinding(r,h,f){return this.type==="color"?new ZS(r,h):new Fg(r,h)}}class yh{constructor(r,h){this.uniformNames=h.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(r,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=r.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=r.tlbr}setUniform(r,h,f,g){const v=g==="u_pattern_to"?this.patternTo:g==="u_pattern_from"?this.patternFrom:g==="u_pixel_ratio_to"?this.pixelRatioTo:g==="u_pixel_ratio_from"?this.pixelRatioFrom:null;v&&r.set(v)}getBinding(r,h,f){return f.substr(0,9)==="u_pattern"?new XS(r,h):new Fg(r,h)}}class La{constructor(r,h,f,g){this.expression=r,this.type=f,this.maxValue=0,this.paintVertexAttributes=h.map(v=>({name:`a_${v}`,type:"Float32",components:f==="color"?2:1,offset:0})),this.paintVertexArray=new g}populatePaintArray(r,h,f,g,v){const x=this.paintVertexArray.length,T=this.expression.evaluate(new Oi(0),h,{},g,[],v);this.paintVertexArray.resize(r),this._setPaintValue(x,r,T)}updatePaintArray(r,h,f,g){const v=this.expression.evaluate({zoom:0},f,g);this._setPaintValue(r,h,v)}_setPaintValue(r,h,f){if(this.type==="color"){const g=Yb(f);for(let v=r;v`u_${T}_t`),this.type=f,this.useIntegerZoom=g,this.zoom=v,this.maxValue=0,this.paintVertexAttributes=h.map(T=>({name:`a_${T}`,type:"Float32",components:f==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(r,h,f,g,v){const x=this.expression.evaluate(new Oi(this.zoom),h,{},g,[],v),T=this.expression.evaluate(new Oi(this.zoom+1),h,{},g,[],v),A=this.paintVertexArray.length;this.paintVertexArray.resize(r),this._setPaintValue(A,r,x,T)}updatePaintArray(r,h,f,g){const v=this.expression.evaluate({zoom:this.zoom},f,g),x=this.expression.evaluate({zoom:this.zoom+1},f,g);this._setPaintValue(r,h,v,x)}_setPaintValue(r,h,f,g){if(this.type==="color"){const v=Yb(f),x=Yb(g);for(let T=r;T`#define HAS_UNIFORM_${g}`))}return r}getBinderAttributes(){const r=[];for(const h in this.binders){const f=this.binders[h];if(f instanceof La||f instanceof To)for(let g=0;g!0){this.programConfigurations={};for(const g of r)this.programConfigurations[g.id]=new KS(g,h,f);this.needsUpload=!1,this._featureMap=new bl,this._bufferOffset=0}populatePaintArrays(r,h,f,g,v,x){for(const T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(r,h,g,v,x);h.id!==void 0&&this._featureMap.add(h.id,f,this._bufferOffset,r),this._bufferOffset=r,this.needsUpload=!0}updatePaintArrays(r,h,f,g){for(const v of f)this.needsUpload=this.programConfigurations[v.id].updatePaintArrays(r,this._featureMap,h,v,g)||this.needsUpload}get(r){return this.programConfigurations[r]}upload(r){if(this.needsUpload){for(const h in this.programConfigurations)this.programConfigurations[h].upload(r);this.needsUpload=!1}}destroy(){for(const r in this.programConfigurations)this.programConfigurations[r].destroy()}}function YD(l,r){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"]}[l]||[l.replace(`${r}-`,"").replace(/-/g,"_")]}function YS(l,r,h){const f={color:{source:oe,composite:zt},number:{source:rt,composite:oe}},g=function(v){return{"line-pattern":{source:Xs,composite:Xs},"fill-pattern":{source:Xs,composite:Xs},"fill-extrusion-pattern":{source:Xs,composite:Xs}}[v]}(l);return g&&g[h]||f[r][h]}vt("ConstantBinder",Jf),vt("CrossFadedConstantBinder",yh),vt("SourceExpressionBinder",La),vt("CrossFadedCompositeBinder",vl),vt("CompositeExpressionBinder",To),vt("ProgramConfiguration",KS,{omit:["_buffers"]}),vt("ProgramConfigurationSet",jc);const Ts=8192,Jb=Math.pow(2,14)-1,JS=-Jb-1;function $c(l){const r=Ts/l.extent,h=l.loadGeometry();for(let f=0;fx.x+1||Ax.y+1)&&dt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return h}function Wc(l,r){return{type:l.type,id:l.id,properties:l.properties,geometry:r?$c(l):[]}}function Ng(l,r,h,f,g){l.emplaceBack(2*r+(f+1)/2,2*h+(g+1)/2)}class Gb{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(h=>h.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new fh,this.indexArray=new zs,this.segments=new Rs,this.programConfigurations=new jc(r.layers,r.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(r,h,f){const g=this.layers[0],v=[];let x=null,T=!1;g.type==="circle"&&(x=g.layout.get("circle-sort-key"),T=!x.isConstant());for(const{feature:A,id:R,index:O,sourceLayerIndex:F}of r){const z=this.layers[0]._featureFilter.needGeometry,$=Wc(A,z);if(!this.layers[0]._featureFilter.filter(new Oi(this.zoom),$,f))continue;const q=T?x.evaluate($,{},f):void 0,K={id:R,properties:A.properties,type:A.type,sourceLayerIndex:F,index:O,geometry:z?$.geometry:$c(A),patterns:{},sortKey:q};v.push(K)}T&&v.sort((A,R)=>A.sortKey-R.sortKey);for(const A of v){const{geometry:R,index:O,sourceLayerIndex:F}=A,z=r[O].feature;this.addFeature(A,R,O,f),h.featureIndex.insert(z,R,O,F,this.index)}}update(r,h,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,h,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(r,h,f,g){for(const v of h)for(const x of v){const T=x.x,A=x.y;if(T<0||T>=Ts||A<0||A>=Ts)continue;const R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,r.sortKey),O=R.vertexLength;Ng(this.layoutVertexArray,T,A,-1,-1),Ng(this.layoutVertexArray,T,A,1,-1),Ng(this.layoutVertexArray,T,A,1,1),Ng(this.layoutVertexArray,T,A,-1,1),this.indexArray.emplaceBack(O,O+1,O+2),this.indexArray.emplaceBack(O,O+3,O+2),R.vertexLength+=4,R.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,f,{},g)}}function GS(l,r){for(let h=0;h1){if(Qb(l,r))return!0;for(let f=0;f1?h:h.sub(r)._mult(g)._add(r))}function tE(l,r){let h,f,g,v=!1;for(let x=0;xr.y!=g.y>r.y&&r.x<(g.x-f.x)*(r.y-f.y)/(g.y-f.y)+f.x&&(v=!v)}return v}function bh(l,r){let h=!1;for(let f=0,g=l.length-1;fr.y!=x.y>r.y&&r.x<(x.x-v.x)*(r.y-v.y)/(x.y-v.y)+v.x&&(h=!h)}return h}function eF(l,r,h){const f=h[0],g=h[2];if(l.xg.x&&r.x>g.x||l.yg.y&&r.y>g.y)return!1;const v=yt(l,r,h[0]);return v!==yt(l,r,h[1])||v!==yt(l,r,h[2])||v!==yt(l,r,h[3])}function Gf(l,r,h){const f=r.paint.get(l).value;return f.kind==="constant"?f.value:h.programConfigurations.get(r.id).getMaxValue(l)}function Bg(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function Lg(l,r,h,f,g){if(!r[0]&&!r[1])return l;const v=C.convert(r)._mult(g);h==="viewport"&&v._rotate(-f);const x=[];for(let T=0;TrE(ae,K))}(R,A),$=F?O*T:O;for(const q of g)for(const K of q){const ae=F?K:rE(K,A);let de=$;const Re=zg([],[K.x,K.y,0,1],A);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?de*=Re[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(de*=x.cameraToCenterDistance/Re[3]),JD(z,ae,de))return!0}return!1}}function rE(l,r){const h=zg([],[l.x,l.y,0,1],r);return new C(h[0]/h[3],h[1]/h[3])}class oE extends Gb{}let aE;vt("HeatmapBucket",oE,{omit:["layers"]});var nF={get paint(){return aE=aE||new p({"heatmap-radius":new Nt(he.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Nt(he.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ct(he.paint_heatmap["heatmap-intensity"]),"heatmap-color":new d(he.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ct(he.paint_heatmap["heatmap-opacity"])})}};function iv(l,{width:r,height:h},f,g){if(g){if(g instanceof Uint8ClampedArray)g=new Uint8Array(g.buffer);else if(g.length!==r*h*f)throw new RangeError(`mismatched image size. expected: ${g.length} but got: ${r*h*f}`)}else g=new Uint8Array(r*h*f);return l.width=r,l.height=h,l.data=g,l}function lE(l,{width:r,height:h},f){if(r===l.width&&h===l.height)return;const g=iv({},{width:r,height:h},f);sv(l,g,{x:0,y:0},{x:0,y:0},{width:Math.min(l.width,r),height:Math.min(l.height,h)},f),l.width=r,l.height=h,l.data=g.data}function sv(l,r,h,f,g,v){if(g.width===0||g.height===0)return r;if(g.width>l.width||g.height>l.height||h.x>l.width-g.width||h.y>l.height-g.height)throw new RangeError("out of range source coordinates for image copy");if(g.width>r.width||g.height>r.height||f.x>r.width-g.width||f.y>r.height-g.height)throw new RangeError("out of range destination coordinates for image copy");const x=l.data,T=r.data;if(x===T)throw new Error("srcData equals dstData, so image is already copied");for(let A=0;A{r[l.evaluationKey]=A;const R=l.expression.evaluate(r);g.data[x+T+0]=Math.floor(255*R.r/R.a),g.data[x+T+1]=Math.floor(255*R.g/R.a),g.data[x+T+2]=Math.floor(255*R.b/R.a),g.data[x+T+3]=Math.floor(255*R.a)};if(l.clips)for(let x=0,T=0;x80*h){T=1/0,A=1/0;let O=-1/0,F=-1/0;for(let z=h;zO&&(O=$),q>F&&(F=q)}R=Math.max(O-T,F-A),R=R!==0?32767/R:0}return tp(v,x,h,T,A,R,0),x}function dE(l,r,h,f,g){let v;if(g===function(x,T,A,R){let O=0;for(let F=T,z=A-R;F0)for(let x=r;x=r;x-=f)v=mE(x/f|0,l[x],l[x+1],v);return v&&Ug(v,v.next)&&(sp(v),v=v.next),v}function Hc(l,r){if(!l)return l;r||(r=l);let h,f=l;do if(h=!1,f.steiner||!Ug(f,f.next)&&ys(f.prev,f,f.next)!==0)f=f.next;else{if(sp(f),f=r=f.prev,f===f.next)break;h=!0}while(h||f!==r);return r}function tp(l,r,h,f,g,v,x){if(!l)return;!x&&v&&function(A,R,O,F){let z=A;do z.z===0&&(z.z=nv(z.x,z.y,R,O,F)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==A);z.prevZ.nextZ=null,z.prevZ=null,function($){let q,K=1;do{let ae,de=$;$=null;let Re=null;for(q=0;de;){q++;let be=de,Ee=0;for(let Je=0;Je0||Le>0&&be;)Ee!==0&&(Le===0||!be||de.z<=be.z)?(ae=de,de=de.nextZ,Ee--):(ae=be,be=be.nextZ,Le--),Re?Re.nextZ=ae:$=ae,ae.prevZ=Re,Re=ae;de=be}Re.nextZ=null,K*=2}while(q>1)}(z)}(l,f,g,v);let T=l;for(;l.prev!==l.next;){const A=l.prev,R=l.next;if(v?hF(l,f,g,v):uF(l))r.push(A.i,l.i,R.i),sp(l),l=R.next,T=R.next;else if((l=R)===T){x?x===1?tp(l=dF(Hc(l),r),r,h,f,g,v,2):x===2&&fF(l,r,h,f,g,v):tp(Hc(l),r,h,f,g,v,1);break}}}function uF(l){const r=l.prev,h=l,f=l.next;if(ys(r,h,f)>=0)return!1;const g=r.x,v=h.x,x=f.x,T=r.y,A=h.y,R=f.y,O=gv?g>x?g:x:v>x?v:x,$=T>A?T>R?T:R:A>R?A:R;let q=f.next;for(;q!==r;){if(q.x>=O&&q.x<=z&&q.y>=F&&q.y<=$&&xh(g,T,v,A,x,R,q.x,q.y)&&ys(q.prev,q,q.next)>=0)return!1;q=q.next}return!0}function hF(l,r,h,f){const g=l.prev,v=l,x=l.next;if(ys(g,v,x)>=0)return!1;const T=g.x,A=v.x,R=x.x,O=g.y,F=v.y,z=x.y,$=TA?T>R?T:R:A>R?A:R,ae=O>F?O>z?O:z:F>z?F:z,de=nv($,q,r,h,f),Re=nv(K,ae,r,h,f);let be=l.prevZ,Ee=l.nextZ;for(;be&&be.z>=de&&Ee&&Ee.z<=Re;){if(be.x>=$&&be.x<=K&&be.y>=q&&be.y<=ae&&be!==g&&be!==x&&xh(T,O,A,F,R,z,be.x,be.y)&&ys(be.prev,be,be.next)>=0||(be=be.prevZ,Ee.x>=$&&Ee.x<=K&&Ee.y>=q&&Ee.y<=ae&&Ee!==g&&Ee!==x&&xh(T,O,A,F,R,z,Ee.x,Ee.y)&&ys(Ee.prev,Ee,Ee.next)>=0))return!1;Ee=Ee.nextZ}for(;be&&be.z>=de;){if(be.x>=$&&be.x<=K&&be.y>=q&&be.y<=ae&&be!==g&&be!==x&&xh(T,O,A,F,R,z,be.x,be.y)&&ys(be.prev,be,be.next)>=0)return!1;be=be.prevZ}for(;Ee&&Ee.z<=Re;){if(Ee.x>=$&&Ee.x<=K&&Ee.y>=q&&Ee.y<=ae&&Ee!==g&&Ee!==x&&xh(T,O,A,F,R,z,Ee.x,Ee.y)&&ys(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.nextZ}return!0}function dF(l,r){let h=l;do{const f=h.prev,g=h.next.next;!Ug(f,g)&&fE(f,h,h.next,g)&&ip(f,g)&&ip(g,f)&&(r.push(f.i,h.i,g.i),sp(h),sp(h.next),h=l=g),h=h.next}while(h!==l);return Hc(h)}function fF(l,r,h,f,g,v){let x=l;do{let T=x.next.next;for(;T!==x.prev;){if(x.i!==T.i&&yF(x,T)){let A=pE(x,T);return x=Hc(x,x.next),A=Hc(A,A.next),tp(x,r,h,f,g,v,0),void tp(A,r,h,f,g,v,0)}T=T.next}x=x.next}while(x!==l)}function pF(l,r){return l.x-r.x}function mF(l,r){const h=function(g,v){let x=v;const T=g.x,A=g.y;let R,O=-1/0;do{if(A<=x.y&&A>=x.next.y&&x.next.y!==x.y){const K=x.x+(A-x.y)*(x.next.x-x.x)/(x.next.y-x.y);if(K<=T&&K>O&&(O=K,R=x.x=x.x&&x.x>=z&&T!==x.x&&xh(A<$?T:O,A,z,$,A<$?O:T,A,x.x,x.y)){const K=Math.abs(A-x.y)/(T-x.x);ip(x,g)&&(KR.x||x.x===R.x&&gF(R,x)))&&(R=x,q=K)}x=x.next}while(x!==F);return R}(l,r);if(!h)return r;const f=pE(h,l);return Hc(f,f.next),Hc(h,h.next)}function gF(l,r){return ys(l.prev,l,r.prev)<0&&ys(r.next,l,l.next)<0}function nv(l,r,h,f,g){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-h)*g|0)|l<<8))|l<<4))|l<<2))|l<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-f)*g|0)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function _F(l){let r=l,h=l;do(r.x=(l-x)*(v-T)&&(l-x)*(f-T)>=(h-x)*(r-T)&&(h-x)*(v-T)>=(g-x)*(f-T)}function yF(l,r){return l.next.i!==r.i&&l.prev.i!==r.i&&!function(h,f){let g=h;do{if(g.i!==h.i&&g.next.i!==h.i&&g.i!==f.i&&g.next.i!==f.i&&fE(g,g.next,h,f))return!0;g=g.next}while(g!==h);return!1}(l,r)&&(ip(l,r)&&ip(r,l)&&function(h,f){let g=h,v=!1;const x=(h.x+f.x)/2,T=(h.y+f.y)/2;do g.y>T!=g.next.y>T&&g.next.y!==g.y&&x<(g.next.x-g.x)*(T-g.y)/(g.next.y-g.y)+g.x&&(v=!v),g=g.next;while(g!==h);return v}(l,r)&&(ys(l.prev,l,r.prev)||ys(l,r.prev,r))||Ug(l,r)&&ys(l.prev,l,l.next)>0&&ys(r.prev,r,r.next)>0)}function ys(l,r,h){return(r.y-l.y)*(h.x-r.x)-(r.x-l.x)*(h.y-r.y)}function Ug(l,r){return l.x===r.x&&l.y===r.y}function fE(l,r,h,f){const g=jg(ys(l,r,h)),v=jg(ys(l,r,f)),x=jg(ys(h,f,l)),T=jg(ys(h,f,r));return g!==v&&x!==T||!(g!==0||!Vg(l,h,r))||!(v!==0||!Vg(l,f,r))||!(x!==0||!Vg(h,l,f))||!(T!==0||!Vg(h,r,f))}function Vg(l,r,h){return r.x<=Math.max(l.x,h.x)&&r.x>=Math.min(l.x,h.x)&&r.y<=Math.max(l.y,h.y)&&r.y>=Math.min(l.y,h.y)}function jg(l){return l>0?1:l<0?-1:0}function ip(l,r){return ys(l.prev,l,l.next)<0?ys(l,r,l.next)>=0&&ys(l,l.prev,r)>=0:ys(l,r,l.prev)<0||ys(l,l.next,r)<0}function pE(l,r){const h=rv(l.i,l.x,l.y),f=rv(r.i,r.x,r.y),g=l.next,v=r.prev;return l.next=r,r.prev=l,h.next=g,g.prev=h,f.next=h,h.prev=f,v.next=f,f.prev=v,f}function mE(l,r,h,f){const g=rv(l,r,h);return f?(g.next=f.next,g.prev=f,f.next.prev=g,f.next=g):(g.prev=g,g.next=g),g}function sp(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function rv(l,r,h){return{i:l,x:r,y:h,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ov(l,r,h){const f=h.patternDependencies;let g=!1;for(const v of r){const x=v.paint.get(`${l}-pattern`);x.isConstant()||(g=!0);const T=x.constantOr(null);T&&(g=!0,f[T.to]=!0,f[T.from]=!0)}return g}function av(l,r,h,f,g){const v=g.patternDependencies;for(const x of r){const T=x.paint.get(`${l}-pattern`).value;if(T.kind!=="constant"){let A=T.evaluate({zoom:f-1},h,{},g.availableImages),R=T.evaluate({zoom:f},h,{},g.availableImages),O=T.evaluate({zoom:f+1},h,{},g.availableImages);A=A&&A.name?A.name:A,R=R&&R.name?R.name:R,O=O&&O.name?O.name:O,v[A]=!0,v[R]=!0,v[O]=!0,h.patterns[x.id]={min:A,mid:R,max:O}}}return h}class lv{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(h=>h.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new gl,this.indexArray=new zs,this.indexArray2=new ss,this.programConfigurations=new jc(r.layers,r.zoom),this.segments=new Rs,this.segments2=new Rs,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(r,h,f){this.hasPattern=ov("fill",this.layers,h);const g=this.layers[0].layout.get("fill-sort-key"),v=!g.isConstant(),x=[];for(const{feature:T,id:A,index:R,sourceLayerIndex:O}of r){const F=this.layers[0]._featureFilter.needGeometry,z=Wc(T,F);if(!this.layers[0]._featureFilter.filter(new Oi(this.zoom),z,f))continue;const $=v?g.evaluate(z,{},f,h.availableImages):void 0,q={id:A,properties:T.properties,type:T.type,sourceLayerIndex:O,index:R,geometry:F?z.geometry:$c(T),patterns:{},sortKey:$};x.push(q)}v&&x.sort((T,A)=>T.sortKey-A.sortKey);for(const T of x){const{geometry:A,index:R,sourceLayerIndex:O}=T;if(this.hasPattern){const F=av("fill",this.layers,T,this.zoom,h);this.patternFeatures.push(F)}else this.addFeature(T,A,R,f,{});h.featureIndex.insert(r[R].feature,A,R,O,this.index)}}update(r,h,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,h,this.stateDependentLayers,f)}addFeatures(r,h,f){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,h,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,cF),this.indexBuffer=r.createIndexBuffer(this.indexArray),this.indexBuffer2=r.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(r,h,f,g,v){for(const x of Zu(h,500)){let T=0;for(const $ of x)T+=$.length;const A=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray),R=A.vertexLength,O=[],F=[];for(const $ of x){if($.length===0)continue;$!==x[0]&&F.push(O.length/2);const q=this.segments2.prepareSegment($.length,this.layoutVertexArray,this.indexArray2),K=q.vertexLength;this.layoutVertexArray.emplaceBack($[0].x,$[0].y),this.indexArray2.emplaceBack(K+$.length-1,K),O.push($[0].x),O.push($[0].y);for(let ae=1;ae<$.length;ae++)this.layoutVertexArray.emplaceBack($[ae].x,$[ae].y),this.indexArray2.emplaceBack(K+ae-1,K+ae),O.push($[ae].x),O.push($[ae].y);q.vertexLength+=$.length,q.primitiveLength+=$.length}const z=hE(O,F);for(let $=0;$>3}if(g--,f===1||f===2)v+=l.readSVarint(),x+=l.readSVarint(),f===1&&(r&&T.push(r),r=[]),r.push(new SF(v,x));else{if(f!==7)throw new Error("unknown command "+f);r&&r.push(r[0].clone())}}return r&&T.push(r),T},wh.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var r=l.readVarint()+l.pos,h=1,f=0,g=0,v=0,x=1/0,T=-1/0,A=1/0,R=-1/0;l.pos>3}if(f--,h===1||h===2)(g+=l.readSVarint())T&&(T=g),(v+=l.readSVarint())R&&(R=v);else if(h!==7)throw new Error("unknown command "+h)}return[x,A,T,R]},wh.prototype.toGeoJSON=function(l,r,h){var f,g,v=this.extent*Math.pow(2,h),x=this.extent*l,T=this.extent*r,A=this.loadGeometry(),R=wh.types[this.type];function O($){for(var q=0;q<$.length;q++){var K=$[q];$[q]=[360*(K.x+x)/v-180,360/Math.PI*Math.atan(Math.exp((180-360*(K.y+T)/v)*Math.PI/180))-90]}}switch(this.type){case 1:var F=[];for(f=0;f>3;g=x===1?f.readString():x===2?f.readFloat():x===3?f.readDouble():x===4?f.readVarint64():x===5?f.readVarint():x===6?f.readSVarint():x===7?f.readBoolean():null}return g}(h))}vE.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var r=this._pbf.readVarint()+this._pbf.pos;return new IF(this._pbf,r,this.extent,this._keys,this._values)};var PF=bE;function RF(l,r,h){if(l===3){var f=new PF(h,h.readVarint()+h.pos);f.length&&(r[f.name]=f)}}xl.VectorTile=function(l,r){this.layers=l.readFields(RF,{},r)},xl.VectorTileFeature=yE,xl.VectorTileLayer=bE;const MF=xl.VectorTileFeature.types,cv=Math.pow(2,13);function np(l,r,h,f,g,v,x,T){l.emplaceBack(r,h,2*Math.floor(f*cv)+x,g*cv*2,v*cv*2,Math.round(T))}class uv{constructor(r){this.zoom=r.zoom,this.overscaling=r.overscaling,this.layers=r.layers,this.layerIds=this.layers.map(h=>h.id),this.index=r.index,this.hasPattern=!1,this.layoutVertexArray=new Ba,this.centroidVertexArray=new Na,this.indexArray=new zs,this.programConfigurations=new jc(r.layers,r.zoom),this.segments=new Rs,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(r,h,f){this.features=[],this.hasPattern=ov("fill-extrusion",this.layers,h);for(const{feature:g,id:v,index:x,sourceLayerIndex:T}of r){const A=this.layers[0]._featureFilter.needGeometry,R=Wc(g,A);if(!this.layers[0]._featureFilter.filter(new Oi(this.zoom),R,f))continue;const O={id:v,sourceLayerIndex:T,index:x,geometry:A?R.geometry:$c(g),properties:g.properties,type:g.type,patterns:{}};this.hasPattern?this.features.push(av("fill-extrusion",this.layers,O,this.zoom,h)):this.addFeature(O,O.geometry,x,f,{}),h.featureIndex.insert(g,O.geometry,x,T,this.index,!0)}}addFeatures(r,h,f){for(const g of this.features){const{geometry:v}=g;this.addFeature(g,v,g.index,h,f)}}update(r,h,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,h,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,TF),this.centroidVertexBuffer=r.createVertexBuffer(this.centroidVertexArray,wF.members,!0),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(r,h,f,g,v){for(const x of Zu(h,500)){const T={x:0,y:0,vertexCount:0};let A=0;for(const q of x)A+=q.length;let R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const q of x){if(q.length===0||OF(q))continue;let K=0;for(let ae=0;ae=1){const Re=q[ae-1];if(!kF(de,Re)){R.vertexLength+4>Rs.MAX_VERTEX_ARRAY_LENGTH&&(R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const be=de.sub(Re)._perp()._unit(),Ee=Re.dist(de);K+Ee>32768&&(K=0),np(this.layoutVertexArray,de.x,de.y,be.x,be.y,0,0,K),np(this.layoutVertexArray,de.x,de.y,be.x,be.y,0,1,K),T.x+=2*de.x,T.y+=2*de.y,T.vertexCount+=2,K+=Ee,np(this.layoutVertexArray,Re.x,Re.y,be.x,be.y,0,0,K),np(this.layoutVertexArray,Re.x,Re.y,be.x,be.y,0,1,K),T.x+=2*Re.x,T.y+=2*Re.y,T.vertexCount+=2;const Le=R.vertexLength;this.indexArray.emplaceBack(Le,Le+2,Le+1),this.indexArray.emplaceBack(Le+1,Le+2,Le+3),R.vertexLength+=4,R.primitiveLength+=2}}}}if(R.vertexLength+A>Rs.MAX_VERTEX_ARRAY_LENGTH&&(R=this.segments.prepareSegment(A,this.layoutVertexArray,this.indexArray)),MF[r.type]!=="Polygon")continue;const O=[],F=[],z=R.vertexLength;for(const q of x)if(q.length!==0){q!==x[0]&&F.push(O.length/2);for(let K=0;KTs)||l.y===r.y&&(l.y<0||l.y>Ts)}function OF(l){return l.every(r=>r.x<0)||l.every(r=>r.x>Ts)||l.every(r=>r.y<0)||l.every(r=>r.y>Ts)}let xE;vt("FillExtrusionBucket",uv,{omit:["layers","features"]});var DF={get paint(){return xE=xE||new p({"fill-extrusion-opacity":new Ct(he["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Nt(he["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ct(he["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ct(he["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new b(he["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Nt(he["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Nt(he["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ct(he["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class FF extends y{constructor(r){super(r,DF)}createBucket(r){return new uv(r)}queryRadius(){return Bg(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,h,f,g,v,x,T,A){const R=Lg(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,T),O=this.paint.get("fill-extrusion-height").evaluate(h,f),F=this.paint.get("fill-extrusion-base").evaluate(h,f),z=function(q,K,ae,de){const Re=[];for(const be of q){const Ee=[be.x,be.y,0,1];zg(Ee,Ee,K),Re.push(new C(Ee[0]/Ee[3],Ee[1]/Ee[3]))}return Re}(R,A),$=function(q,K,ae,de){const Re=[],be=[],Ee=de[8]*K,Le=de[9]*K,Je=de[10]*K,mt=de[11]*K,Dt=de[8]*ae,ht=de[9]*ae,ct=de[10]*ae,At=de[11]*ae;for(const wt of q){const bt=[],Ve=[];for(const Pt of wt){const Et=Pt.x,Vt=Pt.y,Ci=de[0]*Et+de[4]*Vt+de[12],Si=de[1]*Et+de[5]*Vt+de[13],Us=de[2]*Et+de[6]*Vt+de[14],so=de[3]*Et+de[7]*Vt+de[15],an=Us+Je,fs=so+mt,Mn=Ci+Dt,kn=Si+ht,On=Us+ct,ps=so+At,Vs=new C((Ci+Ee)/fs,(Si+Le)/fs);Vs.z=an/fs,bt.push(Vs);const _n=new C(Mn/ps,kn/ps);_n.z=On/ps,Ve.push(_n)}Re.push(bt),be.push(Ve)}return[Re,be]}(g,F,O,A);return function(q,K,ae){let de=1/0;QS(ae,K)&&(de=wE(ae,K[0]));for(let Re=0;Reh.id),this.index=r.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new ph,this.layoutVertexArray2=new qf,this.indexArray=new zs,this.programConfigurations=new jc(r.layers,r.zoom),this.segments=new Rs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(r,h,f){this.hasPattern=ov("line",this.layers,h);const g=this.layers[0].layout.get("line-sort-key"),v=!g.isConstant(),x=[];for(const{feature:T,id:A,index:R,sourceLayerIndex:O}of r){const F=this.layers[0]._featureFilter.needGeometry,z=Wc(T,F);if(!this.layers[0]._featureFilter.filter(new Oi(this.zoom),z,f))continue;const $=v?g.evaluate(z,{},f):void 0,q={id:A,properties:T.properties,type:T.type,sourceLayerIndex:O,index:R,geometry:F?z.geometry:$c(T),patterns:{},sortKey:$};x.push(q)}v&&x.sort((T,A)=>T.sortKey-A.sortKey);for(const T of x){const{geometry:A,index:R,sourceLayerIndex:O}=T;if(this.hasPattern){const F=av("line",this.layers,T,this.zoom,h);this.patternFeatures.push(F)}else this.addFeature(T,A,R,f,{});h.featureIndex.insert(r[R].feature,A,R,O,this.index)}}update(r,h,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(r,h,this.stateDependentLayers,f)}addFeatures(r,h,f){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,h,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(r){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=r.createVertexBuffer(this.layoutVertexArray2,zF)),this.layoutVertexBuffer=r.createVertexBuffer(this.layoutVertexArray,BF),this.indexBuffer=r.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(r),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(r){if(r.properties&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(r.properties,"mapbox_clip_end"))return{start:+r.properties.mapbox_clip_start,end:+r.properties.mapbox_clip_end}}addFeature(r,h,f,g,v){const x=this.layers[0].layout,T=x.get("line-join").evaluate(r,{}),A=x.get("line-cap"),R=x.get("line-miter-limit"),O=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(r);for(const F of h)this.addLine(F,r,T,A,R,O);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,r,f,v,g)}addLine(r,h,f,g,v,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let de=0;de=2&&r[A-1].equals(r[A-2]);)A--;let R=0;for(;R0;if(mt&&de>R){const At=z.dist($);if(At>2*O){const wt=z.sub(z.sub($)._mult(O/At)._round());this.updateDistance($,wt),this.addCurrentVertex(wt,K,0,0,F),$=wt}}const ht=$&&q;let ct=ht?f:T?"butt":g;if(ht&&ct==="round"&&(Lev&&(ct="bevel"),ct==="bevel"&&(Le>2&&(ct="flipbevel"),Le100)Re=ae.mult(-1);else{const At=Le*K.add(ae).mag()/K.sub(ae).mag();Re._perp()._mult(At*(Dt?-1:1))}this.addCurrentVertex(z,Re,0,0,F),this.addCurrentVertex(z,Re.mult(-1),0,0,F)}else if(ct==="bevel"||ct==="fakeround"){const At=-Math.sqrt(Le*Le-1),wt=Dt?At:0,bt=Dt?0:At;if($&&this.addCurrentVertex(z,K,wt,bt,F),ct==="fakeround"){const Ve=Math.round(180*Je/Math.PI/20);for(let Pt=1;Pt2*O){const wt=z.add(q.sub(z)._mult(O/At)._round());this.updateDistance(z,wt),this.addCurrentVertex(wt,ae,0,0,F),z=wt}}}}addCurrentVertex(r,h,f,g,v,x=!1){const T=h.y*g-h.x,A=-h.y-h.x*g;this.addHalfVertex(r,h.x+h.y*f,h.y-h.x*f,x,!1,f,v),this.addHalfVertex(r,T,A,x,!0,-g,v),this.distance>TE/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(r,h,f,g,v,x))}addHalfVertex({x:r,y:h},f,g,v,x,T,A){const R=.5*(this.lineClips?this.scaledDistance*(TE-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((r<<1)+(v?1:0),(h<<1)+(x?1:0),Math.round(63*f)+128,Math.round(63*g)+128,1+(T===0?0:T<0?-1:1)|(63&R)<<2,R>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const O=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,O),A.primitiveLength++),x?this.e2=O:this.e1=O}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(r,h){this.distance+=r.dist(h),this.updateScaledDistance()}}let SE,EE;vt("LineBucket",hv,{omit:["layers","patternFeatures"]});var AE={get paint(){return EE=EE||new p({"line-opacity":new Nt(he.paint_line["line-opacity"]),"line-color":new Nt(he.paint_line["line-color"]),"line-translate":new Ct(he.paint_line["line-translate"]),"line-translate-anchor":new Ct(he.paint_line["line-translate-anchor"]),"line-width":new Nt(he.paint_line["line-width"]),"line-gap-width":new Nt(he.paint_line["line-gap-width"]),"line-offset":new Nt(he.paint_line["line-offset"]),"line-blur":new Nt(he.paint_line["line-blur"]),"line-dasharray":new o(he.paint_line["line-dasharray"]),"line-pattern":new b(he.paint_line["line-pattern"]),"line-gradient":new d(he.paint_line["line-gradient"])})},get layout(){return SE=SE||new p({"line-cap":new Ct(he.layout_line["line-cap"]),"line-join":new Nt(he.layout_line["line-join"]),"line-miter-limit":new Ct(he.layout_line["line-miter-limit"]),"line-round-limit":new Ct(he.layout_line["line-round-limit"]),"line-sort-key":new Nt(he.layout_line["line-sort-key"])})}};class jF extends Nt{possiblyEvaluate(r,h){return h=new Oi(Math.floor(h.zoom),{now:h.now,fadeDuration:h.fadeDuration,zoomHistory:h.zoomHistory,transition:h.transition}),super.possiblyEvaluate(r,h)}evaluate(r,h,f,g){return h=De({},h,{zoom:Math.floor(h.zoom)}),super.evaluate(r,h,f,g)}}let $g;class $F extends y{constructor(r){super(r,AE),this.gradientVersion=0,$g||($g=new jF(AE.paint.properties["line-width"].specification),$g.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){const h=this.gradientExpression();this.stepInterpolant=!!function(f){return f._styleExpression!==void 0}(h)&&h._styleExpression.expression instanceof xt,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(r,h){super.recalculate(r,h),this.paint._values["line-floorwidth"]=$g.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)}createBucket(r){return new hv(r)}queryRadius(r){const h=r,f=IE(Gf("line-width",this,h),Gf("line-gap-width",this,h)),g=Gf("line-offset",this,h);return f/2+Math.abs(g)+Bg(this.paint.get("line-translate"))}queryIntersectsFeature(r,h,f,g,v,x,T){const A=Lg(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,T),R=T/2*IE(this.paint.get("line-width").evaluate(h,f),this.paint.get("line-gap-width").evaluate(h,f)),O=this.paint.get("line-offset").evaluate(h,f);return O&&(g=function(F,z){const $=[];for(let q=0;q=3){for(let ae=0;ae0?r+2*l:l}const WF=k([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),HF=k([{name:"a_projected_pos",components:3,type:"Float32"}],4);k([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const qF=k([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);k([{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"}]);const CE=k([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),XF=k([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ZF(l,r,h){return l.sections.forEach(f=>{f.text=function(g,v,x){const T=v.layout.get("text-transform").evaluate(x,{});return T==="uppercase"?g=g.toLocaleUpperCase():T==="lowercase"&&(g=g.toLocaleLowerCase()),Uo.applyArabicShaping&&(g=Uo.applyArabicShaping(g)),g}(f.text,r,h)}),l}k([{name:"triangle",components:3,type:"Uint16"}]),k([{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"}]),k([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),k([{type:"Float32",name:"offsetX"}]),k([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),k([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const op={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ms=24,PE=Ti,RE=function(l,r,h,f,g){var v,x,T=8*g-f-1,A=(1<>1,O=-7,F=g-1,z=-1,$=l[r+F];for(F+=z,v=$&(1<<-O)-1,$>>=-O,O+=T;O>0;v=256*v+l[r+F],F+=z,O-=8);for(x=v&(1<<-O)-1,v>>=-O,O+=f;O>0;x=256*x+l[r+F],F+=z,O-=8);if(v===0)v=1-R;else{if(v===A)return x?NaN:1/0*($?-1:1);x+=Math.pow(2,f),v-=R}return($?-1:1)*x*Math.pow(2,v-f)},ME=function(l,r,h,f,g,v){var x,T,A,R=8*v-g-1,O=(1<>1,z=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=0,q=1,K=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(T=isNaN(r)?1:0,x=O):(x=Math.floor(Math.log(r)/Math.LN2),r*(A=Math.pow(2,-x))<1&&(x--,A*=2),(r+=x+F>=1?z/A:z*Math.pow(2,1-F))*A>=2&&(x++,A/=2),x+F>=O?(T=0,x=O):x+F>=1?(T=(r*A-1)*Math.pow(2,g),x+=F):(T=r*Math.pow(2,F-1)*Math.pow(2,g),x=0));g>=8;l[h+$]=255&T,$+=q,T/=256,g-=8);for(x=x<0;l[h+$]=255&x,$+=q,x/=256,R-=8);l[h+$-q]|=128*K};function Ti(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ti.Varint=0,Ti.Fixed64=1,Ti.Bytes=2,Ti.Fixed32=5;var dv=4294967296,kE=1/dv,OE=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function za(l){return l.type===Ti.Bytes?l.readVarint()+l.pos:l.pos+1}function Th(l,r,h){return h?4294967296*r+(l>>>0):4294967296*(r>>>0)+(l>>>0)}function DE(l,r,h){var f=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(7*Math.LN2));h.realloc(f);for(var g=h.pos-1;g>=l;g--)h.buf[g+f]=h.buf[g]}function KF(l,r){for(var h=0;h>>8,l[h+2]=r>>>16,l[h+3]=r>>>24}function FE(l,r){return(l[r]|l[r+1]<<8|l[r+2]<<16)+(l[r+3]<<24)}Ti.prototype={destroy:function(){this.buf=null},readFields:function(l,r,h){for(h=h||this.length;this.pos>3,v=this.pos;this.type=7&f,l(g,r,this),this.pos===v&&this.skip(f)}return r},readMessage:function(l,r){return this.readFields(l,r,this.readVarint()+this.pos)},readFixed32:function(){var l=Wg(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=FE(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Wg(this.buf,this.pos)+Wg(this.buf,this.pos+4)*dv;return this.pos+=8,l},readSFixed64:function(){var l=Wg(this.buf,this.pos)+FE(this.buf,this.pos+4)*dv;return this.pos+=8,l},readFloat:function(){var l=RE(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=RE(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var r,h,f=this.buf;return r=127&(h=f[this.pos++]),h<128?r:(r|=(127&(h=f[this.pos++]))<<7,h<128?r:(r|=(127&(h=f[this.pos++]))<<14,h<128?r:(r|=(127&(h=f[this.pos++]))<<21,h<128?r:function(g,v,x){var T,A,R=x.buf;if(T=(112&(A=R[x.pos++]))>>4,A<128||(T|=(127&(A=R[x.pos++]))<<3,A<128)||(T|=(127&(A=R[x.pos++]))<<10,A<128)||(T|=(127&(A=R[x.pos++]))<<17,A<128)||(T|=(127&(A=R[x.pos++]))<<24,A<128)||(T|=(1&(A=R[x.pos++]))<<31,A<128))return Th(g,T,v);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&(h=f[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var l=this.readVarint()+this.pos,r=this.pos;return this.pos=l,l-r>=12&&OE?function(h,f,g){return OE.decode(h.subarray(f,g))}(this.buf,r,l):function(h,f,g){for(var v="",x=f;x239?4:O>223?3:O>191?2:1;if(x+z>g)break;z===1?O<128&&(F=O):z===2?(192&(T=h[x+1]))==128&&(F=(31&O)<<6|63&T)<=127&&(F=null):z===3?(A=h[x+2],(192&(T=h[x+1]))==128&&(192&A)==128&&((F=(15&O)<<12|(63&T)<<6|63&A)<=2047||F>=55296&&F<=57343)&&(F=null)):z===4&&(A=h[x+2],R=h[x+3],(192&(T=h[x+1]))==128&&(192&A)==128&&(192&R)==128&&((F=(15&O)<<18|(63&T)<<12|(63&A)<<6|63&R)<=65535||F>=1114112)&&(F=null)),F===null?(F=65533,z=1):F>65535&&(F-=65536,v+=String.fromCharCode(F>>>10&1023|55296),F=56320|1023&F),v+=String.fromCharCode(F),x+=z}return v}(this.buf,r,l)},readBytes:function(){var l=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,l);return this.pos=l,r},readPackedVarint:function(l,r){if(this.type!==Ti.Bytes)return l.push(this.readVarint(r));var h=za(this);for(l=l||[];this.pos127;);else if(r===Ti.Bytes)this.pos=this.readVarint()+this.pos;else if(r===Ti.Fixed32)this.pos+=4;else{if(r!==Ti.Fixed64)throw new Error("Unimplemented type: "+r);this.pos+=8}},writeTag:function(l,r){this.writeVarint(l<<3|r)},realloc:function(l){for(var r=this.length||16;r268435455||l<0?function(r,h){var f,g;if(r>=0?(f=r%4294967296|0,g=r/4294967296|0):(g=~(-r/4294967296),4294967295^(f=~(-r%4294967296))?f=f+1|0:(f=0,g=g+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(v,x,T){T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,T.buf[T.pos]=127&(v>>>=7)}(f,0,h),function(v,x){var T=(7&v)<<4;x.buf[x.pos++]|=T|((v>>>=3)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v)))))}(g,h)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(!!l)},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var r=this.pos;this.pos=function(f,g,v){for(var x,T,A=0;A55295&&x<57344){if(!T){x>56319||A+1===g.length?(f[v++]=239,f[v++]=191,f[v++]=189):T=x;continue}if(x<56320){f[v++]=239,f[v++]=191,f[v++]=189,T=x;continue}x=T-55296<<10|x-56320|65536,T=null}else T&&(f[v++]=239,f[v++]=191,f[v++]=189,T=null);x<128?f[v++]=x:(x<2048?f[v++]=x>>6|192:(x<65536?f[v++]=x>>12|224:(f[v++]=x>>18|240,f[v++]=x>>12&63|128),f[v++]=x>>6&63|128),f[v++]=63&x|128)}return v}(this.buf,l,this.pos);var h=this.pos-r;h>=128&&DE(r,h,this),this.pos=r-1,this.writeVarint(h),this.pos+=h},writeFloat:function(l){this.realloc(4),ME(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),ME(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var r=l.length;this.writeVarint(r),this.realloc(r);for(var h=0;h=128&&DE(h,f,this),this.pos=h-1,this.writeVarint(f),this.pos+=f},writeMessage:function(l,r,h){this.writeTag(l,Ti.Bytes),this.writeRawMessage(r,h)},writePackedVarint:function(l,r){r.length&&this.writeMessage(l,KF,r)},writePackedSVarint:function(l,r){r.length&&this.writeMessage(l,YF,r)},writePackedBoolean:function(l,r){r.length&&this.writeMessage(l,QF,r)},writePackedFloat:function(l,r){r.length&&this.writeMessage(l,JF,r)},writePackedDouble:function(l,r){r.length&&this.writeMessage(l,GF,r)},writePackedFixed32:function(l,r){r.length&&this.writeMessage(l,eN,r)},writePackedSFixed32:function(l,r){r.length&&this.writeMessage(l,tN,r)},writePackedFixed64:function(l,r){r.length&&this.writeMessage(l,iN,r)},writePackedSFixed64:function(l,r){r.length&&this.writeMessage(l,sN,r)},writeBytesField:function(l,r){this.writeTag(l,Ti.Bytes),this.writeBytes(r)},writeFixed32Field:function(l,r){this.writeTag(l,Ti.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(l,r){this.writeTag(l,Ti.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(l,r){this.writeTag(l,Ti.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(l,r){this.writeTag(l,Ti.Fixed64),this.writeSFixed64(r)},writeVarintField:function(l,r){this.writeTag(l,Ti.Varint),this.writeVarint(r)},writeSVarintField:function(l,r){this.writeTag(l,Ti.Varint),this.writeSVarint(r)},writeStringField:function(l,r){this.writeTag(l,Ti.Bytes),this.writeString(r)},writeFloatField:function(l,r){this.writeTag(l,Ti.Fixed32),this.writeFloat(r)},writeDoubleField:function(l,r){this.writeTag(l,Ti.Fixed64),this.writeDouble(r)},writeBooleanField:function(l,r){this.writeVarintField(l,!!r)}};var fv=_(PE);const pv=3;function nN(l,r,h){l===1&&h.readMessage(rN,r)}function rN(l,r,h){if(l===3){const{id:f,bitmap:g,width:v,height:x,left:T,top:A,advance:R}=h.readMessage(oN,{});r.push({id:f,bitmap:new ep({width:v+2*pv,height:x+2*pv},g),metrics:{width:v,height:x,left:T,top:A,advance:R}})}}function oN(l,r,h){l===1?r.id=h.readVarint():l===2?r.bitmap=h.readBytes():l===3?r.width=h.readVarint():l===4?r.height=h.readVarint():l===5?r.left=h.readSVarint():l===6?r.top=h.readSVarint():l===7&&(r.advance=h.readVarint())}const NE=pv;function BE(l){let r=0,h=0;for(const x of l)r+=x.w*x.h,h=Math.max(h,x.w);l.sort((x,T)=>T.h-x.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),h),h:1/0}];let g=0,v=0;for(const x of l)for(let T=f.length-1;T>=0;T--){const A=f[T];if(!(x.w>A.w||x.h>A.h)){if(x.x=A.x,x.y=A.y,v=Math.max(v,x.y+x.h),g=Math.max(g,x.x+x.w),x.w===A.w&&x.h===A.h){const R=f.pop();T=0&&f>=r&&qg[this.text.charCodeAt(f)];f--)h--;this.text=this.text.substring(r,h),this.sectionIndex=this.sectionIndex.slice(r,h)}substring(r,h){const f=new Eh;return f.text=this.text.substring(r,h),f.sectionIndex=this.sectionIndex.slice(r,h),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,h)=>Math.max(r,this.sections[h].scale),0)}addTextSection(r,h){this.text+=r.text,this.sections.push(lp.forText(r.scale,r.fontStack||h));const f=this.sections.length-1;for(let g=0;g=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Hg(l,r,h,f,g,v,x,T,A,R,O,F,z,$,q){const K=Eh.fromFeature(l,g);let ae;F===u.ai.vertical&&K.verticalizePunctuation();const{processBidirectionalText:de,processStyledBidirectionalText:Re}=Uo;if(de&&K.sections.length===1){ae=[];const Le=de(K.toString(),gv(K,R,v,r,f,$));for(const Je of Le){const mt=new Eh;mt.text=Je,mt.sections=K.sections;for(let Dt=0;Dt0&&Ua>cn&&(cn=Ua)}else{const zr=mt[fi.fontStack],Zs=zr&&zr[$i];if(Zs&&Zs.rect)Ph=Zs.rect,cs=Zs.metrics;else{const Ua=Je[fi.fontStack],fp=Ua&&Ua[$i];if(!fp)continue;cs=fp.metrics}fr=(Vs-fi.scale)*Ms}no?(Le.verticalizable=!0,Dn.push({glyph:$i,imageName:Wo,x:Vt,y:Ci+fr,vertical:no,scale:fi.scale,fontStack:fi.fontStack,sectionIndex:Di,metrics:cs,rect:Ph}),Vt+=Ho*fi.scale+Ve):(Dn.push({glyph:$i,imageName:Wo,x:Vt,y:Ci+fr,vertical:no,scale:fi.scale,fontStack:fi.fontStack,sectionIndex:Di,metrics:cs,rect:Ph}),Vt+=cs.advance*fi.scale+Ve)}Dn.length!==0&&(Si=Math.max(Vt-Ve,Si),uN(Dn,0,Dn.length-1,so,cn)),Vt=0;const Lr=ct*Vs+cn;ln.lineOffset=Math.max(cn,_n),Ci+=Lr,Us=Math.max(Lr,Us),++an}var fs;const Mn=Ci-ap,{horizontalAlign:kn,verticalAlign:On}=_v(At);(function(ps,Vs,_n,ln,Dn,cn,Lr,Jn,fi){const Di=(Vs-_n)*Dn;let $i=0;$i=cn!==Lr?-Jn*ln-ap:(-ln*fi+.5)*Lr;for(const fr of ps)for(const cs of fr.positionedGlyphs)cs.x+=Di,cs.y+=$i})(Le.positionedLines,so,kn,On,Si,Us,ct,Mn,ht.length),Le.top+=-On*Mn,Le.bottom=Le.top+Mn,Le.left+=-kn*Si,Le.right=Le.left+Si}(Ee,r,h,f,ae,x,T,A,F,R,z,q),!function(Le){for(const Je of Le)if(Je.positionedGlyphs.length!==0)return!1;return!0}(be)&&Ee}const qg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},aN={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},lN={40:!0};function zE(l,r,h,f,g,v){if(r.imageName){const x=f[r.imageName];return x?x.displaySize[0]*r.scale*Ms/v+g:0}{const x=h[r.fontStack],T=x&&x[l];return T?T.metrics.advance*r.scale+g:0}}function UE(l,r,h,f){const g=Math.pow(l-r,2);return f?l=0;let R=0;for(let F=0;FR){const O=Math.ceil(v/R);g*=O/x,x=O}return{x1:f,y1:g,x2:f+v,y2:g+x}}function WE(l,r,h,f,g,v){const x=l.image;let T;if(x.content){const ae=x.content,de=x.pixelRatio||1;T=[ae[0]/de,ae[1]/de,x.displaySize[0]-ae[2]/de,x.displaySize[1]-ae[3]/de]}const A=r.left*v,R=r.right*v;let O,F,z,$;h==="width"||h==="both"?($=g[0]+A-f[3],F=g[0]+R+f[1]):($=g[0]+(A+R-x.displaySize[0])/2,F=$+x.displaySize[0]);const q=r.top*v,K=r.bottom*v;return h==="height"||h==="both"?(O=g[1]+q-f[0],z=g[1]+K+f[2]):(O=g[1]+(q+K-x.displaySize[1])/2,z=O+x.displaySize[1]),{image:x,top:O,right:F,bottom:z,left:$,collisionPadding:T}}const cp=255,$o=128,Tl=cp*$o;function HE(l,r){const{expression:h}=r;if(h.kind==="constant")return{kind:"constant",layoutSize:h.evaluate(new Oi(l+1))};if(h.kind==="source")return{kind:"source"};{const{zoomStops:f,interpolationType:g}=h;let v=0;for(;vx.id),this.index=r.index,this.pixelRatio=r.pixelRatio,this.sourceLayerIndex=r.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=tv([]),this.placementViewportMatrix=tv([]);const h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=HE(this.zoom,h["text-size"]),this.iconSizeData=HE(this.zoom,h["icon-size"]);const f=this.layers[0].layout,g=f.get("symbol-sort-key"),v=f.get("symbol-z-order");this.canOverlap=yv(f,"text-overlap","text-allow-overlap")!=="never"||yv(f,"icon-overlap","icon-allow-overlap")!=="never"||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey=v!=="viewport-y"&&!g.isConstant(),this.sortFeaturesByY=(v==="viewport-y"||v==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,f.get("symbol-placement")==="point"&&(this.writingModes=f.get("text-writing-mode").map(x=>u.ai[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=r.sourceID}createArrays(){this.text=new vv(new jc(this.layers,this.zoom,r=>/^text/.test(r))),this.icon=new vv(new jc(this.layers,this.zoom,r=>/^icon/.test(r))),this.glyphOffsetArray=new ji,this.lineVertexArray=new Pn,this.symbolInstances=new Or,this.textAnchorOffsets=new tn}calculateGlyphDependencies(r,h,f,g,v){for(let x=0;x0)&&(x.value.kind!=="constant"||x.value.value.length>0),O=A.value.kind!=="constant"||!!A.value.value||Object.keys(A.parameters).length>0,F=v.get("symbol-sort-key");if(this.features=[],!R&&!O)return;const z=h.iconDependencies,$=h.glyphDependencies,q=h.availableImages,K=new Oi(this.zoom);for(const{feature:ae,id:de,index:Re,sourceLayerIndex:be}of r){const Ee=g._featureFilter.needGeometry,Le=Wc(ae,Ee);if(!g._featureFilter.filter(K,Le,f))continue;let Je,mt;if(Ee||(Le.geometry=$c(ae)),R){const ht=g.getValueAndResolveTokens("text-field",Le,f,q),ct=ds.factory(ht),At=this.hasRTLText=this.hasRTLText||pN(ct);(!At||Uo.getRTLTextPluginStatus()==="unavailable"||At&&Uo.isParsed())&&(Je=ZF(ct,g,Le))}if(O){const ht=g.getValueAndResolveTokens("icon-image",Le,f,q);mt=ht instanceof Bi?ht:Bi.fromString(ht)}if(!Je&&!mt)continue;const Dt=this.sortFeaturesByKey?F.evaluate(Le,{},f):void 0;if(this.features.push({id:de,text:Je,icon:mt,index:Re,sourceLayerIndex:be,geometry:Le.geometry,properties:ae.properties,type:dN[ae.type],sortKey:Dt}),mt&&(z[mt.name]=!0),Je){const ht=x.evaluate(Le,{},f).join(","),ct=v.get("text-rotation-alignment")!=="viewport"&&v.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(u.ai.vertical)>=0;for(const At of Je.sections)if(At.image)z[At.image.name]=!0;else{const wt=jf(Je.toString()),bt=At.fontStack||ht,Ve=$[bt]=$[bt]||{};this.calculateGlyphDependencies(At.text,Ve,ct,this.allowVerticalPlacement,wt)}}}v.get("symbol-placement")==="line"&&(this.features=function(ae){const de={},Re={},be=[];let Ee=0;function Le(ht){be.push(ae[ht]),Ee++}function Je(ht,ct,At){const wt=Re[ht];return delete Re[ht],Re[ct]=wt,be[wt].geometry[0].pop(),be[wt].geometry[0]=be[wt].geometry[0].concat(At[0]),wt}function mt(ht,ct,At){const wt=de[ct];return delete de[ct],de[ht]=wt,be[wt].geometry[0].shift(),be[wt].geometry[0]=At[0].concat(be[wt].geometry[0]),wt}function Dt(ht,ct,At){const wt=At?ct[0][ct[0].length-1]:ct[0][0];return`${ht}:${wt.x}:${wt.y}`}for(let ht=0;htht.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ae,de)=>ae.sortKey-de.sortKey)}update(r,h,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(r,h,this.layers,f),this.icon.programConfigurations.updatePaintArrays(r,h,this.layers,f))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(r){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(r),this.iconCollisionBox.upload(r)),this.text.upload(r,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(r,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(r,h){const f=this.lineVertexArray.length;if(r.segment!==void 0){let g=r.dist(h[r.segment+1]),v=r.dist(h[r.segment]);const x={};for(let T=r.segment+1;T=0;T--)x[T]={x:h[T].x,y:h[T].y,tileUnitDistanceFromAnchor:v},T>0&&(v+=h[T-1].dist(h[T]));for(let T=0;T0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(r,h){const f=r.placedSymbolArray.get(h),g=f.vertexStartIndex+4*f.numGlyphs;for(let v=f.vertexStartIndex;vg[T]-g[A]||v[A]-v[T]),x}addToSortKeyRanges(r,h){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===h?f.symbolInstanceEnd=r+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:r,symbolInstanceEnd:r+1})}sortFeatures(r){if(this.sortFeaturesByY&&this.sortedAngle!==r&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(r),this.sortedAngle=r,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const h of this.symbolInstanceIndexes){const f=this.symbolInstances.get(h);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((g,v,x)=>{g>=0&&x.indexOf(g)===v&&this.addIndicesForPlacedSymbol(this.text,g)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let qE,XE;vt("SymbolBucket",Ah,{omit:["layers","collisionBoxArray","features","compareText"]}),Ah.MAX_GLYPHS=65535,Ah.addDynamicAttributes=bv;var wv={get paint(){return XE=XE||new p({"icon-opacity":new Nt(he.paint_symbol["icon-opacity"]),"icon-color":new Nt(he.paint_symbol["icon-color"]),"icon-halo-color":new Nt(he.paint_symbol["icon-halo-color"]),"icon-halo-width":new Nt(he.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Nt(he.paint_symbol["icon-halo-blur"]),"icon-translate":new Ct(he.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ct(he.paint_symbol["icon-translate-anchor"]),"text-opacity":new Nt(he.paint_symbol["text-opacity"]),"text-color":new Nt(he.paint_symbol["text-color"],{runtimeType:vi,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new Nt(he.paint_symbol["text-halo-color"]),"text-halo-width":new Nt(he.paint_symbol["text-halo-width"]),"text-halo-blur":new Nt(he.paint_symbol["text-halo-blur"]),"text-translate":new Ct(he.paint_symbol["text-translate"]),"text-translate-anchor":new Ct(he.paint_symbol["text-translate-anchor"])})},get layout(){return qE=qE||new p({"symbol-placement":new Ct(he.layout_symbol["symbol-placement"]),"symbol-spacing":new Ct(he.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ct(he.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Nt(he.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ct(he.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ct(he.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ct(he.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ct(he.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ct(he.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ct(he.layout_symbol["icon-rotation-alignment"]),"icon-size":new Nt(he.layout_symbol["icon-size"]),"icon-text-fit":new Ct(he.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ct(he.layout_symbol["icon-text-fit-padding"]),"icon-image":new Nt(he.layout_symbol["icon-image"]),"icon-rotate":new Nt(he.layout_symbol["icon-rotate"]),"icon-padding":new Nt(he.layout_symbol["icon-padding"]),"icon-keep-upright":new Ct(he.layout_symbol["icon-keep-upright"]),"icon-offset":new Nt(he.layout_symbol["icon-offset"]),"icon-anchor":new Nt(he.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ct(he.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ct(he.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ct(he.layout_symbol["text-rotation-alignment"]),"text-field":new Nt(he.layout_symbol["text-field"]),"text-font":new Nt(he.layout_symbol["text-font"]),"text-size":new Nt(he.layout_symbol["text-size"]),"text-max-width":new Nt(he.layout_symbol["text-max-width"]),"text-line-height":new Ct(he.layout_symbol["text-line-height"]),"text-letter-spacing":new Nt(he.layout_symbol["text-letter-spacing"]),"text-justify":new Nt(he.layout_symbol["text-justify"]),"text-radial-offset":new Nt(he.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ct(he.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Nt(he.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Nt(he.layout_symbol["text-anchor"]),"text-max-angle":new Ct(he.layout_symbol["text-max-angle"]),"text-writing-mode":new Ct(he.layout_symbol["text-writing-mode"]),"text-rotate":new Nt(he.layout_symbol["text-rotate"]),"text-padding":new Ct(he.layout_symbol["text-padding"]),"text-keep-upright":new Ct(he.layout_symbol["text-keep-upright"]),"text-transform":new Nt(he.layout_symbol["text-transform"]),"text-offset":new Nt(he.layout_symbol["text-offset"]),"text-allow-overlap":new Ct(he.layout_symbol["text-allow-overlap"]),"text-overlap":new Ct(he.layout_symbol["text-overlap"]),"text-ignore-placement":new Ct(he.layout_symbol["text-ignore-placement"]),"text-optional":new Ct(he.layout_symbol["text-optional"])})}};class ZE{constructor(r){if(r.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=r.property.overrides?r.property.overrides.runtimeType:Cs,this.defaultValue=r}evaluate(r){if(r.formattedSection){const h=this.defaultValue.property.overrides;if(h&&h.hasOverride(r.formattedSection))return h.getOverride(r.formattedSection)}return r.feature&&r.featureState?this.defaultValue.evaluate(r.feature,r.featureState):this.defaultValue.property.specification.default}eachChild(r){this.defaultValue.isConstant()||r(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}vt("FormatSectionOverride",ZE,{omit:["defaultValue"]});class Zg extends y{constructor(r){super(r,wv)}recalculate(r,h){if(super.recalculate(r,h),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const f=this.layout.get("text-writing-mode");if(f){const g=[];for(const v of f)g.indexOf(v)<0&&g.push(v);this.layout._values["text-writing-mode"]=g}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,h,f,g){const v=this.layout.get(r).evaluate(h,{},f,g),x=this._unevaluatedLayout._values[r];return x.isDataDriven()||kc(x.value)||!v?v:function(T,A){return A.replace(/{([^{}]+)}/g,(R,O)=>T&&O in T?String(T[O]):"")}(h.properties,v)}createBucket(r){return new Ah(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const r of wv.paint.overridableProperties){if(!Zg.hasPaintOverride(this.layout,r))continue;const h=this.paint.get(r),f=new ZE(h),g=new rh(f,h.property.specification);let v=null;v=h.value.kind==="constant"||h.value.kind==="source"?new xf("source",g):new wf("composite",g,h.value.zoomStops),this.paint._values[r]=new io(h.property,v,h.parameters)}}_handleOverridablePaintPropertyUpdate(r,h,f){return!(!this.layout||h.isDataDriven()||f.isDataDriven())&&Zg.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,h){const f=r.get("text-field"),g=wv.paint.properties[h];let v=!1;const x=T=>{for(const A of T)if(g.overrides&&g.overrides.hasOverride(A))return void(v=!0)};if(f.value.kind==="constant"&&f.value.value instanceof ds)x(f.value.value.sections);else if(f.value.kind==="source"){const T=R=>{v||(R instanceof ur&&Ki(R.value)===Cr?x(R.value.sections):R instanceof qu?x(R.sections):R.eachChild(T))},A=f.value;A._styleExpression&&T(A._styleExpression.expression)}return v}}let KE;var mN={get paint(){return KE=KE||new p({"background-color":new Ct(he.paint_background["background-color"]),"background-pattern":new o(he.paint_background["background-pattern"]),"background-opacity":new Ct(he.paint_background["background-opacity"])})}};class gN extends y{constructor(r){super(r,mN)}}let YE;var _N={get paint(){return YE=YE||new p({"raster-opacity":new Ct(he.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ct(he.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ct(he.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ct(he.paint_raster["raster-brightness-max"]),"raster-saturation":new Ct(he.paint_raster["raster-saturation"]),"raster-contrast":new Ct(he.paint_raster["raster-contrast"]),"raster-resampling":new Ct(he.paint_raster["raster-resampling"]),"raster-fade-duration":new Ct(he.paint_raster["raster-fade-duration"])})}};class yN extends y{constructor(r){super(r,_N)}}class bN extends y{constructor(r){super(r,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class vN{constructor(r){this._methodToThrottle=r,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Tv=63710088e-1;class Sl{constructor(r,h){if(isNaN(r)||isNaN(h))throw new Error(`Invalid LngLat object: (${r}, ${h})`);if(this.lng=+r,this.lat=+h,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Sl(ge(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){const h=Math.PI/180,f=this.lat*h,g=r.lat*h,v=Math.sin(f)*Math.sin(g)+Math.cos(f)*Math.cos(g)*Math.cos((r.lng-this.lng)*h);return Tv*Math.acos(Math.min(v,1))}static convert(r){if(r instanceof Sl)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new Sl(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r!==null)return new Sl(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const JE=2*Math.PI*Tv;function GE(l){return JE*Math.cos(l*Math.PI/180)}function QE(l){return(180+l)/360}function eA(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function tA(l,r){return l/GE(r)}function Sv(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class Kg{constructor(r,h,f=0){this.x=+r,this.y=+h,this.z=+f}static fromLngLat(r,h=0){const f=Sl.convert(r);return new Kg(QE(f.lng),eA(f.lat),tA(h,f.lat))}toLngLat(){return new Sl(360*this.x-180,Sv(this.y))}toAltitude(){return this.z*GE(Sv(this.y))}meterInMercatorCoordinateUnits(){return 1/JE*(r=Sv(this.y),1/Math.cos(r*Math.PI/180));var r}}function iA(l,r,h){var f=2*Math.PI*6378137/256/Math.pow(2,h);return[l*f-2*Math.PI*6378137/2,r*f-2*Math.PI*6378137/2]}class Ev{constructor(r,h,f){if(r<0||r>25||f<0||f>=Math.pow(2,r)||h<0||h>=Math.pow(2,r))throw new Error(`x=${h}, y=${f}, z=${r} outside of bounds. 0<=x<${Math.pow(2,r)}, 0<=y<${Math.pow(2,r)} 0<=z<=25 `);this.z=r,this.x=h,this.y=f,this.key=up(0,r,r,h,f)}equals(r){return this.z===r.z&&this.x===r.x&&this.y===r.y}url(r,h,f){const g=(x=this.y,T=this.z,A=iA(256*(v=this.x),256*(x=Math.pow(2,T)-x-1),T),R=iA(256*(v+1),256*(x+1),T),A[0]+","+A[1]+","+R[0]+","+R[1]);var v,x,T,A,R;const O=function(F,z,$){let q,K="";for(let ae=F;ae>0;ae--)q=1<1?"@2x":"").replace(/{quadkey}/g,O).replace(/{bbox-epsg-3857}/g,g)}isChildOf(r){const h=this.z-r.z;return h>0&&r.x===this.x>>h&&r.y===this.y>>h}getTilePoint(r){const h=Math.pow(2,this.z);return new C((r.x*h-this.x)*Ts,(r.y*h-this.y)*Ts)}toString(){return`${this.z}/${this.x}/${this.y}`}}class sA{constructor(r,h){this.wrap=r,this.canonical=h,this.key=up(r,h.z,h.z,h.x,h.y)}}class Br{constructor(r,h,f,g,v){if(r= z; overscaledZ = ${r}; z = ${f}`);this.overscaledZ=r,this.wrap=h,this.canonical=new Ev(f,+g,+v),this.key=up(h,r,f,g,v)}clone(){return new Br(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const h=this.canonical.z-r;return r>this.canonical.z?new Br(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Br(r,this.wrap,r,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(r,h){if(r>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-r;return r>this.canonical.z?up(this.wrap*+h,r,this.canonical.z,this.canonical.x,this.canonical.y):up(this.wrap*+h,r,r,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(r){if(r.wrap!==this.wrap)return!1;const h=this.canonical.z-r.canonical.z;return r.overscaledZ===0||r.overscaledZ>h&&r.canonical.y===this.canonical.y>>h}children(r){if(this.overscaledZ>=r)return[new Br(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const h=this.canonical.z+1,f=2*this.canonical.x,g=2*this.canonical.y;return[new Br(h,this.wrap,h,f,g),new Br(h,this.wrap,h,f+1,g),new Br(h,this.wrap,h,f,g+1),new Br(h,this.wrap,h,f+1,g+1)]}isLessThan(r){return this.wrapr.wrap)&&(this.overscaledZr.overscaledZ)&&(this.canonical.xr.canonical.x)&&this.canonical.ythis.max&&(this.max=F),F=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(h+1)*this.stride+(r+1)}unpack(r,h,f){return r*this.redFactor+h*this.greenFactor+f*this.blueFactor-this.baseShift}getPixels(){return new Nr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(r,h,f){if(this.dim!==r.dim)throw new Error("dem dimension mismatch");let g=h*this.dim,v=h*this.dim+this.dim,x=f*this.dim,T=f*this.dim+this.dim;switch(h){case-1:g=v-1;break;case 1:v=g+1}switch(f){case-1:x=T-1;break;case 1:T=x+1}const A=-h*this.dim,R=-f*this.dim;for(let O=x;O=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${r} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[r]}}class oA{constructor(r,h,f,g,v){this.type="Feature",this._vectorTileFeature=r,r._z=h,r._x=f,r._y=g,this.properties=r.properties,this.id=v}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(r){this._geometry=r}toJSON(){const r={geometry:this.geometry};for(const h in this)h!=="_geometry"&&h!=="_vectorTileFeature"&&(r[h]=this[h]);return r}}class aA{constructor(r,h){this.tileID=r,this.x=r.canonical.x,this.y=r.canonical.y,this.z=r.canonical.z,this.grid=new fl(Ts,16,0),this.grid3D=new fl(Ts,16,0),this.featureIndexArray=new Dr,this.promoteId=h}insert(r,h,f,g,v,x){const T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,g,v);const A=x?this.grid3D:this.grid;for(let R=0;R=0&&F[3]>=0&&A.insert(T,F[0],F[1],F[2],F[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new xl.VectorTile(new fv(this.rawTileData)).layers,this.sourceLayerCoder=new rA(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(r,h,f,g){this.loadVTLayers();const v=r.params||{},x=Ts/r.tileSize/r.scale,T=mn(v.filter),A=r.queryGeometry,R=r.queryPadding*x,O=cA(A),F=this.grid.query(O.minX-R,O.minY-R,O.maxX+R,O.maxY+R),z=cA(r.cameraQueryGeometry),$=this.grid3D.query(z.minX-R,z.minY-R,z.maxX+R,z.maxY+R,(ae,de,Re,be)=>function(Ee,Le,Je,mt,Dt){for(const ct of Ee)if(Le<=ct.x&&Je<=ct.y&&mt>=ct.x&&Dt>=ct.y)return!0;const ht=[new C(Le,Je),new C(Le,Dt),new C(mt,Dt),new C(mt,Je)];if(Ee.length>2){for(const ct of ht)if(bh(Ee,ct))return!0}for(let ct=0;ct(be||(be=$c(Ee)),Le.queryIntersectsFeature(A,Ee,Je,be,this.z,r.transform,x,r.pixelPosMatrix)))}return q}loadMatchingFeature(r,h,f,g,v,x,T,A,R,O,F){const z=this.bucketLayerIDs[h];if(x&&!function(ae,de){for(let Re=0;Re=0)return!0;return!1}(x,z))return;const $=this.sourceLayerCoder.decode(f),q=this.vtLayers[$].feature(g);if(v.needGeometry){const ae=Wc(q,!0);if(!v.filter(new Oi(this.tileID.overscaledZ),ae,this.tileID.canonical))return}else if(!v.filter(new Oi(this.tileID.overscaledZ),q))return;const K=this.getId(q,$);for(let ae=0;ae{const T=r instanceof dh?r.get(x):null;return T&&T.evaluate?T.evaluate(h,f,g):T})}function cA(l){let r=1/0,h=1/0,f=-1/0,g=-1/0;for(const v of l)r=Math.min(r,v.x),h=Math.min(h,v.y),f=Math.max(f,v.x),g=Math.max(g,v.y);return{minX:r,minY:h,maxX:f,maxY:g}}function xN(l,r){return r-l}function uA(l,r,h,f,g){const v=[];for(let x=0;x=f&&F.x>=f||(O.x>=f?O=new C(f,O.y+(f-O.x)/(F.x-O.x)*(F.y-O.y))._round():F.x>=f&&(F=new C(f,O.y+(f-O.x)/(F.x-O.x)*(F.y-O.y))._round()),O.y>=g&&F.y>=g||(O.y>=g?O=new C(O.x+(g-O.y)/(F.y-O.y)*(F.x-O.x),g)._round():F.y>=g&&(F=new C(O.x+(g-O.y)/(F.y-O.y)*(F.x-O.x),g)._round()),A&&O.equals(A[A.length-1])||(A=[O],v.push(A)),A.push(F)))))}}return v}vt("FeatureIndex",aA,{omit:["rawTileData","sourceLayerCoder"]});class El extends C{constructor(r,h,f,g){super(r,h),this.angle=f,g!==void 0&&(this.segment=g)}clone(){return new El(this.x,this.y,this.angle,this.segment)}}function hA(l,r,h,f,g){if(r.segment===void 0||h===0)return!0;let v=r,x=r.segment+1,T=0;for(;T>-h/2;){if(x--,x<0)return!1;T-=l[x].dist(v),v=l[x]}T+=l[x].dist(l[x+1]),x++;const A=[];let R=0;for(;Tf;)R-=A.shift().angleDelta;if(R>g)return!1;x++,T+=O.dist(F)}return!0}function dA(l){let r=0;for(let h=0;hR){const q=(R-A)/$,K=Xn.number(F.x,z.x,q),ae=Xn.number(F.y,z.y,q),de=new El(K,ae,z.angleTo(F),O);return de._round(),!x||hA(l,de,T,x,r)?de:void 0}A+=$}}function TN(l,r,h,f,g,v,x,T,A){const R=fA(f,v,x),O=pA(f,g),F=O*x,z=l[0].x===0||l[0].x===A||l[0].y===0||l[0].y===A;return r-F=0&&Ee=0&&Le=0&&z+R<=O){const Je=new El(Ee,Le,Re,q);Je._round(),f&&!hA(l,Je,v,f,g)||$.push(Je)}}F+=de}return T||$.length||x||($=mA(l,F/2,h,f,g,v,x,!0,A)),$}vt("Anchor",El);const Ih=Yn;function gA(l,r,h,f){const g=[],v=l.image,x=v.pixelRatio,T=v.paddedRect.w-2*Ih,A=v.paddedRect.h-2*Ih;let R={x1:l.left,y1:l.top,x2:l.right,y2:l.bottom};const O=v.stretchX||[[0,T]],F=v.stretchY||[[0,A]],z=(Ve,Pt)=>Ve+Pt[1]-Pt[0],$=O.reduce(z,0),q=F.reduce(z,0),K=T-$,ae=A-q;let de=0,Re=$,be=0,Ee=q,Le=0,Je=K,mt=0,Dt=ae;if(v.content&&f){const Ve=v.content,Pt=Ve[2]-Ve[0],Et=Ve[3]-Ve[1];(v.textFitWidth||v.textFitHeight)&&(R=$E(l)),de=Yg(O,0,Ve[0]),be=Yg(F,0,Ve[1]),Re=Yg(O,Ve[0],Ve[2]),Ee=Yg(F,Ve[1],Ve[3]),Le=Ve[0]-de,mt=Ve[1]-be,Je=Pt-Re,Dt=Et-Ee}const ht=R.x1,ct=R.y1,At=R.x2-ht,wt=R.y2-ct,bt=(Ve,Pt,Et,Vt)=>{const Ci=Jg(Ve.stretch-de,Re,At,ht),Si=Gg(Ve.fixed-Le,Je,Ve.stretch,$),Us=Jg(Pt.stretch-be,Ee,wt,ct),so=Gg(Pt.fixed-mt,Dt,Pt.stretch,q),an=Jg(Et.stretch-de,Re,At,ht),fs=Gg(Et.fixed-Le,Je,Et.stretch,$),Mn=Jg(Vt.stretch-be,Ee,wt,ct),kn=Gg(Vt.fixed-mt,Dt,Vt.stretch,q),On=new C(Ci,Us),ps=new C(an,Us),Vs=new C(an,Mn),_n=new C(Ci,Mn),ln=new C(Si/x,so/x),Dn=new C(fs/x,kn/x),cn=r*Math.PI/180;if(cn){const fi=Math.sin(cn),Di=Math.cos(cn),$i=[Di,-fi,fi,Di];On._matMult($i),ps._matMult($i),_n._matMult($i),Vs._matMult($i)}const Lr=Ve.stretch+Ve.fixed,Jn=Pt.stretch+Pt.fixed;return{tl:On,tr:ps,bl:_n,br:Vs,tex:{x:v.paddedRect.x+Ih+Lr,y:v.paddedRect.y+Ih+Jn,w:Et.stretch+Et.fixed-Lr,h:Vt.stretch+Vt.fixed-Jn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ln,pixelOffsetBR:Dn,minFontScaleX:Je/x/At,minFontScaleY:Dt/x/wt,isSDF:h}};if(f&&(v.stretchX||v.stretchY)){const Ve=_A(O,K,$),Pt=_A(F,ae,q);for(let Et=0;Et0&&(K=Math.max(10,K),this.circleDiameter=K)}else{const z=!((F=x.image)===null||F===void 0)&&F.content&&(x.image.textFitWidth||x.image.textFitHeight)?$E(x):{x1:x.left,y1:x.top,x2:x.right,y2:x.bottom};z.y1=z.y1*T-A[0],z.y2=z.y2*T+A[2],z.x1=z.x1*T-A[3],z.x2=z.x2*T+A[1];const $=x.collisionPadding;if($&&(z.x1-=$[0]*T,z.y1-=$[1]*T,z.x2+=$[2]*T,z.y2+=$[3]*T),O){const q=new C(z.x1,z.y1),K=new C(z.x2,z.y1),ae=new C(z.x1,z.y2),de=new C(z.x2,z.y2),Re=O*Math.PI/180;q._rotate(Re),K._rotate(Re),ae._rotate(Re),de._rotate(Re),z.x1=Math.min(q.x,K.x,ae.x,de.x),z.x2=Math.max(q.x,K.x,ae.x,de.x),z.y1=Math.min(q.y,K.y,ae.y,de.y),z.y2=Math.max(q.y,K.y,ae.y,de.y)}r.emplaceBack(h.x,h.y,z.x1,z.y1,z.x2,z.y2,f,g,v)}this.boxEndIndex=r.length}}class SN{constructor(r=[],h=(f,g)=>fg?1:0){if(this.data=r,this.length=this.data.length,this.compare=h,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],h=this.data.pop();return--this.length>0&&(this.data[0]=h,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:h,compare:f}=this,g=h[r];for(;r>0;){const v=r-1>>1,x=h[v];if(f(g,x)>=0)break;h[r]=x,r=v}h[r]=g}_down(r){const{data:h,compare:f}=this,g=this.length>>1,v=h[r];for(;r=0)break;h[r]=h[x],r=x}h[r]=v}}function EN(l,r=1,h=!1){let f=1/0,g=1/0,v=-1/0,x=-1/0;const T=l[0];for(let $=0;$v)&&(v=q.x),(!$||q.y>x)&&(x=q.y)}const A=Math.min(v-f,x-g);let R=A/2;const O=new SN([],AN);if(A===0)return new C(f,g);for(let $=f;$F.d||!F.d)&&(F=$,h&&console.log("found best %d after %d probes",Math.round(1e4*$.d)/1e4,z)),$.max-F.d<=r||(R=$.h/2,O.push(new Ch($.p.x-R,$.p.y-R,R,l)),O.push(new Ch($.p.x+R,$.p.y-R,R,l)),O.push(new Ch($.p.x-R,$.p.y+R,R,l)),O.push(new Ch($.p.x+R,$.p.y+R,R,l)),z+=4)}return h&&(console.log(`num probes: ${z}`),console.log(`best distance: ${F.d}`)),F.p}function AN(l,r){return r.max-l.max}function Ch(l,r,h,f){this.p=new C(l,r),this.h=h,this.d=function(g,v){let x=!1,T=1/0;for(let A=0;Ag.y!=q.y>g.y&&g.x<(q.x-$.x)*(g.y-$.y)/(q.y-$.y)+$.x&&(x=!x),T=Math.min(T,eE(g,$,q))}}return(x?1:-1)*Math.sqrt(T)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}var on;u.ar=void 0,(on=u.ar||(u.ar={}))[on.center=1]="center",on[on.left=2]="left",on[on.right=3]="right",on[on.top=4]="top",on[on.bottom=5]="bottom",on[on["top-left"]=6]="top-left",on[on["top-right"]=7]="top-right",on[on["bottom-left"]=8]="bottom-left",on[on["bottom-right"]=9]="bottom-right";const Al=7,Av=Number.POSITIVE_INFINITY;function yA(l,r){return r[1]!==Av?function(h,f,g){let v=0,x=0;switch(f=Math.abs(f),g=Math.abs(g),h){case"top-right":case"top-left":case"top":x=g-Al;break;case"bottom-right":case"bottom-left":case"bottom":x=-g+Al}switch(h){case"top-right":case"bottom-right":case"right":v=-f;break;case"top-left":case"bottom-left":case"left":v=f}return[v,x]}(l,r[0],r[1]):function(h,f){let g=0,v=0;f<0&&(f=0);const x=f/Math.SQRT2;switch(h){case"top-right":case"top-left":v=x-Al;break;case"bottom-right":case"bottom-left":v=-x+Al;break;case"bottom":v=-f+Al;break;case"top":v=f-Al}switch(h){case"top-right":case"bottom-right":g=-x;break;case"top-left":case"bottom-left":g=x;break;case"left":g=f;break;case"right":g=-f}return[g,v]}(l,r[0])}function bA(l,r,h){var f;const g=l.layout,v=(f=g.get("text-variable-anchor-offset"))===null||f===void 0?void 0:f.evaluate(r,{},h);if(v){const T=v.values,A=[];for(let R=0;Rz*Ms);O.startsWith("top")?F[1]-=Al:O.startsWith("bottom")&&(F[1]+=Al),A[R+1]=F}return new is(A)}const x=g.get("text-variable-anchor");if(x){let T;T=l._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[g.get("text-radial-offset").evaluate(r,{},h)*Ms,Av]:g.get("text-offset").evaluate(r,{},h).map(R=>R*Ms);const A=[];for(const R of x)A.push(R,yA(R,T));return new is(A)}return null}function Iv(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function IN(l,r,h,f,g,v,x,T,A,R,O){let F=v.textMaxSize.evaluate(r,{});F===void 0&&(F=x);const z=l.layers[0].layout,$=z.get("icon-offset").evaluate(r,{},O),q=xA(h.horizontal),K=x/24,ae=l.tilePixelRatio*K,de=l.tilePixelRatio*F/24,Re=l.tilePixelRatio*T,be=l.tilePixelRatio*z.get("symbol-spacing"),Ee=z.get("text-padding")*l.tilePixelRatio,Le=function(Ve,Pt,Et,Vt=1){const Ci=Ve.get("icon-padding").evaluate(Pt,{},Et),Si=Ci&&Ci.values;return[Si[0]*Vt,Si[1]*Vt,Si[2]*Vt,Si[3]*Vt]}(z,r,O,l.tilePixelRatio),Je=z.get("text-max-angle")/180*Math.PI,mt=z.get("text-rotation-alignment")!=="viewport"&&z.get("symbol-placement")!=="point",Dt=z.get("icon-rotation-alignment")==="map"&&z.get("symbol-placement")!=="point",ht=z.get("symbol-placement"),ct=be/2,At=z.get("icon-text-fit");let wt;f&&At!=="none"&&(l.allowVerticalPlacement&&h.vertical&&(wt=WE(f,h.vertical,At,z.get("icon-text-fit-padding"),$,K)),q&&(f=WE(f,q,At,z.get("icon-text-fit-padding"),$,K)));const bt=(Ve,Pt)=>{Pt.x<0||Pt.x>=Ts||Pt.y<0||Pt.y>=Ts||function(Et,Vt,Ci,Si,Us,so,an,fs,Mn,kn,On,ps,Vs,_n,ln,Dn,cn,Lr,Jn,fi,Di,$i,fr,cs,Ph){const Wo=Et.addToLineVertexArray(Vt,Ci);let Ho,no,zr,Zs,Ua=0,fp=0,EA=0,AA=0,Fv=-1,Nv=-1;const Va={};let IA=_h("");if(Et.allowVerticalPlacement&&Si.vertical){const yn=fs.layout.get("text-rotate").evaluate(Di,{},cs)+90;zr=new Qg(Mn,Vt,kn,On,ps,Si.vertical,Vs,_n,ln,yn),an&&(Zs=new Qg(Mn,Vt,kn,On,ps,an,cn,Lr,ln,yn))}if(Us){const yn=fs.layout.get("icon-rotate").evaluate(Di,{}),Ur=fs.layout.get("icon-text-fit")!=="none",qc=gA(Us,yn,fr,Ur),Eo=an?gA(an,yn,fr,Ur):void 0;no=new Qg(Mn,Vt,kn,On,ps,Us,cn,Lr,!1,yn),Ua=4*qc.length;const Xc=Et.iconSizeData;let qo=null;Xc.kind==="source"?(qo=[$o*fs.layout.get("icon-size").evaluate(Di,{})],qo[0]>Tl&&dt(`${Et.layerIds[0]}: Value for "icon-size" is >= ${cp}. Reduce your "icon-size".`)):Xc.kind==="composite"&&(qo=[$o*$i.compositeIconSizes[0].evaluate(Di,{},cs),$o*$i.compositeIconSizes[1].evaluate(Di,{},cs)],(qo[0]>Tl||qo[1]>Tl)&&dt(`${Et.layerIds[0]}: Value for "icon-size" is >= ${cp}. Reduce your "icon-size".`)),Et.addSymbols(Et.icon,qc,qo,fi,Jn,Di,u.ai.none,Vt,Wo.lineStartIndex,Wo.lineLength,-1,cs),Fv=Et.icon.placedSymbolArray.length-1,Eo&&(fp=4*Eo.length,Et.addSymbols(Et.icon,Eo,qo,fi,Jn,Di,u.ai.vertical,Vt,Wo.lineStartIndex,Wo.lineLength,-1,cs),Nv=Et.icon.placedSymbolArray.length-1)}const CA=Object.keys(Si.horizontal);for(const yn of CA){const Ur=Si.horizontal[yn];if(!Ho){IA=_h(Ur.text);const Eo=fs.layout.get("text-rotate").evaluate(Di,{},cs);Ho=new Qg(Mn,Vt,kn,On,ps,Ur,Vs,_n,ln,Eo)}const qc=Ur.positionedLines.length===1;if(EA+=vA(Et,Vt,Ur,so,fs,ln,Di,Dn,Wo,Si.vertical?u.ai.horizontal:u.ai.horizontalOnly,qc?CA:[yn],Va,Fv,$i,cs),qc)break}Si.vertical&&(AA+=vA(Et,Vt,Si.vertical,so,fs,ln,Di,Dn,Wo,u.ai.vertical,["vertical"],Va,Nv,$i,cs));const RN=Ho?Ho.boxStartIndex:Et.collisionBoxArray.length,MN=Ho?Ho.boxEndIndex:Et.collisionBoxArray.length,kN=zr?zr.boxStartIndex:Et.collisionBoxArray.length,ON=zr?zr.boxEndIndex:Et.collisionBoxArray.length,DN=no?no.boxStartIndex:Et.collisionBoxArray.length,FN=no?no.boxEndIndex:Et.collisionBoxArray.length,NN=Zs?Zs.boxStartIndex:Et.collisionBoxArray.length,BN=Zs?Zs.boxEndIndex:Et.collisionBoxArray.length;let So=-1;const t_=(yn,Ur)=>yn&&yn.circleDiameter?Math.max(yn.circleDiameter,Ur):Ur;So=t_(Ho,So),So=t_(zr,So),So=t_(no,So),So=t_(Zs,So);const PA=So>-1?1:0;PA&&(So*=Ph/Ms),Et.glyphOffsetArray.length>=Ah.MAX_GLYPHS&&dt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Di.sortKey!==void 0&&Et.addToSortKeyRanges(Et.symbolInstances.length,Di.sortKey);const LN=bA(fs,Di,cs),[zN,UN]=function(yn,Ur){const qc=yn.length,Eo=Ur==null?void 0:Ur.values;if((Eo==null?void 0:Eo.length)>0)for(let Xc=0;Xc=0?Va.right:-1,Va.center>=0?Va.center:-1,Va.left>=0?Va.left:-1,Va.vertical||-1,Fv,Nv,IA,RN,MN,kN,ON,DN,FN,NN,BN,kn,EA,AA,Ua,fp,PA,0,Vs,So,zN,UN)}(l,Pt,Ve,h,f,g,wt,l.layers[0],l.collisionBoxArray,r.index,r.sourceLayerIndex,l.index,ae,[Ee,Ee,Ee,Ee],mt,A,Re,Le,Dt,$,r,v,R,O,x)};if(ht==="line")for(const Ve of uA(r.geometry,0,0,Ts,Ts)){const Pt=TN(Ve,be,Je,h.vertical||q,f,24,de,l.overscaling,Ts);for(const Et of Pt)q&&CN(l,q.text,ct,Et)||bt(Ve,Et)}else if(ht==="line-center"){for(const Ve of r.geometry)if(Ve.length>1){const Pt=wN(Ve,Je,h.vertical||q,f,24,de);Pt&&bt(Ve,Pt)}}else if(r.type==="Polygon")for(const Ve of Zu(r.geometry,0)){const Pt=EN(Ve,16);bt(Ve[0],new El(Pt.x,Pt.y,0))}else if(r.type==="LineString")for(const Ve of r.geometry)bt(Ve,new El(Ve[0].x,Ve[0].y,0));else if(r.type==="Point")for(const Ve of r.geometry)for(const Pt of Ve)bt([Pt],new El(Pt.x,Pt.y,0))}function vA(l,r,h,f,g,v,x,T,A,R,O,F,z,$,q){const K=function(Re,be,Ee,Le,Je,mt,Dt,ht){const ct=Le.layout.get("text-rotate").evaluate(mt,{})*Math.PI/180,At=[];for(const wt of be.positionedLines)for(const bt of wt.positionedGlyphs){if(!bt.rect)continue;const Ve=bt.rect||{};let Pt=NE+1,Et=!0,Vt=1,Ci=0;const Si=(Je||ht)&&bt.vertical,Us=bt.metrics.advance*bt.scale/2;if(ht&&be.verticalizable&&(Ci=wt.lineOffset/2-(bt.imageName?-(Ms-bt.metrics.width*bt.scale)/2:(bt.scale-1)*Ms)),bt.imageName){const fi=Dt[bt.imageName];Et=fi.sdf,Vt=fi.pixelRatio,Pt=Yn/Vt}const so=Je?[bt.x+Us,bt.y]:[0,0];let an=Je?[0,0]:[bt.x+Us+Ee[0],bt.y+Ee[1]-Ci],fs=[0,0];Si&&(fs=an,an=[0,0]);const Mn=bt.metrics.isDoubleResolution?2:1,kn=(bt.metrics.left-Pt)*bt.scale-Us+an[0],On=(-bt.metrics.top-Pt)*bt.scale+an[1],ps=kn+Ve.w/Mn*bt.scale/Vt,Vs=On+Ve.h/Mn*bt.scale/Vt,_n=new C(kn,On),ln=new C(ps,On),Dn=new C(kn,Vs),cn=new C(ps,Vs);if(Si){const fi=new C(-Us,Us-ap),Di=-Math.PI/2,$i=Ms/2-Us,fr=new C(5-ap-$i,-(bt.imageName?$i:0)),cs=new C(...fs);_n._rotateAround(Di,fi)._add(fr)._add(cs),ln._rotateAround(Di,fi)._add(fr)._add(cs),Dn._rotateAround(Di,fi)._add(fr)._add(cs),cn._rotateAround(Di,fi)._add(fr)._add(cs)}if(ct){const fi=Math.sin(ct),Di=Math.cos(ct),$i=[Di,-fi,fi,Di];_n._matMult($i),ln._matMult($i),Dn._matMult($i),cn._matMult($i)}const Lr=new C(0,0),Jn=new C(0,0);At.push({tl:_n,tr:ln,bl:Dn,br:cn,tex:Ve,writingMode:be.writingMode,glyphOffset:so,sectionIndex:bt.sectionIndex,isSDF:Et,pixelOffsetTL:Lr,pixelOffsetBR:Jn,minFontScaleX:0,minFontScaleY:0})}return At}(0,h,T,g,v,x,f,l.allowVerticalPlacement),ae=l.textSizeData;let de=null;ae.kind==="source"?(de=[$o*g.layout.get("text-size").evaluate(x,{})],de[0]>Tl&&dt(`${l.layerIds[0]}: Value for "text-size" is >= ${cp}. Reduce your "text-size".`)):ae.kind==="composite"&&(de=[$o*$.compositeTextSizes[0].evaluate(x,{},q),$o*$.compositeTextSizes[1].evaluate(x,{},q)],(de[0]>Tl||de[1]>Tl)&&dt(`${l.layerIds[0]}: Value for "text-size" is >= ${cp}. Reduce your "text-size".`)),l.addSymbols(l.text,K,de,T,v,x,R,r,A.lineStartIndex,A.lineLength,z,q);for(const Re of O)F[Re]=l.text.placedSymbolArray.length-1;return 4*K.length}function xA(l){for(const r in l)return l[r];return null}function CN(l,r,h,f){const g=l.compareText;if(r in g){const v=g[r];for(let x=v.length-1;x>=0;x--)if(f.dist(v[x])>4;if(g!==1)throw new Error(`Got v${g} data when expected v1.`);const v=wA[15&f];if(!v)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(r,2,1),[T]=new Uint32Array(r,4,1);return new Cv(T,x,v,r)}constructor(r,h=64,f=Float64Array,g){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+h,2),65535),this.ArrayType=f,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const v=wA.indexOf(this.ArrayType),x=2*r*this.ArrayType.BYTES_PER_ELEMENT,T=r*this.IndexArrayType.BYTES_PER_ELEMENT,A=(8-T%8)%8;if(v<0)throw new Error(`Unexpected typed array class: ${f}.`);g&&g instanceof ArrayBuffer?(this.data=g,this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+T+A,2*r),this._pos=2*r,this._finished=!0):(this.data=new ArrayBuffer(8+x+T+A),this.ids=new this.IndexArrayType(this.data,8,r),this.coords=new this.ArrayType(this.data,8+T+A,2*r),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+v]),new Uint16Array(this.data,2,1)[0]=h,new Uint32Array(this.data,4,1)[0]=r)}add(r,h){const f=this._pos>>1;return this.ids[f]=f,this.coords[this._pos++]=r,this.coords[this._pos++]=h,f}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return Pv(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,h,f,g){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:v,coords:x,nodeSize:T}=this,A=[0,v.length-1,0],R=[];for(;A.length;){const O=A.pop()||0,F=A.pop()||0,z=A.pop()||0;if(F-z<=T){for(let ae=z;ae<=F;ae++){const de=x[2*ae],Re=x[2*ae+1];de>=r&&de<=f&&Re>=h&&Re<=g&&R.push(v[ae])}continue}const $=z+F>>1,q=x[2*$],K=x[2*$+1];q>=r&&q<=f&&K>=h&&K<=g&&R.push(v[$]),(O===0?r<=q:h<=K)&&(A.push(z),A.push($-1),A.push(1-O)),(O===0?f>=q:g>=K)&&(A.push($+1),A.push(F),A.push(1-O))}return R}within(r,h,f){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:v,nodeSize:x}=this,T=[0,g.length-1,0],A=[],R=f*f;for(;T.length;){const O=T.pop()||0,F=T.pop()||0,z=T.pop()||0;if(F-z<=x){for(let ae=z;ae<=F;ae++)SA(v[2*ae],v[2*ae+1],r,h)<=R&&A.push(g[ae]);continue}const $=z+F>>1,q=v[2*$],K=v[2*$+1];SA(q,K,r,h)<=R&&A.push(g[$]),(O===0?r-f<=q:h-f<=K)&&(T.push(z),T.push($-1),T.push(1-O)),(O===0?r+f>=q:h+f>=K)&&(T.push($+1),T.push(F),T.push(1-O))}return A}}function Pv(l,r,h,f,g,v){if(g-f<=h)return;const x=f+g>>1;TA(l,r,x,f,g,v),Pv(l,r,h,f,x-1,1-v),Pv(l,r,h,x+1,g,1-v)}function TA(l,r,h,f,g,v){for(;g>f;){if(g-f>600){const R=g-f+1,O=h-f+1,F=Math.log(R),z=.5*Math.exp(2*F/3),$=.5*Math.sqrt(F*z*(R-z)/R)*(O-R/2<0?-1:1);TA(l,r,h,Math.max(f,Math.floor(h-O*z/R+$)),Math.min(g,Math.floor(h+(R-O)*z/R+$)),v)}const x=r[2*h+v];let T=f,A=g;for(hp(l,r,f,h),r[2*g+v]>x&&hp(l,r,f,g);Tx;)A--}r[2*f+v]===x?hp(l,r,f,A):(A++,hp(l,r,A,g)),A<=h&&(f=A+1),h<=A&&(g=A-1)}}function hp(l,r,h,f){Rv(l,h,f),Rv(r,2*h,2*f),Rv(r,2*h+1,2*f+1)}function Rv(l,r,h){const f=l[r];l[r]=l[h],l[h]=f}function SA(l,r,h,f){const g=l-h,v=r-f;return g*g+v*v}var Mv;u.bf=void 0,(Mv=u.bf||(u.bf={})).create="create",Mv.load="load",Mv.fullLoad="fullLoad";let e_=null,dp=[];const kv=1e3/60,Ov="loadTime",Dv="fullLoadTime",PN={mark(l){performance.mark(l)},frame(l){const r=l;e_!=null&&dp.push(r-e_),e_=r},clearMetrics(){e_=null,dp=[],performance.clearMeasures(Ov),performance.clearMeasures(Dv);for(const l in u.bf)performance.clearMarks(u.bf[l])},getPerformanceMetrics(){performance.measure(Ov,u.bf.create,u.bf.load),performance.measure(Dv,u.bf.create,u.bf.fullLoad);const l=performance.getEntriesByName(Ov)[0].duration,r=performance.getEntriesByName(Dv)[0].duration,h=dp.length,f=1/(dp.reduce((v,x)=>v+x,0)/h/1e3),g=dp.filter(v=>v>kv).reduce((v,x)=>v+(x-kv)/kv,0);return{loadTime:l,fullLoadTime:r,fps:f,percentDroppedFrames:g/(h+g)*100,totalFrames:h}}};u.$=class extends Z{},u.A=vh,u.B=zf,u.C=function(l){if(jt==null){const r=l.navigator?l.navigator.userAgent:null;jt=!!l.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return jt},u.D=Ct,u.E=Ue,u.F=class{constructor(l,r){this.target=l,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new vN(()=>this.process()),this.subscription=function(h,f,g,v){return h.addEventListener(f,g,!1),{unsubscribe:()=>{h.removeEventListener(f,g,!1)}}}(this.target,"message",h=>this.receive(h)),this.globalScope=Ft(self)?l:window}registerMessageHandler(l,r){this.messageHandlers[l]=r}sendAsync(l,r){return new Promise((h,f)=>{const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[g]={resolve:h,reject:f},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[g];const T={id:g,type:"",origin:location.origin,targetMapId:l.targetMapId,sourceMapId:this.mapId};this.target.postMessage(T)},{once:!0});const v=[],x=Object.assign(Object.assign({},l),{id:g,sourceMapId:this.mapId,origin:location.origin,data:zc(l.data,v)});this.target.postMessage(x,{transfer:v})})}receive(l){const r=l.data,h=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!=="resource://android"&&location.origin!=="resource://android"&&r.origin!==location.origin||r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[h];const f=this.abortControllers[h];return delete this.abortControllers[h],void(f&&f.abort())}if(Ft(self)||r.mustQueue)return this.tasks[h]=r,this.taskQueue.push(h),void this.invoker.trigger();this.processTask(h,r)}}process(){if(this.taskQueue.length===0)return;const l=this.taskQueue.shift(),r=this.tasks[l];delete this.tasks[l],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(l,r)}processTask(l,r){return c(this,void 0,void 0,function*(){if(r.type===""){const g=this.resolveRejects[l];return delete this.resolveRejects[l],g?void(r.error?g.reject(to(r.error)):g.resolve(to(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(l,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const h=to(r.data),f=new AbortController;this.abortControllers[l]=f;try{const g=yield this.messageHandlers[r.type](r.sourceMapId,h,f);this.completeTask(l,null,g)}catch(g){this.completeTask(l,g)}})}completeTask(l,r,h){const f=[];delete this.abortControllers[l];const g={id:l,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?zc(r):null,data:zc(h,f)};this.target.postMessage(g,{transfer:f})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},u.G=In,u.H=function(){var l=new vh(16);return vh!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},u.I=mv,u.J=function(l,r,h){var f,g,v,x,T,A,R,O,F,z,$,q,K=h[0],ae=h[1],de=h[2];return r===l?(l[12]=r[0]*K+r[4]*ae+r[8]*de+r[12],l[13]=r[1]*K+r[5]*ae+r[9]*de+r[13],l[14]=r[2]*K+r[6]*ae+r[10]*de+r[14],l[15]=r[3]*K+r[7]*ae+r[11]*de+r[15]):(g=r[1],v=r[2],x=r[3],T=r[4],A=r[5],R=r[6],O=r[7],F=r[8],z=r[9],$=r[10],q=r[11],l[0]=f=r[0],l[1]=g,l[2]=v,l[3]=x,l[4]=T,l[5]=A,l[6]=R,l[7]=O,l[8]=F,l[9]=z,l[10]=$,l[11]=q,l[12]=f*K+T*ae+F*de+r[12],l[13]=g*K+A*ae+z*de+r[13],l[14]=v*K+R*ae+$*de+r[14],l[15]=x*K+O*ae+q*de+r[15]),l},u.K=function(l,r,h){var f=h[0],g=h[1],v=h[2];return l[0]=r[0]*f,l[1]=r[1]*f,l[2]=r[2]*f,l[3]=r[3]*f,l[4]=r[4]*g,l[5]=r[5]*g,l[6]=r[6]*g,l[7]=r[7]*g,l[8]=r[8]*v,l[9]=r[9]*v,l[10]=r[10]*v,l[11]=r[11]*v,l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15],l},u.L=nE,u.M=function(l,r){const h={};for(let f=0;f{const r=window.document.createElement("video");return r.muted=!0,new Promise(h=>{r.onloadstart=()=>{h(r)};for(const f of l){const g=window.document.createElement("source");Ii(f)||(r.crossOrigin="Anonymous"),g.src=f,r.appendChild(g)}})},u.a4=function(){return Fe++},u.a5=Qt,u.a6=Ah,u.a7=mn,u.a8=Wc,u.a9=Oi,u.aA=function(l){l=l.slice();const r=Object.create(null);for(let h=0;h{"source"in x&&f[x.source]?h.push({command:"removeLayer",args:[x.id]}):v.push(x)}),h=h.concat(g),function(x,T,A){T=T||[];const R=(x=x||[]).map($t),O=T.map($t),F=x.reduce(Kt,{}),z=T.reduce(Kt,{}),$=R.slice(),q=Object.create(null);let K,ae,de,Re,be;for(let Ee=0,Le=0;Ee@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(h,f,g,v)=>{const x=g||v;return r[f]=!x||x.toLowerCase(),""}),r["max-age"]){const h=parseInt(r["max-age"],10);isNaN(h)?delete r["max-age"]:r["max-age"]=h}return r},u.ac=function(l,r){const h=[];for(const f in l)f in r||h.push(f);return h},u.ad=Se,u.ae=function(l,r,h){var f=Math.sin(h),g=Math.cos(h),v=r[0],x=r[1],T=r[2],A=r[3],R=r[4],O=r[5],F=r[6],z=r[7];return r!==l&&(l[8]=r[8],l[9]=r[9],l[10]=r[10],l[11]=r[11],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15]),l[0]=v*g+R*f,l[1]=x*g+O*f,l[2]=T*g+F*f,l[3]=A*g+z*f,l[4]=R*g-v*f,l[5]=O*g-x*f,l[6]=F*g-T*f,l[7]=z*g-A*f,l},u.af=function(l){var r=new vh(16);return r[0]=l[0],r[1]=l[1],r[2]=l[2],r[3]=l[3],r[4]=l[4],r[5]=l[5],r[6]=l[6],r[7]=l[7],r[8]=l[8],r[9]=l[9],r[10]=l[10],r[11]=l[11],r[12]=l[12],r[13]=l[13],r[14]=l[14],r[15]=l[15],r},u.ag=zg,u.ah=function(l,r){let h=0,f=0;if(l.kind==="constant")f=l.layoutSize;else if(l.kind!=="source"){const{interpolationType:g,minZoom:v,maxZoom:x}=l,T=g?Se(Zn.interpolationFactor(g,r,v,x),0,1):0;l.kind==="camera"?f=Xn.number(l.minSize,l.maxSize,T):h=T}return{uSizeT:h,uSize:f}},u.aj=function(l,{uSize:r,uSizeT:h},{lowerSize:f,upperSize:g}){return l.kind==="source"?f/$o:l.kind==="composite"?Xn.number(f/$o,g/$o,h):r},u.ak=bv,u.al=function(l,r,h,f){const g=r.y-l.y,v=r.x-l.x,x=f.y-h.y,T=f.x-h.x,A=x*v-T*g;if(A===0)return null;const R=(T*(l.y-h.y)-x*(l.x-h.x))/A;return new C(l.x+R*v,l.y+R*g)},u.am=uA,u.an=GS,u.ao=tv,u.ap=function(l){let r=1/0,h=1/0,f=-1/0,g=-1/0;for(const v of l)r=Math.min(r,v.x),h=Math.min(h,v.y),f=Math.max(f,v.x),g=Math.max(g,v.y);return[r,h,f,g]},u.aq=Ms,u.as=yv,u.at=function(l,r){var h=r[0],f=r[1],g=r[2],v=r[3],x=r[4],T=r[5],A=r[6],R=r[7],O=r[8],F=r[9],z=r[10],$=r[11],q=r[12],K=r[13],ae=r[14],de=r[15],Re=h*T-f*x,be=h*A-g*x,Ee=h*R-v*x,Le=f*A-g*T,Je=f*R-v*T,mt=g*R-v*A,Dt=O*K-F*q,ht=O*ae-z*q,ct=O*de-$*q,At=F*ae-z*K,wt=F*de-$*K,bt=z*de-$*ae,Ve=Re*bt-be*wt+Ee*At+Le*ct-Je*ht+mt*Dt;return Ve?(l[0]=(T*bt-A*wt+R*At)*(Ve=1/Ve),l[1]=(g*wt-f*bt-v*At)*Ve,l[2]=(K*mt-ae*Je+de*Le)*Ve,l[3]=(z*Je-F*mt-$*Le)*Ve,l[4]=(A*ct-x*bt-R*ht)*Ve,l[5]=(h*bt-g*ct+v*ht)*Ve,l[6]=(ae*Ee-q*mt-de*be)*Ve,l[7]=(O*mt-z*Ee+$*be)*Ve,l[8]=(x*wt-T*ct+R*Dt)*Ve,l[9]=(f*ct-h*wt-v*Dt)*Ve,l[10]=(q*Je-K*Ee+de*Re)*Ve,l[11]=(F*Ee-O*Je-$*Re)*Ve,l[12]=(T*ht-x*At-A*Dt)*Ve,l[13]=(h*At-f*ht+g*Dt)*Ve,l[14]=(K*be-q*Le-ae*Re)*Ve,l[15]=(O*Le-F*be+z*Re)*Ve,l):null},u.au=Iv,u.av=_v,u.aw=Cv,u.ax=function(){const l={},r=he.$version;for(const h in he.$root){const f=he.$root[h];if(f.required){let g=null;g=h==="version"?r:f.type==="array"?[]:{},g!=null&&(l[h]=g)}}return l},u.ay=Ig,u.az=as,u.b=kt,u.b0=function(l,r){return l[0]=r[0],l[1]=r[1],l[2]=r[2],l[3]=r[3],l[4]=r[4],l[5]=r[5],l[6]=r[6],l[7]=r[7],l[8]=r[8],l[9]=r[9],l[10]=r[10],l[11]=r[11],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15],l},u.b1=function(l,r,h){return l[0]=r[0]*h[0],l[1]=r[1]*h[1],l[2]=r[2]*h[2],l[3]=r[3]*h[3],l},u.b2=function(l,r){return l[0]*r[0]+l[1]*r[1]+l[2]*r[2]+l[3]*r[3]},u.b3=ge,u.b4=sA,u.b5=tA,u.b6=function(l,r,h,f,g){var v,x=1/Math.tan(r/2);return l[0]=x/h,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=x,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=-1,l[12]=0,l[13]=0,l[15]=0,g!=null&&g!==1/0?(l[10]=(g+f)*(v=1/(f-g)),l[14]=2*g*f*v):(l[10]=-1,l[14]=-2*f),l},u.b7=function(l,r,h){var f=Math.sin(h),g=Math.cos(h),v=r[4],x=r[5],T=r[6],A=r[7],R=r[8],O=r[9],F=r[10],z=r[11];return r!==l&&(l[0]=r[0],l[1]=r[1],l[2]=r[2],l[3]=r[3],l[12]=r[12],l[13]=r[13],l[14]=r[14],l[15]=r[15]),l[4]=v*g+R*f,l[5]=x*g+O*f,l[6]=T*g+F*f,l[7]=A*g+z*f,l[8]=R*g-v*f,l[9]=O*g-x*f,l[10]=F*g-T*f,l[11]=z*g-A*f,l},u.b8=se,u.b9=ve,u.bA=function(l){return l.message===mi},u.bB=Oa,u.bC=Uo,u.ba=function(l){return l*Math.PI/180},u.bb=function(l,r){return l[0]=r[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=r[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=r[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},u.bc=class extends W{},u.bd=Tv,u.be=PN,u.bg=hi,u.bh=function(l,r){En.REGISTERED_PROTOCOLS[l]=r},u.bi=function(l){delete En.REGISTERED_PROTOCOLS[l]},u.bj=function(l,r){const h={};for(let g=0;gbt*Ms)}let ht=x?"center":h.get("text-justify").evaluate(R,{},l.canonical);const ct=h.get("symbol-placement")==="point"?h.get("text-max-width").evaluate(R,{},l.canonical)*Ms:1/0,At=()=>{l.bucket.allowVerticalPlacement&&jf(Ee)&&(q.vertical=Hg(K,l.glyphMap,l.glyphPositions,l.imagePositions,O,ct,v,mt,"left",Je,de,u.ai.vertical,!0,z,F))};if(!x&&Dt){const wt=new Set;if(ht==="auto")for(let Ve=0;Vec(void 0,void 0,void 0,function*(){if(l.byteLength===0)return createImageBitmap(new ImageData(1,1));const r=new Blob([new Uint8Array(l)],{type:"image/png"});try{return createImageBitmap(r)}catch(h){throw new Error(`Could not load image because of ${h.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),u.e=De,u.f=l=>new Promise((r,h)=>{const f=new Image;f.onload=()=>{r(f),URL.revokeObjectURL(f.src),f.onload=null,window.requestAnimationFrame(()=>{f.src=Yt})},f.onerror=()=>h(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."));const g=new Blob([new Uint8Array(l)],{type:"image/png"});f.src=l.byteLength?URL.createObjectURL(g):Yt}),u.g=An,u.h=(l,r)=>gi(De(l,{type:"json"}),r),u.i=Ft,u.j=xe,u.k=pe,u.l=(l,r)=>gi(De(l,{type:"arrayBuffer"}),r),u.m=gi,u.n=function(l){return new fv(l).readFields(nN,[])},u.o=ep,u.p=BE,u.q=p,u.r=Hb,u.s=Ii,u.t=Uf,u.u=ft,u.v=he,u.w=dt,u.x=wo,u.y=function([l,r,h]){return r+=90,r*=Math.PI/180,h*=Math.PI/180,{x:l*Math.cos(r)*Math.sin(h),y:l*Math.sin(r)*Math.sin(h),z:l*Math.cos(h)}},u.z=Xn}),n("worker",["./shared"],function(u){class c{constructor(V){this.keyCache={},V&&this.replace(V)}replace(V){this._layerConfigs={},this._layers={},this.update(V,[])}update(V,U){for(const re of V){this._layerConfigs[re.id]=re;const ye=this._layers[re.id]=u.aB(re);ye._featureFilter=u.a7(ye.filter),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(const re of U)delete this.keyCache[re],delete this._layerConfigs[re],delete this._layers[re];this.familiesBySource={};const Y=u.bj(Object.values(this._layerConfigs),this.keyCache);for(const re of Y){const ye=re.map(Oe=>this._layers[Oe.id]),Te=ye[0];if(Te.visibility==="none")continue;const Ce=Te.source||"";let fe=this.familiesBySource[Ce];fe||(fe=this.familiesBySource[Ce]={});const ze=Te.sourceLayer||"_geojsonTileLayer";let We=fe[ze];We||(We=fe[ze]=[]),We.push(ye)}}}class _{constructor(V){const U={},Y=[];for(const Ce in V){const fe=V[Ce],ze=U[Ce]={};for(const We in fe){const Oe=fe[+We];if(!Oe||Oe.bitmap.width===0||Oe.bitmap.height===0)continue;const nt={x:0,y:0,w:Oe.bitmap.width+2,h:Oe.bitmap.height+2};Y.push(nt),ze[We]={rect:nt,metrics:Oe.metrics}}}const{w:re,h:ye}=u.p(Y),Te=new u.o({width:re||1,height:ye||1});for(const Ce in V){const fe=V[Ce];for(const ze in fe){const We=fe[+ze];if(!We||We.bitmap.width===0||We.bitmap.height===0)continue;const Oe=U[Ce][ze].rect;u.o.copy(We.bitmap,Te,{x:0,y:0},{x:Oe.x+1,y:Oe.y+1},We.bitmap)}}this.image=Te,this.positions=U}}u.bk("GlyphAtlas",_);class w{constructor(V){this.tileID=new u.S(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId,this.inFlightDependencies=[]}parse(V,U,Y,re){return u._(this,void 0,void 0,function*(){this.status="parsing",this.data=V,this.collisionBoxArray=new u.a5;const ye=new u.bl(Object.keys(V.layers).sort()),Te=new u.bm(this.tileID,this.promoteId);Te.bucketLayerIDs=[];const Ce={},fe={featureIndex:Te,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Y},ze=U.familiesBySource[this.source];for(const Zt in ze){const li=V.layers[Zt];if(!li)continue;li.version===1&&u.w(`Vector tile source "${this.source}" layer "${Zt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const _i=ye.encode(Zt),ts=[];for(let vs=0;vs=Ls.maxzoom||Ls.visibility!=="none"&&(S(vs,this.zoom,Y),(Ce[Ls.id]=Ls.createBucket({index:Te.bucketLayerIDs.length,layers:vs,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_i,sourceID:this.source})).populate(ts,fe,this.tileID.canonical),Te.bucketLayerIDs.push(vs.map(xa=>xa.id)))}}const We=u.aG(fe.glyphDependencies,Zt=>Object.keys(Zt).map(Number));this.inFlightDependencies.forEach(Zt=>Zt==null?void 0:Zt.abort()),this.inFlightDependencies=[];let Oe=Promise.resolve({});if(Object.keys(We).length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),Oe=re.sendAsync({type:"GG",data:{stacks:We,source:this.source,tileID:this.tileID,type:"glyphs"}},Zt)}const nt=Object.keys(fe.iconDependencies);let It=Promise.resolve({});if(nt.length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),It=re.sendAsync({type:"GI",data:{icons:nt,source:this.source,tileID:this.tileID,type:"icons"}},Zt)}const Mt=Object.keys(fe.patternDependencies);let Xt=Promise.resolve({});if(Mt.length){const Zt=new AbortController;this.inFlightDependencies.push(Zt),Xt=re.sendAsync({type:"GI",data:{icons:Mt,source:this.source,tileID:this.tileID,type:"patterns"}},Zt)}const[oi,Ht,xi]=yield Promise.all([Oe,It,Xt]),Ni=new _(oi),es=new u.bn(Ht,xi);for(const Zt in Ce){const li=Ce[Zt];li instanceof u.a6?(S(li.layers,this.zoom,Y),u.bo({bucket:li,glyphMap:oi,glyphPositions:Ni.positions,imageMap:Ht,imagePositions:es.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):li.hasPattern&&(li instanceof u.bp||li instanceof u.bq||li instanceof u.br)&&(S(li.layers,this.zoom,Y),li.addFeatures(fe,this.tileID.canonical,es.patternPositions))}return this.status="done",{buckets:Object.values(Ce).filter(Zt=>!Zt.isEmpty()),featureIndex:Te,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ni.image,imageAtlas:es,glyphMap:this.returnDependencies?oi:null,iconMap:this.returnDependencies?Ht:null,glyphPositions:this.returnDependencies?Ni.positions:null}})}}function S(ce,V,U){const Y=new u.a9(V);for(const re of ce)re.recalculate(Y,U)}class C{constructor(V,U,Y){this.actor=V,this.layerIndex=U,this.availableImages=Y,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(V,U){return u._(this,void 0,void 0,function*(){const Y=yield u.l(V.request,U);try{return{vectorTile:new u.bs.VectorTile(new u.bt(Y.data)),rawData:Y.data,cacheControl:Y.cacheControl,expires:Y.expires}}catch(re){const ye=new Uint8Array(Y.data);let Te=`Unable to parse the tile at ${V.request.url}, `;throw Te+=ye[0]===31&&ye[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${re.message}`,new Error(Te)}})}loadTile(V){return u._(this,void 0,void 0,function*(){const U=V.uid,Y=!!(V&&V.request&&V.request.collectResourceTiming)&&new u.bu(V.request),re=new w(V);this.loading[U]=re;const ye=new AbortController;re.abort=ye;try{const Te=yield this.loadVectorTile(V,ye);if(delete this.loading[U],!Te)return null;const Ce=Te.rawData,fe={};Te.expires&&(fe.expires=Te.expires),Te.cacheControl&&(fe.cacheControl=Te.cacheControl);const ze={};if(Y){const Oe=Y.finish();Oe&&(ze.resourceTiming=JSON.parse(JSON.stringify(Oe)))}re.vectorTile=Te.vectorTile;const We=re.parse(Te.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[U]=re,this.fetching[U]={rawTileData:Ce,cacheControl:fe,resourceTiming:ze};try{const Oe=yield We;return u.e({rawTileData:Ce.slice(0)},Oe,fe,ze)}finally{delete this.fetching[U]}}catch(Te){throw delete this.loading[U],re.status="done",this.loaded[U]=re,Te}})}reloadTile(V){return u._(this,void 0,void 0,function*(){const U=V.uid;if(!this.loaded||!this.loaded[U])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Y=this.loaded[U];if(Y.showCollisionBoxes=V.showCollisionBoxes,Y.status==="parsing"){const re=yield Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor);let ye;if(this.fetching[U]){const{rawTileData:Te,cacheControl:Ce,resourceTiming:fe}=this.fetching[U];delete this.fetching[U],ye=u.e({rawTileData:Te.slice(0)},re,Ce,fe)}else ye=re;return ye}if(Y.status==="done"&&Y.vectorTile)return Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(V){return u._(this,void 0,void 0,function*(){const U=this.loading,Y=V.uid;U&&U[Y]&&U[Y].abort&&(U[Y].abort.abort(),delete U[Y])})}removeTile(V){return u._(this,void 0,void 0,function*(){this.loaded&&this.loaded[V.uid]&&delete this.loaded[V.uid]})}}class P{constructor(){this.loaded={}}loadTile(V){return u._(this,void 0,void 0,function*(){const{uid:U,encoding:Y,rawImageData:re,redFactor:ye,greenFactor:Te,blueFactor:Ce,baseShift:fe}=V,ze=re.width+2,We=re.height+2,Oe=u.b(re)?new u.R({width:ze,height:We},yield u.bv(re,-1,-1,ze,We)):re,nt=new u.bw(U,Oe,Y,ye,Te,Ce,fe);return this.loaded=this.loaded||{},this.loaded[U]=nt,nt})}removeTile(V){const U=this.loaded,Y=V.uid;U&&U[Y]&&delete U[Y]}}function D(ce,V){if(ce.length!==0){j(ce[0],V);for(var U=1;U=Math.abs(Ce)?U-fe+Ce:Ce-fe+U,U=fe}U+Y>=0!=!!V&&ce.reverse()}var L=u.bx(function ce(V,U){var Y,re=V&&V.type;if(re==="FeatureCollection")for(Y=0;Y>31}function Ft(ce,V){for(var U=ce.loadGeometry(),Y=ce.type,re=0,ye=0,Te=U.length,Ce=0;Cece},bi=Math.fround||(Jt=new Float32Array(1),ce=>(Jt[0]=+ce,Jt[0]));var Jt;const pi=3,mi=5,Hs=6;class En{constructor(V){this.options=Object.assign(Object.create(Yt),V),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(V){const{log:U,minZoom:Y,maxZoom:re}=this.options;U&&console.time("total time");const ye=`prepare ${V.length} points`;U&&console.time(ye),this.points=V;const Te=[];for(let fe=0;fe=Y;fe--){const ze=+Date.now();Ce=this.trees[fe]=this._createTree(this._cluster(Ce,fe)),U&&console.log("z%d: %d clusters in %dms",fe,Ce.numItems,+Date.now()-ze)}return U&&console.timeEnd("total time"),this}getClusters(V,U){let Y=((V[0]+180)%360+360)%360-180;const re=Math.max(-90,Math.min(90,V[1]));let ye=V[2]===180?180:((V[2]+180)%360+360)%360-180;const Te=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)Y=-180,ye=180;else if(Y>ye){const Oe=this.getClusters([Y,re,180,Te],U),nt=this.getClusters([-180,re,ye,Te],U);return Oe.concat(nt)}const Ce=this.trees[this._limitZoom(U)],fe=Ce.range(hi(Y),as(Te),hi(ye),as(re)),ze=Ce.data,We=[];for(const Oe of fe){const nt=this.stride*Oe;We.push(ze[nt+mi]>1?An(ze,nt,this.clusterProps):this.points[ze[nt+pi]])}return We}getChildren(V){const U=this._getOriginId(V),Y=this._getOriginZoom(V),re="No cluster with the specified id.",ye=this.trees[Y];if(!ye)throw new Error(re);const Te=ye.data;if(U*this.stride>=Te.length)throw new Error(re);const Ce=this.options.radius/(this.options.extent*Math.pow(2,Y-1)),fe=ye.within(Te[U*this.stride],Te[U*this.stride+1],Ce),ze=[];for(const We of fe){const Oe=We*this.stride;Te[Oe+4]===V&&ze.push(Te[Oe+mi]>1?An(Te,Oe,this.clusterProps):this.points[Te[Oe+pi]])}if(ze.length===0)throw new Error(re);return ze}getLeaves(V,U,Y){const re=[];return this._appendLeaves(re,V,U=U||10,Y=Y||0,0),re}getTile(V,U,Y){const re=this.trees[this._limitZoom(V)],ye=Math.pow(2,V),{extent:Te,radius:Ce}=this.options,fe=Ce/Te,ze=(Y-fe)/ye,We=(Y+1+fe)/ye,Oe={features:[]};return this._addTileFeatures(re.range((U-fe)/ye,ze,(U+1+fe)/ye,We),re.data,U,Y,ye,Oe),U===0&&this._addTileFeatures(re.range(1-fe/ye,ze,1,We),re.data,ye,Y,ye,Oe),U===ye-1&&this._addTileFeatures(re.range(0,ze,fe/ye,We),re.data,-1,Y,ye,Oe),Oe.features.length?Oe:null}getClusterExpansionZoom(V){let U=this._getOriginZoom(V)-1;for(;U<=this.options.maxZoom;){const Y=this.getChildren(V);if(U++,Y.length!==1)break;V=Y[0].properties.cluster_id}return U}_appendLeaves(V,U,Y,re,ye){const Te=this.getChildren(U);for(const Ce of Te){const fe=Ce.properties;if(fe&&fe.cluster?ye+fe.point_count<=re?ye+=fe.point_count:ye=this._appendLeaves(V,fe.cluster_id,Y,re,ye):ye1;let We,Oe,nt;if(ze)We=In(U,fe,this.clusterProps),Oe=U[fe],nt=U[fe+1];else{const Xt=this.points[U[fe+pi]];We=Xt.properties;const[oi,Ht]=Xt.geometry.coordinates;Oe=hi(oi),nt=as(Ht)}const It={type:1,geometry:[[Math.round(this.options.extent*(Oe*ye-Y)),Math.round(this.options.extent*(nt*ye-re))]],tags:We};let Mt;Mt=ze||this.options.generateId?U[fe+pi]:this.points[U[fe+pi]].id,Mt!==void 0&&(It.id=Mt),Te.features.push(It)}}_limitZoom(V){return Math.max(this.options.minZoom,Math.min(Math.floor(+V),this.options.maxZoom+1))}_cluster(V,U){const{radius:Y,extent:re,reduce:ye,minPoints:Te}=this.options,Ce=Y/(re*Math.pow(2,U)),fe=V.data,ze=[],We=this.stride;for(let Oe=0;OeU&&(oi+=fe[xi+mi])}if(oi>Xt&&oi>=Te){let Ht,xi=nt*Xt,Ni=It*Xt,es=-1;const Zt=((Oe/We|0)<<5)+(U+1)+this.points.length;for(const li of Mt){const _i=li*We;if(fe[_i+2]<=U)continue;fe[_i+2]=U;const ts=fe[_i+mi];xi+=fe[_i]*ts,Ni+=fe[_i+1]*ts,fe[_i+4]=Zt,ye&&(Ht||(Ht=this._map(fe,Oe,!0),es=this.clusterProps.length,this.clusterProps.push(Ht)),ye(Ht,this._map(fe,_i)))}fe[Oe+4]=Zt,ze.push(xi/oi,Ni/oi,1/0,Zt,-1,oi),ye&&ze.push(es)}else{for(let Ht=0;Ht1)for(const Ht of Mt){const xi=Ht*We;if(!(fe[xi+2]<=U)){fe[xi+2]=U;for(let Ni=0;Ni>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,U,Y){if(V[U+mi]>1){const Te=this.clusterProps[V[U+Hs]];return Y?Object.assign({},Te):Te}const re=this.points[V[U+pi]].properties,ye=this.options.map(re);return Y&&ye===re?Object.assign({},ye):ye}}function An(ce,V,U){return{type:"Feature",id:ce[V+pi],properties:In(ce,V,U),geometry:{type:"Point",coordinates:[(Y=ce[V],360*(Y-.5)),gi(ce[V+1])]}};var Y}function In(ce,V,U){const Y=ce[V+mi],re=Y>=1e4?`${Math.round(Y/1e3)}k`:Y>=1e3?Math.round(Y/100)/10+"k":Y,ye=ce[V+Hs],Te=ye===-1?{}:Object.assign({},U[ye]);return Object.assign(Te,{cluster:!0,cluster_id:ce[V+pi],point_count:Y,point_count_abbreviated:re})}function hi(ce){return ce/360+.5}function as(ce){const V=Math.sin(ce*Math.PI/180),U=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return U<0?0:U>1?1:U}function gi(ce){const V=(180-360*ce)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function Ii(ce,V,U,Y){let re=Y;const ye=V+(U-V>>1);let Te,Ce=U-V;const fe=ce[V],ze=ce[V+1],We=ce[U],Oe=ce[U+1];for(let nt=V+3;ntre)Te=nt,re=It;else if(It===re){const Mt=Math.abs(nt-ye);MtY&&(Te-V>3&&Ii(ce,V,Te,Y),ce[Te+2]=re,U-Te>3&&Ii(ce,Te,U,Y))}function Wn(ce,V,U,Y,re,ye){let Te=re-U,Ce=ye-Y;if(Te!==0||Ce!==0){const fe=((ce-U)*Te+(V-Y)*Ce)/(Te*Te+Ce*Ce);fe>1?(U=re,Y=ye):fe>0&&(U+=Te*fe,Y+=Ce*fe)}return Te=ce-U,Ce=V-Y,Te*Te+Ce*Ce}function Bs(ce,V,U,Y){const re={id:ce??null,type:V,geometry:U,tags:Y,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(V==="Point"||V==="MultiPoint"||V==="LineString")pe(re,U);else if(V==="Polygon")pe(re,U[0]);else if(V==="MultiLineString")for(const ye of U)pe(re,ye);else if(V==="MultiPolygon")for(const ye of U)pe(re,ye[0]);return re}function pe(ce,V){for(let U=0;U0&&(Te+=Y?(re*We-ze*ye)/2:Math.sqrt(Math.pow(ze-re,2)+Math.pow(We-ye,2))),re=ze,ye=We}const Ce=V.length-3;V[2]=1,Ii(V,0,Ce,U),V[Ce+2]=1,V.size=Math.abs(Te),V.start=0,V.end=V.size}function qe(ce,V,U,Y){for(let re=0;re1?1:U}function Ke(ce,V,U,Y,re,ye,Te,Ce){if(Y/=V,ye>=(U/=V)&&Te=Y)return null;const fe=[];for(const ze of ce){const We=ze.geometry;let Oe=ze.type;const nt=re===0?ze.minX:ze.minY,It=re===0?ze.maxX:ze.maxY;if(nt>=U&&It=Y)continue;let Mt=[];if(Oe==="Point"||Oe==="MultiPoint")st(We,Mt,U,Y,re);else if(Oe==="LineString")Ye(We,Mt,U,Y,re,!1,Ce.lineMetrics);else if(Oe==="MultiLineString")Rt(We,Mt,U,Y,re,!1);else if(Oe==="Polygon")Rt(We,Mt,U,Y,re,!0);else if(Oe==="MultiPolygon")for(const Xt of We){const oi=[];Rt(Xt,oi,U,Y,re,!0),oi.length&&Mt.push(oi)}if(Mt.length){if(Ce.lineMetrics&&Oe==="LineString"){for(const Xt of Mt)fe.push(Bs(ze.id,Oe,Xt,ze.tags));continue}Oe!=="LineString"&&Oe!=="MultiLineString"||(Mt.length===1?(Oe="LineString",Mt=Mt[0]):Oe="MultiLineString"),Oe!=="Point"&&Oe!=="MultiPoint"||(Oe=Mt.length===3?"Point":"MultiPoint"),fe.push(Bs(ze.id,Oe,Mt,ze.tags))}}return fe.length?fe:null}function st(ce,V,U,Y,re){for(let ye=0;ye=U&&Te<=Y&&St(V,ce[ye],ce[ye+1],ce[ye+2])}}function Ye(ce,V,U,Y,re,ye,Te){let Ce=_t(ce);const fe=re===0?$t:Kt;let ze,We,Oe=ce.start;for(let oi=0;oiU&&(We=fe(Ce,Ht,xi,es,Zt,U),Te&&(Ce.start=Oe+ze*We)):li>Y?_i=U&&(We=fe(Ce,Ht,xi,es,Zt,U),ts=!0),_i>Y&&li<=Y&&(We=fe(Ce,Ht,xi,es,Zt,Y),ts=!0),!ye&&ts&&(Te&&(Ce.end=Oe+ze*We),V.push(Ce),Ce=_t(ce)),Te&&(Oe+=ze)}let nt=ce.length-3;const It=ce[nt],Mt=ce[nt+1],Xt=re===0?It:Mt;Xt>=U&&Xt<=Y&&St(Ce,It,Mt,ce[nt+2]),nt=Ce.length-3,ye&&nt>=3&&(Ce[nt]!==Ce[0]||Ce[nt+1]!==Ce[1])&&St(Ce,Ce[0],Ce[1],Ce[2]),Ce.length&&V.push(Ce)}function _t(ce){const V=[];return V.size=ce.size,V.start=ce.start,V.end=ce.end,V}function Rt(ce,V,U,Y,re,ye){for(const Te of ce)Ye(Te,V,U,Y,re,ye,!1)}function St(ce,V,U,Y){ce.push(V,U,Y)}function $t(ce,V,U,Y,re,ye){const Te=(ye-V)/(Y-V);return St(ce,ye,U+(re-U)*Te,1),Te}function Kt(ce,V,U,Y,re,ye){const Te=(ye-U)/(re-U);return St(ce,V+(Y-V)*Te,ye,1),Te}function je(ce,V){const U=[];for(let Y=0;Y0&&V.size<(re?Te:Y))return void(U.numPoints+=V.length/3);const Ce=[];for(let fe=0;feTe)&&(U.numSimplified++,Ce.push(V[fe],V[fe+1])),U.numPoints++;re&&function(fe,ze){let We=0;for(let Oe=0,nt=fe.length,It=nt-2;Oe0===ze)for(let Oe=0,nt=fe.length;Oe24)throw new Error("maxZoom should be in the 0-24 range");if(U.promoteId&&U.generateId)throw new Error("promoteId and generateId cannot be used together.");let re=function(ye,Te){const Ce=[];if(ye.type==="FeatureCollection")for(let fe=0;fe1&&console.time("creation"),It=this.tiles[nt]=Cs(V,U,Y,re,ze),this.tileCoords.push({z:U,x:Y,y:re}),We)){We>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",U,Y,re,It.numFeatures,It.numPoints,It.numSimplified),console.timeEnd("creation"));const ts=`z${U}`;this.stats[ts]=(this.stats[ts]||0)+1,this.total++}if(It.source=V,ye==null){if(U===ze.indexMaxZoom||It.numPoints<=ze.indexMaxPoints)continue}else{if(U===ze.maxZoom||U===ye)continue;if(ye!=null){const ts=ye-U;if(Y!==Te>>ts||re!==Ce>>ts)continue}}if(It.source=null,V.length===0)continue;We>1&&console.time("clipping");const Mt=.5*ze.buffer/ze.extent,Xt=.5-Mt,oi=.5+Mt,Ht=1+Mt;let xi=null,Ni=null,es=null,Zt=null,li=Ke(V,Oe,Y-Mt,Y+oi,0,It.minX,It.maxX,ze),_i=Ke(V,Oe,Y+Xt,Y+Ht,0,It.minX,It.maxX,ze);V=null,li&&(xi=Ke(li,Oe,re-Mt,re+oi,1,It.minY,It.maxY,ze),Ni=Ke(li,Oe,re+Xt,re+Ht,1,It.minY,It.maxY,ze),li=null),_i&&(es=Ke(_i,Oe,re-Mt,re+oi,1,It.minY,It.maxY,ze),Zt=Ke(_i,Oe,re+Xt,re+Ht,1,It.minY,It.maxY,ze),_i=null),We>1&&console.timeEnd("clipping"),fe.push(xi||[],U+1,2*Y,2*re),fe.push(Ni||[],U+1,2*Y,2*re+1),fe.push(es||[],U+1,2*Y+1,2*re),fe.push(Zt||[],U+1,2*Y+1,2*re+1)}}getTile(V,U,Y){V=+V,U=+U,Y=+Y;const re=this.options,{extent:ye,debug:Te}=re;if(V<0||V>24)return null;const Ce=1<1&&console.log("drilling down to z%d-%d-%d",V,U,Y);let ze,We=V,Oe=U,nt=Y;for(;!ze&&We>0;)We--,Oe>>=1,nt>>=1,ze=this.tiles[Qi(We,Oe,nt)];return ze&&ze.source?(Te>1&&(console.log("found parent tile z%d-%d-%d",We,Oe,nt),console.time("drilling down")),this.splitTile(ze.source,We,Oe,nt,V,U,Y),Te>1&&console.timeEnd("drilling down"),this.tiles[fe]?ri(this.tiles[fe],ye):null):null}}function Qi(ce,V,U){return 32*((1<{Oe.properties=It;const Mt={};for(const Xt of nt)Mt[Xt]=fe[Xt].evaluate(We,Oe);return Mt},Te.reduce=(It,Mt)=>{Oe.properties=Mt;for(const Xt of nt)We.accumulated=It[Xt],It[Xt]=ze[Xt].evaluate(We,Oe)},Te}(V)).load((yield this._pendingData).features):(re=yield this._pendingData,new vi(re,V.geojsonVtOptions)),this.loaded={};const ye={};if(Y){const Te=Y.finish();Te&&(ye.resourceTiming={},ye.resourceTiming[V.source]=JSON.parse(JSON.stringify(Te)))}return ye}catch(ye){if(delete this._pendingRequest,u.bA(ye))return{abandoned:!0};throw ye}var re})}getData(){return u._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(V){const U=this.loaded;return U&&U[V.uid]?super.reloadTile(V):this.loadTile(V)}loadAndProcessGeoJSON(V,U){return u._(this,void 0,void 0,function*(){let Y=yield this.loadGeoJSON(V,U);if(delete this._pendingRequest,typeof Y!="object")throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(L(Y,!0),V.filter){const re=u.bB(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(re.result==="error")throw new Error(re.value.map(Te=>`${Te.key}: ${Te.message}`).join(", "));Y={type:"FeatureCollection",features:Y.features.filter(Te=>re.value.evaluate({zoom:0},Te))}}return Y})}loadGeoJSON(V,U){return u._(this,void 0,void 0,function*(){const{promoteId:Y}=V;if(V.request){const re=yield u.h(V.request,U);return this._dataUpdateable=cr(re.data,Y)?Cr(re.data,Y):void 0,re.data}if(typeof V.data=="string")try{const re=JSON.parse(V.data);return this._dataUpdateable=cr(re,Y)?Cr(re,Y):void 0,re}catch{throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`)}if(!V.dataDiff)throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${V.source}`);return function(re,ye,Te){var Ce,fe,ze,We;if(ye.removeAll&&re.clear(),ye.remove)for(const Oe of ye.remove)re.delete(Oe);if(ye.add)for(const Oe of ye.add){const nt=Bt(Oe,Te);nt!=null&&re.set(nt,Oe)}if(ye.update)for(const Oe of ye.update){let nt=re.get(Oe.id);if(nt==null)continue;const It=!Oe.removeAllProperties&&(((Ce=Oe.removeProperties)===null||Ce===void 0?void 0:Ce.length)>0||((fe=Oe.addOrUpdateProperties)===null||fe===void 0?void 0:fe.length)>0);if((Oe.newGeometry||Oe.removeAllProperties||It)&&(nt=Object.assign({},nt),re.set(Oe.id,nt),It&&(nt.properties=Object.assign({},nt.properties))),Oe.newGeometry&&(nt.geometry=Oe.newGeometry),Oe.removeAllProperties)nt.properties={};else if(((ze=Oe.removeProperties)===null||ze===void 0?void 0:ze.length)>0)for(const Mt of Oe.removeProperties)Object.prototype.hasOwnProperty.call(nt.properties,Mt)&&delete nt.properties[Mt];if(((We=Oe.addOrUpdateProperties)===null||We===void 0?void 0:We.length)>0)for(const{key:Mt,value:Xt}of Oe.addOrUpdateProperties)nt.properties[Mt]=Xt}}(this._dataUpdateable,V.dataDiff,Y),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(V){return u._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(V){return this._geoJSONIndex.getClusterExpansionZoom(V.clusterId)}getClusterChildren(V){return this._geoJSONIndex.getChildren(V.clusterId)}getClusterLeaves(V){return this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset)}}class Hn{constructor(V){this.self=V,this.actor=new u.F(V),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(U,Y)=>{if(this.externalWorkerSourceTypes[U])throw new Error(`Worker source with name "${U}" already registered.`);this.externalWorkerSourceTypes[U]=Y},this.self.addProtocol=u.bh,this.self.removeProtocol=u.bi,this.self.registerRTLTextPlugin=U=>{if(u.bC.isParsed())throw new Error("RTL text plugin already registered.");u.bC.setMethods(U)},this.actor.registerMessageHandler("LDT",(U,Y)=>this._getDEMWorkerSource(U,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RDT",(U,Y)=>u._(this,void 0,void 0,function*(){this._getDEMWorkerSource(U,Y.source).removeTile(Y)})),this.actor.registerMessageHandler("GCEZ",(U,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterExpansionZoom(Y)})),this.actor.registerMessageHandler("GCC",(U,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterChildren(Y)})),this.actor.registerMessageHandler("GCL",(U,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(U,Y.type,Y.source).getClusterLeaves(Y)})),this.actor.registerMessageHandler("LD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadData(Y)),this.actor.registerMessageHandler("GD",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).getData()),this.actor.registerMessageHandler("LT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).reloadTile(Y)),this.actor.registerMessageHandler("AT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).abortTile(Y)),this.actor.registerMessageHandler("RMT",(U,Y)=>this._getWorkerSource(U,Y.type,Y.source).removeTile(Y)),this.actor.registerMessageHandler("RS",(U,Y)=>u._(this,void 0,void 0,function*(){if(!this.workerSources[U]||!this.workerSources[U][Y.type]||!this.workerSources[U][Y.type][Y.source])return;const re=this.workerSources[U][Y.type][Y.source];delete this.workerSources[U][Y.type][Y.source],re.removeSource!==void 0&&re.removeSource(Y)})),this.actor.registerMessageHandler("RM",U=>u._(this,void 0,void 0,function*(){delete this.layerIndexes[U],delete this.availableImages[U],delete this.workerSources[U],delete this.demWorkerSources[U]})),this.actor.registerMessageHandler("SR",(U,Y)=>u._(this,void 0,void 0,function*(){this.referrer=Y})),this.actor.registerMessageHandler("SRPS",(U,Y)=>this._syncRTLPluginState(U,Y)),this.actor.registerMessageHandler("IS",(U,Y)=>u._(this,void 0,void 0,function*(){this.self.importScripts(Y)})),this.actor.registerMessageHandler("SI",(U,Y)=>this._setImages(U,Y)),this.actor.registerMessageHandler("UL",(U,Y)=>u._(this,void 0,void 0,function*(){this._getLayerIndex(U).update(Y.layers,Y.removedIds)})),this.actor.registerMessageHandler("SL",(U,Y)=>u._(this,void 0,void 0,function*(){this._getLayerIndex(U).replace(Y)}))}_setImages(V,U){return u._(this,void 0,void 0,function*(){this.availableImages[V]=U;for(const Y in this.workerSources[V]){const re=this.workerSources[V][Y];for(const ye in re)re[ye].availableImages=U}})}_syncRTLPluginState(V,U){return u._(this,void 0,void 0,function*(){if(u.bC.isParsed())return u.bC.getState();if(U.pluginStatus!=="loading")return u.bC.setState(U),U;const Y=U.pluginURL;if(this.self.importScripts(Y),u.bC.isParsed()){const re={pluginStatus:"loaded",pluginURL:Y};return u.bC.setState(re),re}throw u.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Y}`)})}_getAvailableImages(V){let U=this.availableImages[V];return U||(U=[]),U}_getLayerIndex(V){let U=this.layerIndexes[V];return U||(U=this.layerIndexes[V]=new c),U}_getWorkerSource(V,U,Y){if(this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][U]||(this.workerSources[V][U]={}),!this.workerSources[V][U][Y]){const re={sendAsync:(ye,Te)=>(ye.targetMapId=V,this.actor.sendAsync(ye,Te))};switch(U){case"vector":this.workerSources[V][U][Y]=new C(re,this._getLayerIndex(V),this._getAvailableImages(V));break;case"geojson":this.workerSources[V][U][Y]=new Pr(re,this._getLayerIndex(V),this._getAvailableImages(V));break;default:this.workerSources[V][U][Y]=new this.externalWorkerSourceTypes[U](re,this._getLayerIndex(V),this._getAvailableImages(V))}}return this.workerSources[V][U][Y]}_getDEMWorkerSource(V,U){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][U]||(this.demWorkerSources[V][U]=new P),this.demWorkerSources[V][U]}}return u.i(self)&&(self.worker=new Hn(self)),Hn}),n("index",["exports","./shared"],function(u,c){var _="4.5.2";let w,S;const C={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:b=>new Promise((o,d)=>{const p=requestAnimationFrame(o);b.signal.addEventListener("abort",()=>{cancelAnimationFrame(p),d(c.c())})}),getImageData(b,o=0){return this.getImageCanvasContext(b).getImageData(-o,-o,b.width+2*o,b.height+2*o)},getImageCanvasContext(b){const o=window.document.createElement("canvas"),d=o.getContext("2d",{willReadFrequently:!0});if(!d)throw new Error("failed to create canvas 2d context");return o.width=b.width,o.height=b.height,d.drawImage(b,0,0,b.width,b.height),d},resolveURL:b=>(w||(w=document.createElement("a")),w.href=b,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(S==null&&(S=matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}};class P{static testProp(o){if(!P.docStyle)return o[0];for(let d=0;d{window.removeEventListener("click",P.suppressClickInternal,!0)},0)}static getScale(o){const d=o.getBoundingClientRect();return{x:d.width/o.offsetWidth||1,y:d.height/o.offsetHeight||1,boundingClientRect:d}}static getPoint(o,d,p){const m=d.boundingClientRect;return new c.P((p.clientX-m.left)/d.x-o.clientLeft,(p.clientY-m.top)/d.y-o.clientTop)}static mousePos(o,d){const p=P.getScale(o);return P.getPoint(o,p,d)}static touchPos(o,d){const p=[],m=P.getScale(o);for(let y=0;y{j&&G(j),j=null,te=!0},L.onerror=()=>{H=!0,j=null},L.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(b){let o,d,p,m;b.resetRequestQueue=()=>{o=[],d=0,p=0,m={}},b.addThrottleControl=M=>{const k=p++;return m[k]=M,k},b.removeThrottleControl=M=>{delete m[M],E()},b.getImage=(M,k,N=!0)=>new Promise((B,W)=>{D.supported&&(M.headers||(M.headers={}),M.headers.accept="image/webp,*/*"),c.e(M,{type:"image"}),o.push({abortController:k,requestParameters:M,supportImageRefresh:N,state:"queued",onError:Z=>{W(Z)},onSuccess:Z=>{B(Z)}}),E()});const y=M=>c._(this,void 0,void 0,function*(){M.state="running";const{requestParameters:k,supportImageRefresh:N,onError:B,onSuccess:W,abortController:Z}=M,ee=N===!1&&!c.i(self)&&!c.g(k.url)&&(!k.headers||Object.keys(k.headers).reduce((ue,_e)=>ue&&_e==="accept",!0));d++;const le=ee?I(k,Z):c.m(k,Z);try{const ue=yield le;delete M.abortController,M.state="completed",ue.data instanceof HTMLImageElement||c.b(ue.data)?W(ue):ue.data&&W({data:yield(oe=ue.data,typeof createImageBitmap=="function"?c.d(oe):c.f(oe)),cacheControl:ue.cacheControl,expires:ue.expires})}catch(ue){delete M.abortController,B(ue)}finally{d--,E()}var oe}),E=()=>{const M=(()=>{for(const k of Object.keys(m))if(m[k]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let k=d;k0;k++){const N=o.shift();N.abortController.signal.aborted?k--:y(N)}},I=(M,k)=>new Promise((N,B)=>{const W=new Image,Z=M.url,ee=M.credentials;ee&&ee==="include"?W.crossOrigin="use-credentials":(ee&&ee==="same-origin"||!c.s(Z))&&(W.crossOrigin="anonymous"),k.signal.addEventListener("abort",()=>{W.src="",B(c.c())}),W.fetchPriority="high",W.onload=()=>{W.onerror=W.onload=null,N({data:W})},W.onerror=()=>{W.onerror=W.onload=null,k.signal.aborted||B(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."))},W.src=Z})}(se||(se={})),se.resetRequestQueue();class ve{constructor(o){this._transformRequestFn=o}transformRequest(o,d){return this._transformRequestFn&&this._transformRequestFn(o,d)||{url:o}}setTransformRequest(o){this._transformRequestFn=o}}function Se(b){var o=new c.A(3);return o[0]=b[0],o[1]=b[1],o[2]=b[2],o}var ge,De=function(b,o,d){return b[0]=o[0]-d[0],b[1]=o[1]-d[1],b[2]=o[2]-d[2],b};ge=new c.A(3),c.A!=Float32Array&&(ge[0]=0,ge[1]=0,ge[2]=0);var Fe=function(b){var o=b[0],d=b[1];return o*o+d*d};function Be(b){const o=[];if(typeof b=="string")o.push({id:"default",url:b});else if(b&&b.length>0){const d=[];for(const{id:p,url:m}of b){const y=`${p}${m}`;d.indexOf(y)===-1&&(d.push(y),o.push({id:p,url:m}))}}return o}function Qe(b,o,d){const p=b.split("?");return p[0]+=`${o}${d}`,p.join("?")}(function(){var b=new c.A(2);c.A!=Float32Array&&(b[0]=0,b[1]=0)})();class He{constructor(o,d,p,m){this.context=o,this.format=p,this.texture=o.gl.createTexture(),this.update(d,m)}update(o,d,p){const{width:m,height:y}=o,E=!(this.size&&this.size[0]===m&&this.size[1]===y||p),{context:I}=this,{gl:M}=I;if(this.useMipmap=!!(d&&d.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),I.pixelStoreUnpackFlipY.set(!1),I.pixelStoreUnpack.set(1),I.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!d||d.premultiply!==!1)),E)this.size=[m,y],o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||c.b(o)?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,o):M.texImage2D(M.TEXTURE_2D,0,this.format,m,y,0,this.format,M.UNSIGNED_BYTE,o.data);else{const{x:k,y:N}=p||{x:0,y:0};o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||c.b(o)?M.texSubImage2D(M.TEXTURE_2D,0,k,N,M.RGBA,M.UNSIGNED_BYTE,o):M.texSubImage2D(M.TEXTURE_2D,0,k,N,m,y,M.RGBA,M.UNSIGNED_BYTE,o.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)}bind(o,d,p){const{context:m}=this,{gl:y}=m;y.bindTexture(y.TEXTURE_2D,this.texture),p!==y.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=y.LINEAR),o!==this.filter&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,o),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,p||o),this.filter=o),d!==this.wrap&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,d),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,d),this.wrap=d)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:o}=this.context;o.deleteTexture(this.texture),this.texture=null}}function Xe(b){const{userImage:o}=b;return!!(o&&o.render&&o.render())&&(b.data.replace(new Uint8Array(o.data.buffer)),!0)}class dt extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:d,promiseResolve:p}of this.requestors)p(this._getImagesForIds(d));this.requestors=[]}}getImage(o){const d=this.images[o];if(d&&!d.data&&d.spriteData){const p=d.spriteData;d.data=new c.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),d.spriteData=null}return d}addImage(o,d){if(this.images[o])throw new Error(`Image id ${o} already exist, use updateImage instead`);this._validate(o,d)&&(this.images[o]=d)}_validate(o,d){let p=!0;const m=d.data||d.spriteData;return this._validateStretch(d.stretchX,m&&m.width)||(this.fire(new c.j(new Error(`Image "${o}" has invalid "stretchX" value`))),p=!1),this._validateStretch(d.stretchY,m&&m.height)||(this.fire(new c.j(new Error(`Image "${o}" has invalid "stretchY" value`))),p=!1),this._validateContent(d.content,d)||(this.fire(new c.j(new Error(`Image "${o}" has invalid "content" value`))),p=!1),p}_validateStretch(o,d){if(!o)return!0;let p=0;for(const m of o){if(m[0]{let m=!0;if(!this.isLoaded())for(const y of o)this.images[y]||(m=!1);this.isLoaded()||m?d(this._getImagesForIds(o)):this.requestors.push({ids:o,promiseResolve:d})})}_getImagesForIds(o){const d={};for(const p of o){let m=this.getImage(p);m||(this.fire(new c.k("styleimagemissing",{id:p})),m=this.getImage(p)),m?d[p]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,textFitWidth:m.textFitWidth,textFitHeight:m.textFitHeight,hasRenderCallback:!!(m.userImage&&m.userImage.render)}:c.w(`Image "${p}" 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.`)}return d}getPixelSize(){const{width:o,height:d}=this.atlasImage;return{width:o,height:d}}getPattern(o){const d=this.patterns[o],p=this.getImage(o);if(!p)return null;if(d&&d.position.version===p.version)return d.position;if(d)d.position.version=p.version;else{const m={w:p.data.width+2,h:p.data.height+2,x:0,y:0},y=new c.I(m,p);this.patterns[o]={bin:m,position:y}}return this._updatePatternAtlas(),this.patterns[o].position}bind(o){const d=o.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new He(o,this.atlasImage,d.RGBA),this.atlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE)}_updatePatternAtlas(){const o=[];for(const y in this.patterns)o.push(this.patterns[y].bin);const{w:d,h:p}=c.p(o),m=this.atlasImage;m.resize({width:d||1,height:p||1});for(const y in this.patterns){const{bin:E}=this.patterns[y],I=E.x+1,M=E.y+1,k=this.getImage(y).data,N=k.width,B=k.height;c.R.copy(k,m,{x:0,y:0},{x:I,y:M},{width:N,height:B}),c.R.copy(k,m,{x:0,y:B-1},{x:I,y:M-1},{width:N,height:1}),c.R.copy(k,m,{x:0,y:0},{x:I,y:M+B},{width:N,height:1}),c.R.copy(k,m,{x:N-1,y:0},{x:I-1,y:M},{width:1,height:B}),c.R.copy(k,m,{x:0,y:0},{x:I+N,y:M},{width:1,height:B})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(o){for(const d of o){if(this.callbackDispatchedThisFrame[d])continue;this.callbackDispatchedThisFrame[d]=!0;const p=this.getImage(d);p||c.w(`Image with ID: "${d}" was not found`),Xe(p)&&this.updateImage(d,p)}}}const yt=1e20;function Ft(b,o,d,p,m,y,E,I,M){for(let k=o;k-1);M++,y[M]=I,E[M]=k,E[M+1]=yt}for(let I=0,M=0;I65535)throw new Error("glyphs > 65535 not supported");if(p.ranges[y])return{stack:o,id:d,glyph:m};if(!this.url)throw new Error("glyphsUrl is not set");if(!p.requests[y]){const I=kt.loadGlyphRange(o,y,this.url,this.requestManager);p.requests[y]=I}const E=yield p.requests[y];for(const I in E)this._doesCharSupportLocalGlyph(+I)||(p.glyphs[+I]=E[+I]);return p.ranges[y]=!0,{stack:o,id:d,glyph:E[d]||null}})}_doesCharSupportLocalGlyph(o){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](o)||c.u["Hangul Syllables"](o)||c.u.Hiragana(o)||c.u.Katakana(o))}_tinySDF(o,d,p){const m=this.localIdeographFontFamily;if(!m||!this._doesCharSupportLocalGlyph(p))return;let y=o.tinySDF;if(!y){let I="400";/bold/i.test(d)?I="900":/medium/i.test(d)?I="500":/light/i.test(d)&&(I="200"),y=o.tinySDF=new kt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:m,fontWeight:I})}const E=y.draw(String.fromCharCode(p));return{id:p,bitmap:new c.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}kt.loadGlyphRange=function(b,o,d,p){return c._(this,void 0,void 0,function*(){const m=256*o,y=m+255,E=p.transformRequest(d.replace("{fontstack}",b).replace("{range}",`${m}-${y}`),"Glyphs"),I=yield c.l(E,new AbortController);if(!I||!I.data)throw new Error(`Could not load glyph range. range: ${o}, ${m}-${y}`);const M={};for(const k of c.n(I.data))M[k.id]=k;return M})},kt.TinySDF=class{constructor({fontSize:b=24,buffer:o=3,radius:d=8,cutoff:p=.25,fontFamily:m="sans-serif",fontWeight:y="normal",fontStyle:E="normal"}={}){this.buffer=o,this.cutoff=p,this.radius=d;const I=this.size=b+4*o,M=this._createCanvas(I),k=this.ctx=M.getContext("2d",{willReadFrequently:!0});k.font=`${E} ${y} ${b}px ${m}`,k.textBaseline="alphabetic",k.textAlign="left",k.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(b){const o=document.createElement("canvas");return o.width=o.height=b,o}draw(b){const{width:o,actualBoundingBoxAscent:d,actualBoundingBoxDescent:p,actualBoundingBoxLeft:m,actualBoundingBoxRight:y}=this.ctx.measureText(b),E=Math.ceil(d),I=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(y-m))),M=Math.min(this.size-this.buffer,E+Math.ceil(p)),k=I+2*this.buffer,N=M+2*this.buffer,B=Math.max(k*N,0),W=new Uint8ClampedArray(B),Z={data:W,width:k,height:N,glyphWidth:I,glyphHeight:M,glyphTop:E,glyphLeft:0,glyphAdvance:o};if(I===0||M===0)return Z;const{ctx:ee,buffer:le,gridInner:oe,gridOuter:ue}=this;ee.clearRect(le,le,I,M),ee.fillText(b,le,le+E);const _e=ee.getImageData(le,le,I,M);ue.fill(yt,0,B),oe.fill(0,0,B);for(let ne=0;ne0?$e*$e:0,oe[ke]=$e<0?$e*$e:0}}Ft(ue,0,0,k,N,k,this.f,this.v,this.z),Ft(oe,le,le,I,M,k,this.f,this.v,this.z);for(let ne=0;ne1&&(M=o[++I]);const N=Math.abs(k-M.left),B=Math.abs(k-M.right),W=Math.min(N,B);let Z;const ee=y/p*(m+1);if(M.isDash){const le=m-Math.abs(ee);Z=Math.sqrt(W*W+le*le)}else Z=m-Math.sqrt(W*W+ee*ee);this.data[E+k]=Math.max(0,Math.min(255,Z+128))}}}addRegularDash(o){for(let I=o.length-1;I>=0;--I){const M=o[I],k=o[I+1];M.zeroLength?o.splice(I,1):k&&k.isDash===M.isDash&&(k.left=M.left,o.splice(I,1))}const d=o[0],p=o[o.length-1];d.isDash===p.isDash&&(d.left=p.left-this.width,p.right=d.right+this.width);const m=this.width*this.nextRow;let y=0,E=o[y];for(let I=0;I1&&(E=o[++y]);const M=Math.abs(I-E.left),k=Math.abs(I-E.right),N=Math.min(M,k);this.data[m+I]=Math.max(0,Math.min(255,(E.isDash?N:-N)+128))}}addDash(o,d){const p=d?7:0,m=2*p+1;if(this.nextRow+m>this.height)return c.w("LineAtlas out of space"),null;let y=0;for(let I=0;I{d.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[En]}numActive(){return Object.keys(this.active).length}}const In=Math.floor(C.hardwareConcurrency/2);let hi,as;function gi(){return hi||(hi=new An),hi}An.workerCount=c.C(globalThis)?Math.max(Math.min(In,3),1):1;class Ii{constructor(o,d){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=d;const p=this.workerPool.acquire(d);for(let m=0;m{d.remove()}),this.actors=[],o&&this.workerPool.release(this.id)}registerMessageHandler(o,d){for(const p of this.actors)p.registerMessageHandler(o,d)}}function Wn(){return as||(as=new Ii(gi(),c.G),as.registerMessageHandler("GR",(b,o,d)=>c.m(o,d))),as}function Bs(b,o){const d=c.H();return c.J(d,d,[1,1,0]),c.K(d,d,[.5*b.width,.5*b.height,1]),c.L(d,d,b.calculatePosMatrix(o.toUnwrapped()))}function pe(b,o,d,p,m,y){const E=function(B,W,Z){if(B)for(const ee of B){const le=W[ee];if(le&&le.source===Z&&le.type==="fill-extrusion")return!0}else for(const ee in W){const le=W[ee];if(le.source===Z&&le.type==="fill-extrusion")return!0}return!1}(m&&m.layers,o,b.id),I=y.maxPitchScaleFactor(),M=b.tilesIn(p,I,E);M.sort(xe);const k=[];for(const B of M)k.push({wrappedTileID:B.tileID.wrapped().key,queryResults:B.tile.queryRenderedFeatures(o,d,b._state,B.queryGeometry,B.cameraQueryGeometry,B.scale,m,y,I,Bs(b.transform,B.tileID))});const N=function(B){const W={},Z={};for(const ee of B){const le=ee.queryResults,oe=ee.wrappedTileID,ue=Z[oe]=Z[oe]||{};for(const _e in le){const ne=le[_e],we=ue[_e]=ue[_e]||{},Pe=W[_e]=W[_e]||[];for(const ke of ne)we[ke.featureIndex]||(we[ke.featureIndex]=!0,Pe.push(ke))}}return W}(k);for(const B in N)N[B].forEach(W=>{const Z=W.feature,ee=b.getFeatureState(Z.layer["source-layer"],Z.id);Z.source=Z.layer.source,Z.layer["source-layer"]&&(Z.sourceLayer=Z.layer["source-layer"]),Z.state=ee});return N}function xe(b,o){const d=b.tileID,p=o.tileID;return d.overscaledZ-p.overscaledZ||d.canonical.y-p.canonical.y||d.wrap-p.wrap||d.canonical.x-p.canonical.x}function Ue(b,o,d){return c._(this,void 0,void 0,function*(){let p=b;if(b.url?p=(yield c.h(o.transformRequest(b.url,"Source"),d)).data:yield C.frameAsync(d),!p)return null;const m=c.M(c.e(p,b),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in p&&p.vector_layers&&(m.vectorLayerIds=p.vector_layers.map(y=>y.id)),m})}class he{constructor(o,d){o&&(d?this.setSouthWest(o).setNorthEast(d):Array.isArray(o)&&(o.length===4?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1])))}setNorthEast(o){return this._ne=o instanceof c.N?new c.N(o.lng,o.lat):c.N.convert(o),this}setSouthWest(o){return this._sw=o instanceof c.N?new c.N(o.lng,o.lat):c.N.convert(o),this}extend(o){const d=this._sw,p=this._ne;let m,y;if(o instanceof c.N)m=o,y=o;else{if(!(o instanceof he))return Array.isArray(o)?o.length===4||o.every(Array.isArray)?this.extend(he.convert(o)):this.extend(c.N.convert(o)):o&&("lng"in o||"lon"in o)&&"lat"in o?this.extend(c.N.convert(o)):this;if(m=o._sw,y=o._ne,!m||!y)return this}return d||p?(d.lng=Math.min(m.lng,d.lng),d.lat=Math.min(m.lat,d.lat),p.lng=Math.max(y.lng,p.lng),p.lat=Math.max(y.lat,p.lat)):(this._sw=new c.N(m.lng,m.lat),this._ne=new c.N(y.lng,y.lat)),this}getCenter(){return new c.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.N(this.getWest(),this.getNorth())}getSouthEast(){return new c.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(o){const{lng:d,lat:p}=c.N.convert(o);let m=this._sw.lng<=d&&d<=this._ne.lng;return this._sw.lng>this._ne.lng&&(m=this._sw.lng>=d&&d>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&m}static convert(o){return o instanceof he?o:o&&new he(o)}static fromLngLat(o,d=0){const p=360*d/40075017,m=p/Math.cos(Math.PI/180*o.lat);return new he(new c.N(o.lng-m,o.lat-p),new c.N(o.lng+m,o.lat+p))}}class qe{constructor(o,d,p){this.bounds=he.convert(this.validateBounds(o)),this.minzoom=d||0,this.maxzoom=p||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const d=Math.pow(2,o.z),p=Math.floor(c.O(this.bounds.getWest())*d),m=Math.floor(c.Q(this.bounds.getNorth())*d),y=Math.ceil(c.O(this.bounds.getEast())*d),E=Math.ceil(c.Q(this.bounds.getSouth())*d);return o.x>=p&&o.x=m&&o.y{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(o){return c._(this,void 0,void 0,function*(){const d=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:this.map._requestManager.transformRequest(d,"Tile"),uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};p.request.collectResourceTiming=this._collectResourceTiming;let m="RT";if(o.actor&&o.state!=="expired"){if(o.state==="loading")return new Promise((y,E)=>{o.reloadPromise={resolve:y,reject:E}})}else o.actor=this.dispatcher.getActor(),m="LT";o.abortController=new AbortController;try{const y=yield o.actor.sendAsync({type:m,data:p},o.abortController);if(delete o.abortController,o.aborted)return;this._afterTileLoadWorkerResponse(o,y)}catch(y){if(delete o.abortController,o.aborted)return;if(y&&y.status!==404)throw y;this._afterTileLoadWorkerResponse(o,null)}})}_afterTileLoadWorkerResponse(o,d){if(d&&d.resourceTiming&&(o.resourceTiming=d.resourceTiming),d&&this.map._refreshExpiredTiles&&o.setExpiryData(d),o.loadVectorData(d,this.map.painter),o.reloadPromise){const p=o.reloadPromise;o.reloadPromise=null,this.loadTile(o).then(p.resolve).catch(p.reject)}}abortTile(o){return c._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.actor&&(yield o.actor.sendAsync({type:"AT",data:{uid:o.uid,type:this.type,source:this.id}}))})}unloadTile(o){return c._(this,void 0,void 0,function*(){o.unloadVectorData(),o.actor&&(yield o.actor.sendAsync({type:"RMT",data:{uid:o.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ze extends c.E{constructor(o,d,p,m){super(),this.id=o,this.dispatcher=p,this.setEventedParent(m),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},d),c.e(this,c.M(d,["url","scheme","tileSize"]))}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const o=yield Ue(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,o&&(c.e(this,o),o.bounds&&(this.tileBounds=new qe(o.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(o){this._tileJSONRequest=null,this.fire(new c.j(o))}})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(o){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),o(),this.load()}setTiles(o){return this.setSourceProperty(()=>{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}serialize(){return c.e({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o){return c._(this,void 0,void 0,function*(){const d=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);o.abortController=new AbortController;try{const p=yield se.getImage(this.map._requestManager.transformRequest(d,"Tile"),o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(p&&p.data){this.map._refreshExpiredTiles&&p.cacheControl&&p.expires&&o.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});const m=this.map.painter.context,y=m.gl,E=p.data;o.texture=this.map.painter.getTileTexture(E.width),o.texture?o.texture.update(E,{useMipmap:!0}):(o.texture=new He(m,E,y.RGBA,{useMipmap:!0}),o.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST)),o.state="loaded"}}catch(p){if(delete o.abortController,o.aborted)o.state="unloaded";else if(p)throw o.state="errored",p}})}abortTile(o){return c._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController)})}unloadTile(o){return c._(this,void 0,void 0,function*(){o.texture&&this.map.painter.saveTileTexture(o.texture)})}hasTransition(){return!1}}class Ke extends Ze{constructor(o,d,p,m){super(o,d,p,m),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},d),this.encoding=d.encoding||"mapbox",this.redFactor=d.redFactor,this.greenFactor=d.greenFactor,this.blueFactor=d.blueFactor,this.baseShift=d.baseShift}loadTile(o){return c._(this,void 0,void 0,function*(){const d=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=this.map._requestManager.transformRequest(d,"Tile");o.neighboringTiles=this._getNeighboringTiles(o.tileID),o.abortController=new AbortController;try{const m=yield se.getImage(p,o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(m&&m.data){const y=m.data;this.map._refreshExpiredTiles&&m.cacheControl&&m.expires&&o.setExpiryData({cacheControl:m.cacheControl,expires:m.expires});const E=c.b(y)&&c.U()?y:yield this.readImageNow(y),I={type:this.type,uid:o.uid,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!o.actor||o.state==="expired"){o.actor=this.dispatcher.getActor();const M=yield o.actor.sendAsync({type:"LDT",data:I});o.dem=M,o.needsHillshadePrepare=!0,o.needsTerrainPrepare=!0,o.state="loaded"}}}catch(m){if(delete o.abortController,o.aborted)o.state="unloaded";else if(m)throw o.state="errored",m}})}readImageNow(o){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.V()){const d=o.width+2,p=o.height+2;try{return new c.R({width:d,height:p},yield c.W(o,-1,-1,d,p))}catch{}}return C.getImageData(o,1)})}_getNeighboringTiles(o){const d=o.canonical,p=Math.pow(2,d.z),m=(d.x-1+p)%p,y=d.x===0?o.wrap-1:o.wrap,E=(d.x+1+p)%p,I=d.x+1===p?o.wrap+1:o.wrap,M={};return M[new c.S(o.overscaledZ,y,d.z,m,d.y).key]={backfilled:!1},M[new c.S(o.overscaledZ,I,d.z,E,d.y).key]={backfilled:!1},d.y>0&&(M[new c.S(o.overscaledZ,y,d.z,m,d.y-1).key]={backfilled:!1},M[new c.S(o.overscaledZ,o.wrap,d.z,d.x,d.y-1).key]={backfilled:!1},M[new c.S(o.overscaledZ,I,d.z,E,d.y-1).key]={backfilled:!1}),d.y+10&&c.e(y,{resourceTiming:m}),this.fire(new c.k("data",Object.assign(Object.assign({},y),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},y),{sourceDataType:"content"})))}catch(p){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(p))}})}loaded(){return this._pendingLoads===0}loadTile(o){return c._(this,void 0,void 0,function*(){const d=o.actor?"RT":"LT";o.actor=this.actor;const p={type:this.type,uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};o.abortController=new AbortController;const m=yield this.actor.sendAsync({type:d,data:p},o.abortController);delete o.abortController,o.unloadVectorData(),o.aborted||o.loadVectorData(m,this.map.painter,d==="RT")})}abortTile(o){return c._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.aborted=!0})}unloadTile(o){return c._(this,void 0,void 0,function*(){o.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:o.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ye=c.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class _t extends c.E{constructor(o,d,p,m){super(),this.id=o,this.dispatcher=p,this.coordinates=d.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=d}load(o){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const d=yield se.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,d&&d.data&&(this.image=d.data,o&&(this.coordinates=o),this._finishLoading())}catch(d){this._request=null,this._loaded=!0,this.fire(new c.j(d))}})}loaded(){return this._loaded}updateImage(o){return o.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=o.url,this.load(o.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(o){this.coordinates=o;const d=o.map(c.Z.fromLngLat);this.tileID=function(m){let y=1/0,E=1/0,I=-1/0,M=-1/0;for(const W of m)y=Math.min(y,W.x),E=Math.min(E,W.y),I=Math.max(I,W.x),M=Math.max(M,W.y);const k=Math.max(I-y,M-E),N=Math.max(0,Math.floor(-Math.log(k)/Math.LN2)),B=Math.pow(2,N);return new c.a1(N,Math.floor((y+I)/2*B),Math.floor((E+M)/2*B))}(d),this.minzoom=this.maxzoom=this.tileID.z;const p=d.map(m=>this.tileID.getTilePoint(m)._round());return this._boundsArray=new c.$,this._boundsArray.emplaceBack(p[0].x,p[0].y,0,0),this._boundsArray.emplaceBack(p[1].x,p[1].y,c.X,0),this._boundsArray.emplaceBack(p[3].x,p[3].y,0,c.X),this._boundsArray.emplaceBack(p[2].x,p[2].y,c.X,c.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,d=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new He(o,this.image,d.RGBA),this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE));let p=!1;for(const m in this.tiles){const y=this.tiles[m];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(o){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={}):o.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Rt extends _t{constructor(o,d,p,m){super(o,d,p,m),this.roundZoom=!0,this.type="video",this.options=d}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const o=this.options;this.urls=[];for(const d of o.urls)this.urls.push(this.map._requestManager.transformRequest(d,"Source").url);try{const d=yield c.a3(this.urls);if(this._loaded=!0,!d)return;this.video=d,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(d){this.fire(new c.j(d))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(o){if(this.video){const d=this.video.seekable;od.end(0)?this.fire(new c.j(new c.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${d.start(0)} and ${d.end(0)}-second mark.`))):this.video.currentTime=o}}getVideo(){return this.video}onAdd(o){this.map||(this.map=o,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const o=this.map.painter.context,d=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE),d.texSubImage2D(d.TEXTURE_2D,0,0,0,d.RGBA,d.UNSIGNED_BYTE,this.video)):(this.texture=new He(o,this.video,d.RGBA),this.texture.bind(d.LINEAR,d.CLAMP_TO_EDGE));let p=!1;for(const m in this.tiles){const y=this.tiles[m];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class St extends _t{constructor(o,d,p,m){super(o,d,p,m),d.coordinates?Array.isArray(d.coordinates)&&d.coordinates.length===4&&!d.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(E=>typeof E!="number"))||this.fire(new c.j(new c.a2(`sources.${o}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.a2(`sources.${o}`,null,'missing required property "coordinates"'))),d.animate&&typeof d.animate!="boolean"&&this.fire(new c.j(new c.a2(`sources.${o}`,null,'optional "animate" property must be a boolean value'))),d.canvas?typeof d.canvas=="string"||d.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.a2(`sources.${o}`,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 c.j(new c.a2(`sources.${o}`,null,'missing required property "canvas"'))),this.options=d,this.animate=d.animate===void 0||d.animate}load(){return c._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(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())})}getCanvas(){return this.canvas}onAdd(o){this.map=o,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let o=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,o=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,o=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const d=this.map.painter.context,p=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?(o||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new He(d,this.canvas,p.RGBA,{premultiply:!0});let m=!1;for(const y in this.tiles){const E=this.tiles[y];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,m=!0)}m&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const o of[this.canvas.width,this.canvas.height])if(isNaN(o)||o<=0)return!0;return!1}}const $t={},Kt=b=>{switch(b){case"geojson":return st;case"image":return _t;case"raster":return Ze;case"raster-dem":return Ke;case"vector":return it;case"video":return Rt;case"canvas":return St}return $t[b]},je="RTLPluginLoaded";class Gt extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Wn()}_syncState(o){return this.status=o,this.dispatcher.broadcast("SRPS",{pluginStatus:o,pluginURL:this.url}).catch(d=>{throw this.status="error",d})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(o){return c._(this,arguments,void 0,function*(d,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=C.resolveURL(d),!this.url)throw new Error(`requested url ${d} is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return c._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.k(je))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ri=null;function Mi(){return ri||(ri=new Gt),ri}class Cs{constructor(o,d){this.timeAdded=0,this.fadeEndTime=0,this.tileID=o,this.uid=c.a4(),this.uses=0,this.tileSize=d,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(o){const d=o+this.timeAdded;dy.getLayer(k)).filter(Boolean);if(M.length!==0){I.layers=M,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(k=>M.filter(N=>N.id===k)[0]));for(const k of M)E[k.id]=I}}return E}(o.buckets,d.style),this.hasSymbolBuckets=!1;for(const m in this.buckets){const y=this.buckets[m];if(y instanceof c.a6){if(this.hasSymbolBuckets=!0,!p)break;y.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const m in this.buckets){const y=this.buckets[m];if(y instanceof c.a6&&y.hasRTLText){this.hasRTLText=!0,Mi().lazyLoad();break}}this.queryPadding=0;for(const m in this.buckets){const y=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,d.style.getLayer(m).queryRadius(y))}o.imageAtlas&&(this.imageAtlas=o.imageAtlas),o.glyphAtlasImage&&(this.glyphAtlasImage=o.glyphAtlasImage)}else this.collisionBoxArray=new c.a5}unloadVectorData(){for(const o in this.buckets)this.buckets[o].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(o){return this.buckets[o.id]}upload(o){for(const p in this.buckets){const m=this.buckets[p];m.uploadPending()&&m.upload(o)}const d=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new He(o,this.imageAtlas.image,d.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new He(o,this.glyphAtlasImage,d.ALPHA),this.glyphAtlasImage=null)}prepare(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)}queryRenderedFeatures(o,d,p,m,y,E,I,M,k,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:y,scale:E,tileSize:this.tileSize,pixelPosMatrix:N,transform:M,params:I,queryPadding:this.queryPadding*k},o,d,p):{}}querySourceFeatures(o,d){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const m=p.loadVTLayers(),y=d&&d.sourceLayer?d.sourceLayer:"",E=m._geojsonTileLayer||m[y];if(!E)return;const I=c.a7(d&&d.filter),{z:M,x:k,y:N}=this.tileID.canonical,B={z:M,x:k,y:N};for(let W=0;Wp)m=!1;else if(d)if(this.expirationTime{this.remove(o,y)},p)),this.data[m].push(y),this.order.push(m),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){const d=this.data[o].shift();return d.timeout&&clearTimeout(d.timeout),this.data[o].length===0&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),d.value}getByKey(o){const d=this.data[o];return d?d[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,d){if(!this.has(o))return this;const p=o.wrapped().key,m=d===void 0?0:this.data[p].indexOf(d),y=this.data[p][m];return this.data[p].splice(m,1),y.timeout&&clearTimeout(y.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(y.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){const d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this}filter(o){const d=[];for(const p in this.data)for(const m of this.data[p])o(m.value)||d.push(m);for(const p of d)this.remove(p.value.tileID,p)}}class Wt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(o,d,p){const m=String(d);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][m]=this.stateChanges[o][m]||{},c.e(this.stateChanges[o][m],p),this.deletedStates[o]===null){this.deletedStates[o]={};for(const y in this.state[o])y!==m&&(this.deletedStates[o][y]=null)}else if(this.deletedStates[o]&&this.deletedStates[o][m]===null){this.deletedStates[o][m]={};for(const y in this.state[o][m])p[y]||(this.deletedStates[o][m][y]=null)}else for(const y in p)this.deletedStates[o]&&this.deletedStates[o][m]&&this.deletedStates[o][m][y]===null&&delete this.deletedStates[o][m][y]}removeFeatureState(o,d,p){if(this.deletedStates[o]===null)return;const m=String(d);if(this.deletedStates[o]=this.deletedStates[o]||{},p&&d!==void 0)this.deletedStates[o][m]!==null&&(this.deletedStates[o][m]=this.deletedStates[o][m]||{},this.deletedStates[o][m][p]=null);else if(d!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][m])for(p in this.deletedStates[o][m]={},this.stateChanges[o][m])this.deletedStates[o][m][p]=null;else this.deletedStates[o][m]=null;else this.deletedStates[o]=null}getState(o,d){const p=String(d),m=c.e({},(this.state[o]||{})[p],(this.stateChanges[o]||{})[p]);if(this.deletedStates[o]===null)return{};if(this.deletedStates[o]){const y=this.deletedStates[o][d];if(y===null)return{};for(const E in y)delete m[E]}return m}initializeTileState(o,d){o.setFeatureState(this.state,d)}coalesceChanges(o,d){const p={};for(const m in this.stateChanges){this.state[m]=this.state[m]||{};const y={};for(const E in this.stateChanges[m])this.state[m][E]||(this.state[m][E]={}),c.e(this.state[m][E],this.stateChanges[m][E]),y[E]=this.state[m][E];p[m]=y}for(const m in this.deletedStates){this.state[m]=this.state[m]||{};const y={};if(this.deletedStates[m]===null)for(const E in this.state[m])y[E]={},this.state[m][E]={};else for(const E in this.deletedStates[m]){if(this.deletedStates[m][E]===null)this.state[m][E]={};else for(const I of Object.keys(this.deletedStates[m][E]))delete this.state[m][E][I];y[E]=this.state[m][E]}p[m]=p[m]||{},c.e(p[m],y)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const m in o)o[m].setFeatureState(p,d)}}class Ot extends c.E{constructor(o,d,p){super(),this.id=o,this.dispatcher=p,this.on("data",m=>this._dataHandler(m)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((m,y,E,I)=>{const M=new(Kt(y.type))(m,y,E,I);if(M.id!==m)throw new Error(`Expected Source id to be ${m} instead of ${M.id}`);return M})(o,d,p,this),this._tiles={},this._cache=new ot(0,m=>this._unloadTile(m)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Wt,this._didEmitContent=!1,this._updated=!1}onAdd(o){this.map=o,this._maxTileCacheSize=o?o._maxTileCacheSize:null,this._maxTileCacheZoomLevels=o?o._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(o)}onRemove(o){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(o)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const o in this._tiles){const d=this._tiles[o];if(d.state!=="loaded"&&d.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const o=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,o&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(o,d,p){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(o),this._tileLoaded(o,d,p)}catch(m){o.state="errored",m.status!==404?this._source.fire(new c.j(m,{tile:o})):this.update(this.transform,this.terrain)}})}_unloadTile(o){this._source.unloadTile&&this._source.unloadTile(o)}_abortTile(o){this._source.abortTile&&this._source.abortTile(o),this._source.fire(new c.k("dataabort",{tile:o,coord:o.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(o){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const d in this._tiles){const p=this._tiles[d];p.upload(o),p.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(o=>o.tileID).sort(vi).map(o=>o.key)}getRenderableIds(o){const d=[];for(const p in this._tiles)this._isIdRenderable(p,o)&&d.push(this._tiles[p]);return o?d.sort((p,m)=>{const y=p.tileID,E=m.tileID,I=new c.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle),M=new c.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return y.overscaledZ-E.overscaledZ||M.y-I.y||M.x-I.x}).map(p=>p.tileID.key):d.map(p=>p.tileID).sort(vi).map(p=>p.key)}hasRenderableParent(o){const d=this.findLoadedParent(o,0);return!!d&&this._isIdRenderable(d.tileID.key)}_isIdRenderable(o,d){return this._tiles[o]&&this._tiles[o].hasData()&&!this._coveredTiles[o]&&(d||!this._tiles[o].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const o in this._tiles)this._tiles[o].state!=="errored"&&this._reloadTile(o,"reloading")}}_reloadTile(o,d){return c._(this,void 0,void 0,function*(){const p=this._tiles[o];p&&(p.state!=="loading"&&(p.state=d),yield this._loadTile(p,o,d))})}_tileLoaded(o,d,p){o.timeAdded=C.now(),p==="expired"&&(o.refreshedUponExpiration=!0),this._setTileReloadTimer(d,o),this.getSource().type==="raster-dem"&&o.dem&&this._backfillDEM(o),this._state.initializeTileState(o,this.map?this.map.painter:null),o.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:o,coord:o.tileID}))}_backfillDEM(o){const d=this.getRenderableIds();for(let m=0;m1||(Math.abs(E)>1&&(Math.abs(E+M)===1?E+=M:Math.abs(E-M)===1&&(E-=M)),y.dem&&m.dem&&(m.dem.backfillBorder(y.dem,E,I),m.neighboringTiles&&m.neighboringTiles[k]&&(m.neighboringTiles[k].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,d,p,m){for(const y in this._tiles){let E=this._tiles[y];if(m[y]||!E.hasData()||E.tileID.overscaledZ<=d||E.tileID.overscaledZ>p)continue;let I=E.tileID;for(;E&&E.tileID.overscaledZ>d+1;){const k=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[k.key],E&&E.hasData()&&(I=k)}let M=I;for(;M.overscaledZ>d;)if(M=M.scaledTo(M.overscaledZ-1),o[M.key]){m[I.key]=I;break}}}findLoadedParent(o,d){if(o.key in this._loadedParentTiles){const p=this._loadedParentTiles[o.key];return p&&p.tileID.overscaledZ>=d?p:null}for(let p=o.overscaledZ-1;p>=d;p--){const m=o.scaledTo(p),y=this._getLoadedTile(m);if(y)return y}}findLoadedSibling(o){return this._getLoadedTile(o)}_getLoadedTile(o){const d=this._tiles[o.key];return d&&d.hasData()?d:this._cache.getByKey(o.wrapped().key)}updateCacheSize(o){const d=Math.ceil(o.width/this._source.tileSize)+1,p=Math.ceil(o.height/this._source.tileSize)+1,m=Math.floor(d*p*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(y)}handleWrapJump(o){const d=Math.round((o-(this._prevLng===void 0?o:this._prevLng))/360);if(this._prevLng=o,d){const p={};for(const m in this._tiles){const y=this._tiles[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+d),p[y.tileID.key]=y}this._tiles=p;for(const m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(const m in this._tiles)this._setTileReloadTimer(m,this._tiles[m])}}_updateCoveredAndRetainedTiles(o,d,p,m,y,E){const I={},M={},k=Object.keys(o),N=C.now();for(const B of k){const W=o[B],Z=this._tiles[B];if(!Z||Z.fadeEndTime!==0&&Z.fadeEndTime<=N)continue;const ee=this.findLoadedParent(W,d),le=this.findLoadedSibling(W),oe=ee||le||null;oe&&(this._addTile(oe.tileID),I[oe.tileID.key]=oe.tileID),M[B]=W}this._retainLoadedChildren(M,m,p,o);for(const B in I)o[B]||(this._coveredTiles[B]=!0,o[B]=I[B]);if(E){const B={},W={};for(const Z of y)this._tiles[Z.key].hasData()?B[Z.key]=Z:W[Z.key]=Z;for(const Z in W){const ee=W[Z].children(this._source.maxzoom);this._tiles[ee[0].key]&&this._tiles[ee[1].key]&&this._tiles[ee[2].key]&&this._tiles[ee[3].key]&&(B[ee[0].key]=o[ee[0].key]=ee[0],B[ee[1].key]=o[ee[1].key]=ee[1],B[ee[2].key]=o[ee[2].key]=ee[2],B[ee[3].key]=o[ee[3].key]=ee[3],delete W[Z])}for(const Z in W){const ee=W[Z],le=this.findLoadedParent(ee,this._source.minzoom),oe=this.findLoadedSibling(ee),ue=le||oe||null;if(ue){B[ue.tileID.key]=o[ue.tileID.key]=ue.tileID;for(const _e in B)B[_e].isChildOf(ue.tileID)&&delete B[_e]}}for(const Z in this._tiles)B[Z]||(this._coveredTiles[Z]=!0)}}update(o,d){if(!this._sourceLoaded||this._paused)return;let p;this.transform=o,this.terrain=d,this.updateCacheSize(o),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=o.getVisibleUnwrappedCoordinates(this._source.tileID).map(N=>new c.S(N.canonical.z,N.wrap,N.canonical.z,N.canonical.x,N.canonical.y)):(p=o.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:d}),this._source.hasTile&&(p=p.filter(N=>this._source.hasTile(N)))):p=[];const m=o.coveringZoomLevel(this._source),y=Math.max(m-Ot.maxOverzooming,this._source.minzoom),E=Math.max(m+Ot.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const N={};for(const B of p)if(B.canonical.z>this._source.minzoom){const W=B.scaledTo(B.canonical.z-1);N[W.key]=W;const Z=B.scaledTo(Math.max(this._source.minzoom,Math.min(B.canonical.z,5)));N[Z.key]=Z}p=p.concat(Object.values(N))}const I=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,I&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const M=this._updateRetainedTiles(p,m);Qi(this._source.type)&&this._updateCoveredAndRetainedTiles(M,y,E,m,p,d);for(const N in M)this._tiles[N].clearFadeHold();const k=c.ac(this._tiles,M);for(const N of k){const B=this._tiles[N];B.hasSymbolBuckets&&!B.holdingForFade()?B.setHoldDuration(this.map._fadeDuration):B.hasSymbolBuckets&&!B.symbolFadeFinished()||this._removeTile(N)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const o in this._tiles)this._tiles[o].holdingForFade()&&this._removeTile(o)}_updateRetainedTiles(o,d){var p;const m={},y={},E=Math.max(d-Ot.maxOverzooming,this._source.minzoom),I=Math.max(d+Ot.maxUnderzooming,this._source.minzoom),M={};for(const k of o){const N=this._addTile(k);m[k.key]=k,N.hasData()||dthis._source.maxzoom){const W=k.children(this._source.maxzoom)[0],Z=this.getTile(W);if(Z&&Z.hasData()){m[W.key]=W;continue}}else{const W=k.children(this._source.maxzoom);if(m[W[0].key]&&m[W[1].key]&&m[W[2].key]&&m[W[3].key])continue}let B=N.wasRequested();for(let W=k.overscaledZ-1;W>=E;--W){const Z=k.scaledTo(W);if(y[Z.key])break;if(y[Z.key]=!0,N=this.getTile(Z),!N&&B&&(N=this._addTile(Z)),N){const ee=N.hasData();if((ee||!(!((p=this.map)===null||p===void 0)&&p.cancelPendingTileRequestsWhileZooming)||B)&&(m[Z.key]=Z),B=N.wasRequested(),ee)break}}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const d=[];let p,m=this._tiles[o].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){p=this._loadedParentTiles[m.key];break}d.push(m.key);const y=m.scaledTo(m.overscaledZ-1);if(p=this._getLoadedTile(y),p)break;m=y}for(const y of d)this._loadedParentTiles[y]=p}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const o in this._tiles){const d=this._tiles[o].tileID,p=this._getLoadedTile(d);this._loadedSiblingTiles[d.key]=p}}_addTile(o){let d=this._tiles[o.key];if(d)return d;d=this._cache.getAndRemove(o),d&&(this._setTileReloadTimer(o.key,d),d.tileID=o,this._state.initializeTileState(d,this.map?this.map.painter:null),this._cacheTimers[o.key]&&(clearTimeout(this._cacheTimers[o.key]),delete this._cacheTimers[o.key],this._setTileReloadTimer(o.key,d)));const p=d;return d||(d=new Cs(o,this._source.tileSize*o.overscaleFactor()),this._loadTile(d,o.key,d.state)),d.uses++,this._tiles[o.key]=d,p||this._source.fire(new c.k("dataloading",{tile:d,coord:d.tileID,dataType:"source"})),d}_setTileReloadTimer(o,d){o in this._timers&&(clearTimeout(this._timers[o]),delete this._timers[o]);const p=d.getExpiryTimeout();p&&(this._timers[o]=setTimeout(()=>{this._reloadTile(o,"expired"),delete this._timers[o]},p))}_removeTile(o){const d=this._tiles[o];d&&(d.uses--,delete this._tiles[o],this._timers[o]&&(clearTimeout(this._timers[o]),delete this._timers[o]),d.uses>0||(d.hasData()&&d.state!=="reloading"?this._cache.add(d.tileID,d,d.getExpiryTimeout()):(d.aborted=!0,this._abortTile(d),this._unloadTile(d))))}_dataHandler(o){const d=o.sourceDataType;o.dataType==="source"&&d==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&o.dataType==="source"&&d==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(o);this._cache.reset()}tilesIn(o,d,p){const m=[],y=this.transform;if(!y)return m;const E=p?y.getCameraQueryGeometry(o):o,I=o.map(ee=>y.pointCoordinate(ee,this.terrain)),M=E.map(ee=>y.pointCoordinate(ee,this.terrain)),k=this.getIds();let N=1/0,B=1/0,W=-1/0,Z=-1/0;for(const ee of M)N=Math.min(N,ee.x),B=Math.min(B,ee.y),W=Math.max(W,ee.x),Z=Math.max(Z,ee.y);for(let ee=0;ee=0&&ne[1].y+_e>=0){const we=I.map(ke=>oe.getTilePoint(ke)),Pe=M.map(ke=>oe.getTilePoint(ke));m.push({tile:le,tileID:oe,queryGeometry:we,cameraQueryGeometry:Pe,scale:ue})}}return m}getVisibleCoordinates(o){const d=this.getRenderableIds(o).map(p=>this._tiles[p].tileID);for(const p of d)p.posMatrix=this.transform.calculatePosMatrix(p.toUnwrapped());return d}hasTransition(){if(this._source.hasTransition())return!0;if(Qi(this._source.type)){const o=C.now();for(const d in this._tiles)if(this._tiles[d].fadeEndTime>=o)return!0}return!1}setFeatureState(o,d,p){this._state.updateState(o=o||"_geojsonTileLayer",d,p)}removeFeatureState(o,d,p){this._state.removeFeatureState(o=o||"_geojsonTileLayer",d,p)}getFeatureState(o,d){return this._state.getState(o=o||"_geojsonTileLayer",d)}setDependencies(o,d,p){const m=this._tiles[o];m&&m.setDependencies(d,p)}reloadTilesForDependencies(o,d){for(const p in this._tiles)this._tiles[p].hasDependency(o,d)&&this._reloadTile(p,"reloading");this._cache.filter(p=>!p.hasDependency(o,d))}}function vi(b,o){const d=Math.abs(2*b.wrap)-+(b.wrap<0),p=Math.abs(2*o.wrap)-+(o.wrap<0);return b.overscaledZ-o.overscaledZ||p-d||o.canonical.y-b.canonical.y||o.canonical.x-b.canonical.x}function Qi(b){return b==="raster"||b==="image"||b==="video"}Ot.maxOverzooming=10,Ot.maxUnderzooming=3;class Bt{constructor(o,d){this.reset(o,d)}reset(o,d){this.points=o||[],this._distances=[0];for(let p=1;p0?(m-E)/I:0;return this.points[y].mult(1-M).add(this.points[d].mult(M))}}function cr(b,o){let d=!0;return b==="always"||b!=="never"&&o!=="never"||(d=!1),d}class Cr{constructor(o,d,p){const m=this.boxCells=[],y=this.circleCells=[];this.xCellCount=Math.ceil(o/p),this.yCellCount=Math.ceil(d/p);for(let E=0;Ethis.width||m<0||d>this.height)return[];const M=[];if(o<=0&&d<=0&&this.width<=p&&this.height<=m){if(y)return[{key:null,x1:o,y1:d,x2:p,y2:m}];for(let k=0;k0}hitTestCircle(o,d,p,m,y){const E=o-p,I=o+p,M=d-p,k=d+p;if(I<0||E>this.width||k<0||M>this.height)return!1;const N=[];return this._forEachCell(E,M,I,k,this._queryCellCircle,N,{hitTest:!0,overlapMode:m,circle:{x:o,y:d,radius:p},seenUids:{box:{},circle:{}}},y),N.length>0}_queryCell(o,d,p,m,y,E,I,M){const{seenUids:k,hitTest:N,overlapMode:B}=I,W=this.boxCells[y];if(W!==null){const ee=this.bboxes;for(const le of W)if(!k.box[le]){k.box[le]=!0;const oe=4*le,ue=this.boxKeys[le];if(o<=ee[oe+2]&&d<=ee[oe+3]&&p>=ee[oe+0]&&m>=ee[oe+1]&&(!M||M(ue))&&(!N||!cr(B,ue.overlapMode))&&(E.push({key:ue,x1:ee[oe],y1:ee[oe+1],x2:ee[oe+2],y2:ee[oe+3]}),N))return!0}}const Z=this.circleCells[y];if(Z!==null){const ee=this.circles;for(const le of Z)if(!k.circle[le]){k.circle[le]=!0;const oe=3*le,ue=this.circleKeys[le];if(this._circleAndRectCollide(ee[oe],ee[oe+1],ee[oe+2],o,d,p,m)&&(!M||M(ue))&&(!N||!cr(B,ue.overlapMode))){const _e=ee[oe],ne=ee[oe+1],we=ee[oe+2];if(E.push({key:ue,x1:_e-we,y1:ne-we,x2:_e+we,y2:ne+we}),N)return!0}}}return!1}_queryCellCircle(o,d,p,m,y,E,I,M){const{circle:k,seenUids:N,overlapMode:B}=I,W=this.boxCells[y];if(W!==null){const ee=this.bboxes;for(const le of W)if(!N.box[le]){N.box[le]=!0;const oe=4*le,ue=this.boxKeys[le];if(this._circleAndRectCollide(k.x,k.y,k.radius,ee[oe+0],ee[oe+1],ee[oe+2],ee[oe+3])&&(!M||M(ue))&&!cr(B,ue.overlapMode))return E.push(!0),!0}}const Z=this.circleCells[y];if(Z!==null){const ee=this.circles;for(const le of Z)if(!N.circle[le]){N.circle[le]=!0;const oe=3*le,ue=this.circleKeys[le];if(this._circlesCollide(ee[oe],ee[oe+1],ee[oe+2],k.x,k.y,k.radius)&&(!M||M(ue))&&!cr(B,ue.overlapMode))return E.push(!0),!0}}}_forEachCell(o,d,p,m,y,E,I,M){const k=this._convertToXCellCoord(o),N=this._convertToYCellCoord(d),B=this._convertToXCellCoord(p),W=this._convertToYCellCoord(m);for(let Z=k;Z<=B;Z++)for(let ee=N;ee<=W;ee++)if(y.call(this,o,d,p,m,this.xCellCount*ee+Z,E,I,M))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,d,p,m,y,E){const I=m-o,M=y-d,k=p+E;return k*k>I*I+M*M}_circleAndRectCollide(o,d,p,m,y,E,I){const M=(E-m)/2,k=Math.abs(o-(m+M));if(k>M+p)return!1;const N=(I-y)/2,B=Math.abs(d-(y+N));if(B>N+p)return!1;if(k<=M||B<=N)return!0;const W=k-M,Z=B-N;return W*W+Z*Z<=p*p}}function Pr(b,o,d,p,m){const y=c.H();return o?(c.K(y,y,[1/m,1/m,1]),d||c.ae(y,y,p.angle)):c.L(y,p.labelPlaneMatrix,b),y}function Hn(b,o,d,p,m){if(o){const y=c.af(b);return c.K(y,y,[m,m,1]),d||c.ae(y,y,-p.angle),y}return p.glCoordMatrix}function ce(b,o,d){let p;d?(p=[b.x,b.y,d(b.x,b.y),1],c.ag(p,p,o)):(p=[b.x,b.y,0,1],function(y,E,I){const M=E[0],k=E[1];y[0]=I[0]*M+I[4]*k+I[12],y[1]=I[1]*M+I[5]*k+I[13],y[3]=I[3]*M+I[7]*k+I[15]}(p,p,o));const m=p[3];return{point:new c.P(p[0]/m,p[1]/m),signedDistanceFromCamera:m,isOccluded:!1}}function V(b,o){return .5+b/o*.5}function U(b,o){return b.x>=-o[0]&&b.x<=o[0]&&b.y>=-o[1]&&b.y<=o[1]}function Y(b,o,d,p,m,y,E,I,M,k,N,B,W,Z,ee){const le=p?b.textSizeData:b.iconSizeData,oe=c.ah(le,d.transform.zoom),ue=[256/d.width*2+1,256/d.height*2+1],_e=p?b.text.dynamicLayoutVertexArray:b.icon.dynamicLayoutVertexArray;_e.clear();const ne=b.lineVertexArray,we=p?b.text.placedSymbolArray:b.icon.placedSymbolArray,Pe=d.transform.width/d.transform.height;let ke=!1;for(let $e=0;$eMath.abs(d.x-o.x)*p?{useVertical:!0}:(b===c.ai.vertical?o.yd.x)?{needsFlipping:!0}:null}function Te(b,o,d,p,m,y,E,I,M,k,N){const B=d/24,W=o.lineOffsetX*B,Z=o.lineOffsetY*B;let ee;if(o.numGlyphs>1){const le=o.glyphStartIndex+o.numGlyphs,oe=o.lineStartIndex,ue=o.lineStartIndex+o.lineLength,_e=re(B,I,W,Z,p,o,N,b);if(!_e)return{notEnoughRoom:!0};const ne=ce(_e.first.point,E,b.getElevation).point,we=ce(_e.last.point,E,b.getElevation).point;if(m&&!p){const Pe=ye(o.writingMode,ne,we,k);if(Pe)return Pe}ee=[_e.first];for(let Pe=o.glyphStartIndex+1;Pe0?ne.point:function(ke,$e,et,pt,gt,tt){return Ce(ke,$e,et,1,gt,tt)}(b.tileAnchorPoint,_e,oe,0,y,b),Pe=ye(o.writingMode,oe,we,k);if(Pe)return Pe}const le=nt(B*I.getoffsetX(o.glyphStartIndex),W,Z,p,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,b,N);if(!le||b.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};ee=[le]}for(const le of ee)c.ak(M,le.point,le.angle);return{}}function Ce(b,o,d,p,m,y){const E=b.add(b.sub(o)._unit()),I=m!==void 0?ce(E,m,y.getElevation).point:ze(E.x,E.y,y).point,M=d.sub(I);return d.add(M._mult(p/M.mag()))}function fe(b,o,d){const p=o.projectionCache;if(p.projections[b])return p.projections[b];const m=new c.P(o.lineVertexArray.getx(b),o.lineVertexArray.gety(b)),y=ze(m.x,m.y,o);if(y.signedDistanceFromCamera>0)return p.projections[b]=y.point,p.anyProjectionOccluded=p.anyProjectionOccluded||y.isOccluded,y.point;const E=b-d.direction;return function(I,M,k,N,B){return Ce(I,M,k,N,void 0,B)}(d.distanceFromAnchor===0?o.tileAnchorPoint:new c.P(o.lineVertexArray.getx(E),o.lineVertexArray.gety(E)),m,d.previousVertex,d.absOffsetX-d.distanceFromAnchor+1,o)}function ze(b,o,d){const p=b+d.translation[0],m=o+d.translation[1];let y;return!d.pitchWithMap&&d.projection.useSpecialProjectionForSymbols?(y=d.projection.projectTileCoordinates(p,m,d.unwrappedTileID,d.getElevation),y.point.x=(.5*y.point.x+.5)*d.width,y.point.y=(.5*-y.point.y+.5)*d.height):(y=ce(new c.P(p,m),d.labelPlaneMatrix,d.getElevation),y.isOccluded=!1),y}function We(b,o,d){return b._unit()._perp()._mult(o*d)}function Oe(b,o,d,p,m,y,E,I,M){if(I.projectionCache.offsets[b])return I.projectionCache.offsets[b];const k=d.add(o);if(b+M.direction=m)return I.projectionCache.offsets[b]=k,k;const N=fe(b+M.direction,I,M),B=We(N.sub(d),E,M.direction),W=d.add(B),Z=N.add(B);return I.projectionCache.offsets[b]=c.al(y,k,W,Z)||k,I.projectionCache.offsets[b]}function nt(b,o,d,p,m,y,E,I,M){const k=p?b-o:b+o;let N=k>0?1:-1,B=0;p&&(N*=-1,B=Math.PI),N<0&&(B+=Math.PI);let W,Z=N>0?y+m:y+m+1;I.projectionCache.cachedAnchorPoint?W=I.projectionCache.cachedAnchorPoint:(W=ze(I.tileAnchorPoint.x,I.tileAnchorPoint.y,I).point,I.projectionCache.cachedAnchorPoint=W);let ee,le,oe=W,ue=W,_e=0,ne=0;const we=Math.abs(k),Pe=[];let ke;for(;_e+ne<=we;){if(Z+=N,Z=E)return null;_e+=ne,ue=oe,le=ee;const pt={absOffsetX:we,direction:N,distanceFromAnchor:_e,previousVertex:ue};if(oe=fe(Z,I,pt),d===0)Pe.push(ue),ke=oe.sub(ue);else{let gt;const tt=oe.sub(ue);gt=tt.mag()===0?We(fe(Z+N,I,pt).sub(oe),d,N):We(tt,d,N),le||(le=ue.add(gt)),ee=Oe(Z,gt,oe,y,E,le,d,I,pt),Pe.push(le),ke=ee.sub(le)}ne=ke.mag()}const $e=ke._mult((we-_e)/ne)._add(le||ue),et=B+Math.atan2(oe.y-ue.y,oe.x-ue.x);return Pe.push($e),{point:$e,angle:M?et:0,path:Pe}}const It=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Mt(b,o){for(let d=0;d=1;Qt--)ut.push(qt.path[Qt]);for(let Qt=1;Qtni.signedDistanceFromCamera<=0)?[]:Qt.map(ni=>ni.point)}let Ui=[];if(ut.length>0){const Qt=ut[0].clone(),ni=ut[0].clone();for(let Vi=1;Vi=tt.x&&ni.x<=rt.x&&Qt.y>=tt.y&&ni.y<=rt.y?[ut]:ni.xrt.x||ni.yrt.y?[]:c.am([ut],tt.x,tt.y,rt.x,rt.y)}for(const Qt of Ui){Tt.reset(Qt,.25*gt);let ni=0;ni=Tt.length<=.5*gt?1:Math.ceil(Tt.paddedLength/zt)+1;for(let Vi=0;Vice(m,p,d.getElevation))}queryRenderedSymbols(o){if(o.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const d=[];let p=1/0,m=1/0,y=-1/0,E=-1/0;for(const N of o){const B=new c.P(N.x+Xt,N.y+Xt);p=Math.min(p,B.x),m=Math.min(m,B.y),y=Math.max(y,B.x),E=Math.max(E,B.y),d.push(B)}const I=this.grid.query(p,m,y,E).concat(this.ignoredGrid.query(p,m,y,E)),M={},k={};for(const N of I){const B=N.key;if(M[B.bucketInstanceId]===void 0&&(M[B.bucketInstanceId]={}),M[B.bucketInstanceId][B.featureIndex])continue;const W=[new c.P(N.x1,N.y1),new c.P(N.x2,N.y1),new c.P(N.x2,N.y2),new c.P(N.x1,N.y2)];c.an(d,W)&&(M[B.bucketInstanceId][B.featureIndex]=!0,k[B.bucketInstanceId]===void 0&&(k[B.bucketInstanceId]=[]),k[B.bucketInstanceId].push(B.featureIndex))}return k}insertCollisionBox(o,d,p,m,y,E){(p?this.ignoredGrid:this.grid).insert({bucketInstanceId:m,featureIndex:y,collisionGroupID:E,overlapMode:d},o[0],o[1],o[2],o[3])}insertCollisionCircles(o,d,p,m,y,E){const I=p?this.ignoredGrid:this.grid,M={bucketInstanceId:m,featureIndex:y,collisionGroupID:E,overlapMode:d};for(let k=0;k=this.screenRightBoundary||mthis.screenBottomBoundary}isInsideGrid(o,d,p,m){return p>=0&&o=0&&dthis.projectAndGetPerspectiveRatio(p,tt.x,tt.y,m,k));pt=gt.some(tt=>!tt.isOccluded),et=gt.map(tt=>tt.point)}else pt=!0;return{box:c.ap(et),allPointsOccluded:!pt}}}function Ht(b,o,d){return o*(c.X/(b.tileSize*Math.pow(2,d-b.tileID.overscaledZ)))}class xi{constructor(o,d,p,m){this.opacity=o?Math.max(0,Math.min(1,o.opacity+(o.placed?d:-d))):m&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class Ni{constructor(o,d,p,m,y){this.text=new xi(o?o.text:null,d,p,y),this.icon=new xi(o?o.icon:null,d,m,y)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class es{constructor(o,d,p){this.text=o,this.icon=d,this.skipFade=p}}class Zt{constructor(){this.invProjMatrix=c.H(),this.viewportMatrix=c.H(),this.circles=[]}}class li{constructor(o,d,p,m,y){this.bucketInstanceId=o,this.featureIndex=d,this.sourceLayerIndex=p,this.bucketIndex=m,this.tileID=y}}class _i{constructor(o){this.crossSourceCollisions=o,this.maxGroupID=0,this.collisionGroups={}}get(o){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[o]){const d=++this.maxGroupID;this.collisionGroups[o]={ID:d,predicate:p=>p.collisionGroupID===d}}return this.collisionGroups[o]}}function ts(b,o,d,p,m){const{horizontalAlign:y,verticalAlign:E}=c.av(b);return new c.P(-(y-.5)*o+p[0]*m,-(E-.5)*d+p[1]*m)}class vs{constructor(o,d,p,m,y,E){this.transform=o.clone(),this.terrain=p,this.collisionIndex=new oi(this.transform,d),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new _i(y),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=E,E&&(E.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(o){const d=this.terrain;return d?(p,m)=>d.getElevation(o,p,m):null}getBucketParts(o,d,p,m){const y=p.getBucket(d),E=p.latestFeatureIndex;if(!y||!E||d.id!==y.layerIds[0])return;const I=p.collisionBoxArray,M=y.layers[0].layout,k=y.layers[0].paint,N=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),B=p.tileSize/c.X,W=p.tileID.toUnwrapped(),Z=this.transform.calculatePosMatrix(W),ee=M.get("text-pitch-alignment")==="map",le=M.get("text-rotation-alignment")==="map",oe=Ht(p,1,this.transform.zoom),ue=this.collisionIndex.mapProjection.translatePosition(this.transform,p,k.get("text-translate"),k.get("text-translate-anchor")),_e=this.collisionIndex.mapProjection.translatePosition(this.transform,p,k.get("icon-translate"),k.get("icon-translate-anchor")),ne=Pr(Z,ee,le,this.transform,oe);let we=null;if(ee){const ke=Hn(Z,ee,le,this.transform,oe);we=c.L([],this.transform.labelPlaneMatrix,ke)}this.retainedQueryData[y.bucketInstanceId]=new li(y.bucketInstanceId,E,y.sourceLayerIndex,y.index,p.tileID);const Pe={bucket:y,layout:M,translationText:ue,translationIcon:_e,posMatrix:Z,unwrappedTileID:W,textLabelPlaneMatrix:ne,labelToScreenMatrix:we,scale:N,textPixelRatio:B,holdingForFade:p.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:c.ah(y.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(y.sourceID)};if(m)for(const ke of y.sortKeyRanges){const{sortKey:$e,symbolInstanceStart:et,symbolInstanceEnd:pt}=ke;o.push({sortKey:$e,symbolInstanceStart:et,symbolInstanceEnd:pt,parameters:Pe})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:y.symbolInstances.length,parameters:Pe})}attemptAnchorPlacement(o,d,p,m,y,E,I,M,k,N,B,W,Z,ee,le,oe,ue,_e,ne){const we=c.ar[o.textAnchor],Pe=[o.textOffset0,o.textOffset1],ke=ts(we,p,m,Pe,y),$e=this.collisionIndex.placeCollisionBox(d,W,M,k,N,I,E,oe,B.predicate,ne,ke);if((!_e||this.collisionIndex.placeCollisionBox(_e,W,M,k,N,I,E,ue,B.predicate,ne,ke).placeable)&&$e.placeable){let et;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(et=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:Pe,width:p,height:m,anchor:we,textBoxScale:y,prevAnchor:et},this.markUsedJustification(ee,we,Z,le),ee.allowVerticalPlacement&&(this.markUsedOrientation(ee,le,Z),this.placedOrientations[Z.crossTileID]=le),{shift:ke,placedGlyphBoxes:$e}}}placeLayerBucketPart(o,d,p){const{bucket:m,layout:y,translationText:E,translationIcon:I,posMatrix:M,unwrappedTileID:k,textLabelPlaneMatrix:N,labelToScreenMatrix:B,textPixelRatio:W,holdingForFade:Z,collisionBoxArray:ee,partiallyEvaluatedTextSize:le,collisionGroup:oe}=o.parameters,ue=y.get("text-optional"),_e=y.get("icon-optional"),ne=c.as(y,"text-overlap","text-allow-overlap"),we=ne==="always",Pe=c.as(y,"icon-overlap","icon-allow-overlap"),ke=Pe==="always",$e=y.get("text-rotation-alignment")==="map",et=y.get("text-pitch-alignment")==="map",pt=y.get("icon-text-fit")!=="none",gt=y.get("symbol-z-order")==="viewport-y",tt=we&&(ke||!m.hasIconData()||_e),rt=ke&&(we||!m.hasTextData()||ue);!m.collisionArrays&&ee&&m.deserializeCollisionBoxes(ee);const Tt=this._getTerrainElevationFunc(this.retainedQueryData[m.bucketInstanceId].tileID),qt=(at,ut,zt)=>{var Ui,Qt;if(d[at.crossTileID])return;if(Z)return void(this.placements[at.crossTileID]=new es(!1,!1,!1));let ni=!1,Vi=!1,en=!0,Or=null,ji={box:null,placeable:!1,offscreen:null},Pn={box:null,placeable:!1,offscreen:null},gn=null,tn=null,sn=null,Dr=0,Na=0,fh=0;ut.textFeatureIndex?Dr=ut.textFeatureIndex:at.useRuntimeCollisionCircles&&(Dr=at.featureIndex),ut.verticalTextFeatureIndex&&(Na=ut.verticalTextFeatureIndex);const gl=ut.textBox;if(gl){const Xs=nn=>{let rn=c.ai.horizontal;if(m.allowVerticalPlacement&&!nn&&this.prevPlacement){const zs=this.prevPlacement.placedOrientations[at.crossTileID];zs&&(this.placedOrientations[at.crossTileID]=zs,rn=zs,this.markUsedOrientation(m,rn,at))}return rn},Fr=(nn,rn)=>{if(m.allowVerticalPlacement&&at.numVerticalGlyphVertices>0&&ut.verticalTextBox){for(const zs of m.writingModes)if(zs===c.ai.vertical?(ji=rn(),Pn=ji):ji=nn(),ji&&ji.placeable)break}else ji=nn()},Vo=at.textAnchorOffsetStartIndex,_l=at.textAnchorOffsetEndIndex;if(_l===Vo){const nn=(rn,zs)=>{const ss=this.collisionIndex.placeCollisionBox(rn,ne,W,M,k,et,$e,E,oe.predicate,Tt);return ss&&ss.placeable&&(this.markUsedOrientation(m,zs,at),this.placedOrientations[at.crossTileID]=zs),ss};Fr(()=>nn(gl,c.ai.horizontal),()=>{const rn=ut.verticalTextBox;return m.allowVerticalPlacement&&at.numVerticalGlyphVertices>0&&rn?nn(rn,c.ai.vertical):{box:null,offscreen:null}}),Xs(ji&&ji.placeable)}else{let nn=c.ar[(Qt=(Ui=this.prevPlacement)===null||Ui===void 0?void 0:Ui.variableOffsets[at.crossTileID])===null||Qt===void 0?void 0:Qt.anchor];const rn=(ss,yl,Xf)=>{const Rs=ss.x2-ss.x1,kg=ss.y2-ss.y1,mh=at.textBoxScale,gh=pt&&Pe==="never"?yl:null;let jo=null,Og=ne==="never"?1:2,Zf="never";nn&&Og++;for(let Kf=0;Kfrn(gl,ut.iconBox,c.ai.horizontal),()=>{const ss=ut.verticalTextBox;return m.allowVerticalPlacement&&(!ji||!ji.placeable)&&at.numVerticalGlyphVertices>0&&ss?rn(ss,ut.verticalIconBox,c.ai.vertical):{box:null,occluded:!0,offscreen:null}}),ji&&(ni=ji.placeable,en=ji.offscreen);const zs=Xs(ji&&ji.placeable);if(!ni&&this.prevPlacement){const ss=this.prevPlacement.variableOffsets[at.crossTileID];ss&&(this.variableOffsets[at.crossTileID]=ss,this.markUsedJustification(m,ss.anchor,at,zs))}}}if(gn=ji,ni=gn&&gn.placeable,en=gn&&gn.offscreen,at.useRuntimeCollisionCircles){const Xs=m.text.placedSymbolArray.get(at.centerJustifiedTextSymbolIndex),Fr=c.aj(m.textSizeData,le,Xs),Vo=y.get("text-padding");tn=this.collisionIndex.placeCollisionCircles(ne,Xs,m.lineVertexArray,m.glyphOffsetArray,Fr,M,k,N,B,p,et,oe.predicate,at.collisionCircleDiameter,Vo,E,Tt),tn.circles.length&&tn.collisionDetected&&!p&&c.w("Collisions detected, but collision boxes are not shown"),ni=we||tn.circles.length>0&&!tn.collisionDetected,en=en&&tn.offscreen}if(ut.iconFeatureIndex&&(fh=ut.iconFeatureIndex),ut.iconBox){const Xs=Fr=>this.collisionIndex.placeCollisionBox(Fr,Pe,W,M,k,et,$e,I,oe.predicate,Tt,pt&&Or?Or:void 0);Pn&&Pn.placeable&&ut.verticalIconBox?(sn=Xs(ut.verticalIconBox),Vi=sn.placeable):(sn=Xs(ut.iconBox),Vi=sn.placeable),en=en&&sn.offscreen}const Ba=ue||at.numHorizontalGlyphVertices===0&&at.numVerticalGlyphVertices===0,ph=_e||at.numIconVertices===0;Ba||ph?ph?Ba||(Vi=Vi&&ni):ni=Vi&&ni:Vi=ni=Vi&∋const qf=Vi&&sn.placeable;if(ni&&gn.placeable&&this.collisionIndex.insertCollisionBox(gn.box,ne,y.get("text-ignore-placement"),m.bucketInstanceId,Pn&&Pn.placeable&&Na?Na:Dr,oe.ID),qf&&this.collisionIndex.insertCollisionBox(sn.box,Pe,y.get("icon-ignore-placement"),m.bucketInstanceId,fh,oe.ID),tn&&ni&&this.collisionIndex.insertCollisionCircles(tn.circles,ne,y.get("text-ignore-placement"),m.bucketInstanceId,Dr,oe.ID),p&&this.storeCollisionData(m.bucketInstanceId,zt,ut,gn,sn,tn),at.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(m.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[at.crossTileID]=new es(ni||tt,Vi||rt,en||m.justReloaded),d[at.crossTileID]=!0};if(gt){if(o.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const at=m.getSortedSymbolIndexes(this.transform.angle);for(let ut=at.length-1;ut>=0;--ut){const zt=at[ut];qt(m.symbolInstances.get(zt),m.collisionArrays[zt],zt)}}else for(let at=o.symbolInstanceStart;at=0&&(o.text.placedSymbolArray.get(I).crossTileID=y>=0&&I!==y?0:p.crossTileID)}markUsedOrientation(o,d,p){const m=d===c.ai.horizontal||d===c.ai.horizontalOnly?d:0,y=d===c.ai.vertical?d:0,E=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(const I of E)o.text.placedSymbolArray.get(I).placedOrientation=m;p.verticalPlacedTextSymbolIndex&&(o.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=y)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const d=this.prevPlacement;let p=!1;this.prevZoomAdjustment=d?d.zoomAdjustment(this.transform.zoom):0;const m=d?d.symbolFadeChange(o):1,y=d?d.opacities:{},E=d?d.variableOffsets:{},I=d?d.placedOrientations:{};for(const M in this.placements){const k=this.placements[M],N=y[M];N?(this.opacities[M]=new Ni(N,m,k.text,k.icon),p=p||k.text!==N.text.placed||k.icon!==N.icon.placed):(this.opacities[M]=new Ni(null,m,k.text,k.icon,k.skipFade),p=p||k.text||k.icon)}for(const M in y){const k=y[M];if(!this.opacities[M]){const N=new Ni(k,m,!1,!1);N.isHidden()||(this.opacities[M]=N,p=p||k.text.placed||k.icon.placed)}}for(const M in E)this.variableOffsets[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.variableOffsets[M]=E[M]);for(const M in I)this.placedOrientations[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.placedOrientations[M]=I[M]);if(d&&d.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=d?d.lastPlacementChangeTime:o)}updateLayerOpacities(o,d){const p={};for(const m of d){const y=m.getBucket(o);y&&m.latestFeatureIndex&&o.id===y.layerIds[0]&&this.updateBucketOpacities(y,m.tileID,p,m.collisionBoxArray)}}updateBucketOpacities(o,d,p,m){o.hasTextData()&&(o.text.opacityVertexArray.clear(),o.text.hasVisibleVertices=!1),o.hasIconData()&&(o.icon.opacityVertexArray.clear(),o.icon.hasVisibleVertices=!1),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const y=o.layers[0],E=y.layout,I=new Ni(null,0,!1,!1,!0),M=E.get("text-allow-overlap"),k=E.get("icon-allow-overlap"),N=y._unevaluatedLayout.hasValue("text-variable-anchor")||y._unevaluatedLayout.hasValue("text-variable-anchor-offset"),B=E.get("text-rotation-alignment")==="map",W=E.get("text-pitch-alignment")==="map",Z=E.get("icon-text-fit")!=="none",ee=new Ni(null,0,M&&(k||!o.hasIconData()||E.get("icon-optional")),k&&(M||!o.hasTextData()||E.get("text-optional")),!0);!o.collisionArrays&&m&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(m);const le=(ue,_e,ne)=>{for(let we=0;we<_e/4;we++)ue.opacityVertexArray.emplaceBack(ne);ue.hasVisibleVertices=ue.hasVisibleVertices||ne!==Bi},oe=this.collisionBoxArrays.get(o.bucketInstanceId);for(let ue=0;ue0,et=this.placedOrientations[_e.crossTileID],pt=et===c.ai.vertical,gt=et===c.ai.horizontal||et===c.ai.horizontalOnly;if(ne>0||we>0){const rt=is(ke.text);le(o.text,ne,pt?Bi:rt),le(o.text,we,gt?Bi:rt);const Tt=ke.text.isHidden();[_e.rightJustifiedTextSymbolIndex,_e.centerJustifiedTextSymbolIndex,_e.leftJustifiedTextSymbolIndex].forEach(ut=>{ut>=0&&(o.text.placedSymbolArray.get(ut).hidden=Tt||pt?1:0)}),_e.verticalPlacedTextSymbolIndex>=0&&(o.text.placedSymbolArray.get(_e.verticalPlacedTextSymbolIndex).hidden=Tt||gt?1:0);const qt=this.variableOffsets[_e.crossTileID];qt&&this.markUsedJustification(o,qt.anchor,_e,et);const at=this.placedOrientations[_e.crossTileID];at&&(this.markUsedJustification(o,"left",_e,at),this.markUsedOrientation(o,at,_e))}if($e){const rt=is(ke.icon),Tt=!(Z&&_e.verticalPlacedIconSymbolIndex&&pt);_e.placedIconSymbolIndex>=0&&(le(o.icon,_e.numIconVertices,Tt?rt:Bi),o.icon.placedSymbolArray.get(_e.placedIconSymbolIndex).hidden=ke.icon.isHidden()),_e.verticalPlacedIconSymbolIndex>=0&&(le(o.icon,_e.numVerticalIconVertices,Tt?Bi:rt),o.icon.placedSymbolArray.get(_e.verticalPlacedIconSymbolIndex).hidden=ke.icon.isHidden())}const tt=oe&&oe.has(ue)?oe.get(ue):{text:null,icon:null};if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const rt=o.collisionArrays[ue];if(rt){let Tt=new c.P(0,0);if(rt.textBox||rt.verticalTextBox){let qt=!0;if(N){const at=this.variableOffsets[Pe];at?(Tt=ts(at.anchor,at.width,at.height,at.textOffset,at.textBoxScale),B&&Tt._rotate(W?this.transform.angle:-this.transform.angle)):qt=!1}if(rt.textBox||rt.verticalTextBox){let at;rt.textBox&&(at=pt),rt.verticalTextBox&&(at=gt),Ls(o.textCollisionBox.collisionVertexArray,ke.text.placed,!qt||at,tt.text,Tt.x,Tt.y)}}if(rt.iconBox||rt.verticalIconBox){const qt=!!(!gt&&rt.verticalIconBox);let at;rt.iconBox&&(at=qt),rt.verticalIconBox&&(at=!qt),Ls(o.iconCollisionBox.collisionVertexArray,ke.icon.placed,at,tt.icon,Z?Tt.x:0,Z?Tt.y:0)}}}}if(o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.text.opacityVertexArray.length!==o.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${o.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${o.text.layoutVertexArray.length}) / 4`);if(o.icon.opacityVertexArray.length!==o.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${o.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${o.icon.layoutVertexArray.length}) / 4`);if(o.bucketInstanceId in this.collisionCircleArrays){const ue=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=ue.invProjMatrix,o.placementViewportMatrix=ue.viewportMatrix,o.collisionCircleArray=ue.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function Ls(b,o,d,p,m,y){p&&p.length!==0||(p=[0,0,0,0]);const E=p[0]-Xt,I=p[1]-Xt,M=p[2]-Xt,k=p[3]-Xt;b.emplaceBack(o?1:0,d?1:0,m||0,y||0,E,I),b.emplaceBack(o?1:0,d?1:0,m||0,y||0,M,I),b.emplaceBack(o?1:0,d?1:0,m||0,y||0,M,k),b.emplaceBack(o?1:0,d?1:0,m||0,y||0,E,k)}const xa=Math.pow(2,25),ui=Math.pow(2,24),Gs=Math.pow(2,17),Gr=Math.pow(2,16),ds=Math.pow(2,9),ls=Math.pow(2,8),wa=Math.pow(2,1);function is(b){if(b.opacity===0&&!b.placed)return 0;if(b.opacity===1&&b.placed)return 4294967295;const o=b.placed?1:0,d=Math.floor(127*b.opacity);return d*xa+o*ui+d*Gs+o*Gr+d*ds+o*ls+d*wa+o}const Bi=0;function Ta(){return{isOccluded:(b,o,d)=>!1,getPitchedTextCorrection:(b,o,d)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(b,o,d,p){throw new Error("Not implemented.")},translatePosition:(b,o,d,p)=>function(m,y,E,I,M=!1){if(!E[0]&&!E[1])return[0,0];const k=M?I==="map"?m.angle:0:I==="viewport"?-m.angle:0;if(k){const N=Math.sin(k),B=Math.cos(k);E=[E[0]*B-E[1]*N,E[0]*N+E[1]*B]}return[M?E[0]:Ht(y,E[0],m.zoom),M?E[1]:Ht(y,E[1],m.zoom)]}(b,o,d,p),getCircleRadiusCorrection:b=>1}}class No{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&!o.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(o,d,p,m,y){const E=this._bucketParts;for(;this._currentTileIndexI.sortKey-M.sortKey));this._currentPartIndex!this._forceFullPlacement&&C.now()-m>2;for(;this._currentPlacementIndex>=0;){const E=d[o[this._currentPlacementIndex]],I=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=I)&&(!E.maxzoom||E.maxzoom>I)){if(this._inProgressLayer||(this._inProgressLayer=new No(E)),this._inProgressLayer.continuePlacement(p[E.source],this.placement,this._showCollisionBoxes,E,y))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const _s=512/c.X/2;class ur{constructor(o,d,p){this.tileID=o,this.bucketInstanceId=p,this._symbolsByKey={};const m=new Map;for(let y=0;y({x:Math.floor(M.anchorX*_s),y:Math.floor(M.anchorY*_s)})),crossTileIDs:E.map(M=>M.crossTileID)};if(I.positions.length>128){const M=new c.aw(I.positions.length,16,Uint16Array);for(const{x:k,y:N}of I.positions)M.add(k,N);M.finish(),delete I.positions,I.index=M}this._symbolsByKey[y]=I}}getScaledCoordinates(o,d){const{x:p,y:m,z:y}=this.tileID.canonical,{x:E,y:I,z:M}=d.canonical,k=_s/Math.pow(2,M-y),N=(I*c.X+o.anchorY)*k,B=m*c.X*_s;return{x:Math.floor((E*c.X+o.anchorX)*k-p*c.X*_s),y:Math.floor(N-B)}}findMatches(o,d,p){const m=this.tileID.canonical.zo)}}class Yi{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Bo{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(o){const d=Math.round((o-this.lng)/360);if(d!==0)for(const p in this.indexes){const m=this.indexes[p],y={};for(const E in m){const I=m[E];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+d),y[I.tileID.key]=I}this.indexes[p]=y}this.lng=o}addBucket(o,d,p){if(this.indexes[o.overscaledZ]&&this.indexes[o.overscaledZ][o.key]){if(this.indexes[o.overscaledZ][o.key].bucketInstanceId===d.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(o.overscaledZ,this.indexes[o.overscaledZ][o.key])}for(let y=0;yo.overscaledZ)for(const I in E){const M=E[I];M.tileID.isChildOf(o)&&M.findMatches(d.symbolInstances,o,m)}else{const I=E[o.scaledTo(Number(y)).key];I&&I.findMatches(d.symbolInstances,o,m)}}for(let y=0;y{d[p]=!0});for(const p in this.layerIndexes)d[p]||delete this.layerIndexes[p]}}const bo=(b,o)=>c.t(b,o&&o.filter(d=>d.identifier!=="source.canvas")),qn=c.ax();class hr extends c.E{constructor(o,d={}){super(),this._rtlPluginLoaded=()=>{for(const p in this.sourceCaches){const m=this.sourceCaches[p].getSource().type;m!=="vector"&&m!=="geojson"||this.sourceCaches[p].reload()}},this.map=o,this.dispatcher=new Ii(gi(),o._getMapId()),this.dispatcher.registerMessageHandler("GG",(p,m)=>this.getGlyphs(p,m)),this.dispatcher.registerMessageHandler("GI",(p,m)=>this.getImages(p,m)),this.imageManager=new dt,this.imageManager.setEventedParent(this),this.glyphManager=new kt(o._requestManager,d.localIdeographFontFamily),this.lineAtlas=new Hs(256,512),this.crossTileSymbolIndex=new Qs,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",c.az()),Mi().on(je,this._rtlPluginLoaded),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const m=this.sourceCaches[p.sourceId];if(!m)return;const y=m.getSource();if(y&&y.vectorLayerIds)for(const E in this._layers){const I=this._layers[E];I.source===y.id&&this._validateLayer(I)}})}loadURL(o,d={},p){this.fire(new c.k("dataloading",{dataType:"style"})),d.validate=typeof d.validate!="boolean"||d.validate;const m=this.map._requestManager.transformRequest(o,"Style");this._loadStyleRequest=new AbortController;const y=this._loadStyleRequest;c.h(m,this._loadStyleRequest).then(E=>{this._loadStyleRequest=null,this._load(E.data,d,p)}).catch(E=>{this._loadStyleRequest=null,E&&!y.signal.aborted&&this.fire(new c.j(E))})}loadJSON(o,d={},p){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,C.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,d.validate=d.validate!==!1,this._load(o,d,p)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(qn,{validate:!1})}_load(o,d,p){var m;const y=d.transformStyle?d.transformStyle(p,o):o;if(!d.validate||!bo(this,c.x(y))){this._loaded=!0,this.stylesheet=y;for(const E in y.sources)this.addSource(E,y.sources[E],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new Jt(this.stylesheet.light),this.sky=new mi(this.stylesheet.sky),this.map.setTerrain((m=this.stylesheet.terrain)!==null&&m!==void 0?m:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const o=c.aA(this.stylesheet.layers);this.dispatcher.broadcast("SL",o),this._order=o.map(d=>d.id),this._layers={},this._serializedLayers=null;for(const d of o){const p=c.aB(d);p.setEventedParent(this,{layer:{id:d.id}}),this._layers[d.id]=p}}_loadSprite(o,d=!1,p=void 0){let m;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(y,E,I,M){return c._(this,void 0,void 0,function*(){const k=Be(y),N=I>1?"@2x":"",B={},W={};for(const{id:Z,url:ee}of k){const le=E.transformRequest(Qe(ee,N,".json"),"SpriteJSON");B[Z]=c.h(le,M);const oe=E.transformRequest(Qe(ee,N,".png"),"SpriteImage");W[Z]=se.getImage(oe,M)}return yield Promise.all([...Object.values(B),...Object.values(W)]),function(Z,ee){return c._(this,void 0,void 0,function*(){const le={};for(const oe in Z){le[oe]={};const ue=C.getImageCanvasContext((yield ee[oe]).data),_e=(yield Z[oe]).data;for(const ne in _e){const{width:we,height:Pe,x:ke,y:$e,sdf:et,pixelRatio:pt,stretchX:gt,stretchY:tt,content:rt,textFitWidth:Tt,textFitHeight:qt}=_e[ne];le[oe][ne]={data:null,pixelRatio:pt,sdf:et,stretchX:gt,stretchY:tt,content:rt,textFitWidth:Tt,textFitHeight:qt,spriteData:{width:we,height:Pe,x:ke,y:$e,context:ue}}}}return le})}(B,W)})}(o,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(y=>{if(this._spriteRequest=null,y)for(const E in y){this._spritesImagesIds[E]=[];const I=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(M=>!(M in y)):[];for(const M of I)this.imageManager.removeImage(M),this._changedImages[M]=!0;for(const M in y[E]){const k=E==="default"?M:`${E}:${M}`;this._spritesImagesIds[E].push(k),k in this.imageManager.images?this.imageManager.updateImage(k,y[E][M],!1):this.imageManager.addImage(k,y[E][M]),d&&(this._changedImages[k]=!0)}}}).catch(y=>{this._spriteRequest=null,m=y,this.fire(new c.j(m))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),d&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),p&&p(m)})}_unloadSprite(){for(const o of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(o),this._changedImages[o]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(o){const d=this.sourceCaches[o.source];if(!d)return;const p=o.sourceLayer;if(!p)return;const m=d.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(p)===-1)&&this.fire(new c.j(new Error(`Source layer "${p}" does not exist on source "${m.id}" as specified by style layer "${o.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this.sourceCaches)if(!this.sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(o){const d=this._serializedAllLayers();if(!o||o.length===0)return Object.values(d);const p=[];for(const m of o)d[m]&&p.push(d[m]);return p}_serializedAllLayers(){let o=this._serializedLayers;if(o)return o;o=this._serializedLayers={};const d=Object.keys(this._layers);for(const p of d){const m=this._layers[p];m.type!=="custom"&&(o[p]=m.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const o in this.sourceCaches)if(this.sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(o){if(!this._loaded)return;const d=this._changed;if(d){const m=Object.keys(this._updatedLayers),y=Object.keys(this._removedLayers);(m.length||y.length)&&this._updateWorkerLayers(m,y);for(const E in this._updatedSources){const I=this._updatedSources[E];if(I==="reload")this._reloadSource(E);else{if(I!=="clear")throw new Error(`Invalid action ${I}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(o);this.light.updateTransitions(o),this.sky.updateTransitions(o),this._resetUpdates()}const p={};for(const m in this.sourceCaches){const y=this.sourceCaches[m];p[m]=y.used,y.used=!1}for(const m of this._order){const y=this._layers[m];y.recalculate(o,this._availableImages),!y.isHidden(o.zoom)&&y.source&&(this.sourceCaches[y.source].used=!0)}for(const m in p){const y=this.sourceCaches[m];!!p[m]!=!!y.used&&y.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(o),this.sky.recalculate(o),this.z=o.zoom,d&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const d in this.sourceCaches)this.sourceCaches[d].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const o in this.sourceCaches)this.sourceCaches[o].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(o,d){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(o),removedIds:d})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(o,d={}){var p;this._checkLoaded();const m=this.serialize();if(o=d.transformStyle?d.transformStyle(m,o):o,((p=d.validate)===null||p===void 0||p)&&bo(this,c.x(o)))return!1;(o=c.aC(o)).layers=c.aA(o.layers);const y=c.aD(m,o),E=this._getOperationsToPerform(y);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const I of E.operations)I();return this.stylesheet=o,this._serializedLayers=null,!0}_getOperationsToPerform(o){const d=[],p=[];for(const m of o)switch(m.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":d.push(()=>this.addLayer.apply(this,m.args));break;case"removeLayer":d.push(()=>this.removeLayer.apply(this,m.args));break;case"setPaintProperty":d.push(()=>this.setPaintProperty.apply(this,m.args));break;case"setLayoutProperty":d.push(()=>this.setLayoutProperty.apply(this,m.args));break;case"setFilter":d.push(()=>this.setFilter.apply(this,m.args));break;case"addSource":d.push(()=>this.addSource.apply(this,m.args));break;case"removeSource":d.push(()=>this.removeSource.apply(this,m.args));break;case"setLayerZoomRange":d.push(()=>this.setLayerZoomRange.apply(this,m.args));break;case"setLight":d.push(()=>this.setLight.apply(this,m.args));break;case"setGeoJSONSourceData":d.push(()=>this.setGeoJSONSourceData.apply(this,m.args));break;case"setGlyphs":d.push(()=>this.setGlyphs.apply(this,m.args));break;case"setSprite":d.push(()=>this.setSprite.apply(this,m.args));break;case"setSky":d.push(()=>this.setSky.apply(this,m.args));break;case"setTerrain":d.push(()=>this.map.setTerrain.apply(this,m.args));break;case"setTransition":d.push(()=>{});break;default:p.push(m.command)}return{operations:d,unimplemented:p}}addImage(o,d){if(this.getImage(o))return this.fire(new c.j(new Error(`An image named "${o}" already exists.`)));this.imageManager.addImage(o,d),this._afterImageUpdated(o)}updateImage(o,d){this.imageManager.updateImage(o,d)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){if(!this.getImage(o))return this.fire(new c.j(new Error(`An image named "${o}" does not exist.`)));this.imageManager.removeImage(o),this._afterImageUpdated(o)}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(o,d,p={}){if(this._checkLoaded(),this.sourceCaches[o]!==void 0)throw new Error(`Source "${o}" already exists.`);if(!d.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(d).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(d.type)>=0&&this._validate(c.x.source,`sources.${o}`,d,null,p))return;this.map&&this.map._collectResourceTiming&&(d.collectResourceTiming=!0);const m=this.sourceCaches[o]=new Ot(o,d,this.dispatcher);m.style=this,m.setEventedParent(this,()=>({isSourceLoaded:m.loaded(),source:m.serialize(),sourceId:o})),m.onAdd(this.map),this._changed=!0}removeSource(o){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===o)return this.fire(new c.j(new Error(`Source "${o}" cannot be removed while layer "${p}" is using it.`)));const d=this.sourceCaches[o];delete this.sourceCaches[o],delete this._updatedSources[o],d.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:o})),d.setEventedParent(null),d.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(o,d){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error(`There is no source with this ID=${o}`);const p=this.sourceCaches[o].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(d),this._changed=!0}getSource(o){return this.sourceCaches[o]&&this.sourceCaches[o].getSource()}addLayer(o,d,p={}){this._checkLoaded();const m=o.id;if(this.getLayer(m))return void this.fire(new c.j(new Error(`Layer "${m}" already exists on this map.`)));let y;if(o.type==="custom"){if(bo(this,c.aE(o)))return;y=c.aB(o)}else{if("source"in o&&typeof o.source=="object"&&(this.addSource(m,o.source),o=c.aC(o),o=c.e(o,{source:m})),this._validate(c.x.layer,`layers.${m}`,o,{arrayIndex:-1},p))return;y=c.aB(o),this._validateLayer(y),y.setEventedParent(this,{layer:{id:m}})}const E=d?this._order.indexOf(d):this._order.length;if(d&&E===-1)this.fire(new c.j(new Error(`Cannot add layer "${m}" before non-existing layer "${d}".`)));else{if(this._order.splice(E,0,m),this._layerOrderChanged=!0,this._layers[m]=y,this._removedLayers[m]&&y.source&&y.type!=="custom"){const I=this._removedLayers[m];delete this._removedLayers[m],I.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.onAdd(this.map)}}moveLayer(o,d){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new c.j(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===d)return;const p=this._order.indexOf(o);this._order.splice(p,1);const m=d?this._order.indexOf(d):this._order.length;d&&m===-1?this.fire(new c.j(new Error(`Cannot move layer "${o}" before non-existing layer "${d}".`))):(this._order.splice(m,0,o),this._layerOrderChanged=!0)}removeLayer(o){this._checkLoaded();const d=this._layers[o];if(!d)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${o}".`)));d.setEventedParent(null);const p=this._order.indexOf(o);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=d,delete this._layers[o],this._serializedLayers&&delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],d.onRemove&&d.onRemove(this.map)}getLayer(o){return this._layers[o]}getLayersOrder(){return[...this._order]}hasLayer(o){return o in this._layers}setLayerZoomRange(o,d,p){this._checkLoaded();const m=this.getLayer(o);m?m.minzoom===d&&m.maxzoom===p||(d!=null&&(m.minzoom=d),p!=null&&(m.maxzoom=p),this._updateLayer(m)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${o}".`)))}setFilter(o,d,p={}){this._checkLoaded();const m=this.getLayer(o);if(m){if(!c.aF(m.filter,d))return d==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(c.x.filter,`layers.${m.id}.filter`,d,null,p)||(m.filter=c.aC(d),this._updateLayer(m)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${o}".`)))}getFilter(o){return c.aC(this.getLayer(o).filter)}setLayoutProperty(o,d,p,m={}){this._checkLoaded();const y=this.getLayer(o);y?c.aF(y.getLayoutProperty(d),p)||(y.setLayoutProperty(d,p,m),this._updateLayer(y)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${o}".`)))}getLayoutProperty(o,d){const p=this.getLayer(o);if(p)return p.getLayoutProperty(d);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${o}".`)))}setPaintProperty(o,d,p,m={}){this._checkLoaded();const y=this.getLayer(o);y?c.aF(y.getPaintProperty(d),p)||(y.setPaintProperty(d,p,m)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[o]=!0,this._serializedLayers=null):this.fire(new c.j(new Error(`Cannot style non-existing layer "${o}".`)))}getPaintProperty(o,d){return this.getLayer(o).getPaintProperty(d)}setFeatureState(o,d){this._checkLoaded();const p=o.source,m=o.sourceLayer,y=this.sourceCaches[p];if(y===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const E=y.getSource().type;E==="geojson"&&m?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||m?(o.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),y.setFeatureState(m,o.id,d)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(o,d){this._checkLoaded();const p=o.source,m=this.sourceCaches[p];if(m===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const y=m.getSource().type,E=y==="vector"?o.sourceLayer:void 0;y!=="vector"||E?d&&typeof o.id!="string"&&typeof o.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(E,o.id,d):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(o){this._checkLoaded();const d=o.source,p=o.sourceLayer,m=this.sourceCaches[d];if(m!==void 0)return m.getSource().type!=="vector"||p?(o.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),m.getFeatureState(p,o.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${d}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const o=c.aG(this.sourceCaches,y=>y.serialize()),d=this._serializeByIds(this._order),p=this.map.getTerrain()||void 0,m=this.stylesheet;return c.aH({version:m.version,name:m.name,metadata:m.metadata,light:m.light,sky:m.sky,center:m.center,zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,sprite:m.sprite,glyphs:m.glyphs,transition:m.transition,sources:o,layers:d,terrain:p},y=>y!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0,o.source&&!this._updatedSources[o.source]&&this.sourceCaches[o.source].getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(o){const d=E=>this._layers[E].type==="fill-extrusion",p={},m=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(d(I)){p[I]=E;for(const M of o){const k=M[I];if(k)for(const N of k)m.push(N)}}}m.sort((E,I)=>I.intersectionZ-E.intersectionZ);const y=[];for(let E=this._order.length-1;E>=0;E--){const I=this._order[E];if(d(I))for(let M=m.length-1;M>=0;M--){const k=m[M].feature;if(p[k.layer.id]{const et=ue.featureSortOrder;if(et){const pt=et.indexOf(ke.featureIndex);return et.indexOf($e.featureIndex)-pt}return $e.featureIndex-ke.featureIndex});for(const ke of Pe)we.push(ke)}}for(const ue in ee)ee[ue].forEach(_e=>{const ne=_e.feature,we=k[I[ue].source].getFeatureState(ne.layer["source-layer"],ne.id);ne.source=ne.layer.source,ne.layer["source-layer"]&&(ne.sourceLayer=ne.layer["source-layer"]),ne.state=we});return ee}(this._layers,E,this.sourceCaches,o,d,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(y)}querySourceFeatures(o,d){d&&d.filter&&this._validate(c.x.filter,"querySourceFeatures.filter",d.filter,null,d);const p=this.sourceCaches[o];return p?function(m,y){const E=m.getRenderableIds().map(k=>m.getTileByID(k)),I=[],M={};for(let k=0;kW.getTileByID(Z)).sort((Z,ee)=>ee.tileID.overscaledZ-Z.tileID.overscaledZ||(Z.tileID.isLessThan(ee.tileID)?-1:1))}const B=this.crossTileSymbolIndex.addLayer(N,M[N.source],o.center.lng);E=E||B}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(C.now(),o.zoom))&&(this.pauseablePlacement=new Ki(o,this.map.terrain,this._order,y,d,p,m,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,M),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(C.now()),I=!0),E&&this.pauseablePlacement.placement.setStale()),I||E)for(const k of this._order){const N=this._layers[k];N.type==="symbol"&&this.placement.updateLayerOpacities(N,M[N.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(C.now())}_releaseSymbolFadeTiles(){for(const o in this.sourceCaches)this.sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,d){return c._(this,void 0,void 0,function*(){const p=yield this.imageManager.getImages(d.icons);this._updateTilesForChangedImages();const m=this.sourceCaches[d.source];return m&&m.setDependencies(d.tileID.key,d.type,d.icons),p})}getGlyphs(o,d){return c._(this,void 0,void 0,function*(){const p=yield this.glyphManager.getGlyphs(d.stacks),m=this.sourceCaches[d.source];return m&&m.setDependencies(d.tileID.key,d.type,[""]),p})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(o,d={}){this._checkLoaded(),o&&this._validate(c.x.glyphs,"glyphs",o,null,d)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=o,this.glyphManager.entries={},this.glyphManager.setURL(o))}addSprite(o,d,p={},m){this._checkLoaded();const y=[{id:o,url:d}],E=[...Be(this.stylesheet.sprite),...y];this._validate(c.x.sprite,"sprite",E,null,p)||(this.stylesheet.sprite=E,this._loadSprite(y,!0,m))}removeSprite(o){this._checkLoaded();const d=Be(this.stylesheet.sprite);if(d.find(p=>p.id===o)){if(this._spritesImagesIds[o])for(const p of this._spritesImagesIds[o])this.imageManager.removeImage(p),this._changedImages[p]=!0;d.splice(d.findIndex(p=>p.id===o),1),this.stylesheet.sprite=d.length>0?d:void 0,delete this._spritesImagesIds[o],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${o}" doesn't exists on this map.`)))}getSprite(){return Be(this.stylesheet.sprite)}setSprite(o,d={},p){this._checkLoaded(),o&&this._validate(c.x.sprite,"sprite",o,null,d)||(this.stylesheet.sprite=o,o?this._loadSprite(o,!0,p):(this._unloadSprite(),p&&p(null)))}}var Sa=c.Y([{name:"a_pos",type:"Int16",components:2}]);const Rr={prelude:ai(`#ifdef GL_ES + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + */(function(t,e){(function(i,s){t.exports=s()})(kH,function(){var i={},s={};function n(u,c,_){if(s[u]=_,u==="index"){var w="var sharedModule = {}; ("+s.shared+")(sharedModule); ("+s.worker+")(sharedModule);",S={};return s.shared(S),s.index(i,S),typeof window<"u"&&i.setWorkerUrl(window.URL.createObjectURL(new Blob([w],{type:"text/javascript"}))),i}}n("shared",["exports"],function(u){function c(l,o,h,d){return new(h||(h=Promise))(function(m,v){function x(R){try{I(d.next(R))}catch(k){v(k)}}function T(R){try{I(d.throw(R))}catch(k){v(k)}}function I(R){var k;R.done?m(R.value):(k=R.value,k instanceof h?k:new h(function(F){F(k)})).then(x,T)}I((d=d.apply(l,o||[])).next())})}function _(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}typeof SuppressedError=="function"&&SuppressedError;var w=S;function S(l,o){this.x=l,this.y=o}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,o){return this.clone()._rotateAround(l,o)},matMult:function(l){return this.clone()._matMult(l)},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(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var o=l.x-this.x,h=l.y-this.y;return o*o+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,o){return Math.atan2(this.x*o-this.y*l,this.x*l+this.y*o)},_matMult:function(l){var o=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=o,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var o=Math.cos(l),h=Math.sin(l),d=h*this.x+o*this.y;return this.x=o*this.x-h*this.y,this.y=d,this},_rotateAround:function(l,o){var h=Math.cos(l),d=Math.sin(l),m=o.y+d*(this.x-o.x)+h*(this.y-o.y);return this.x=o.x+h*(this.x-o.x)-d*(this.y-o.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},S.convert=function(l){return l instanceof S?l:Array.isArray(l)?new S(l[0],l[1]):l};var A=_(w),P=D;function D(l,o,h,d){this.cx=3*l,this.bx=3*(h-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(d-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=o,this.p2x=h,this.p2y=d}D.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,o){if(o===void 0&&(o=1e-6),l<0)return 0;if(l>1)return 1;for(var h=l,d=0;d<8;d++){var m=this.sampleCurveX(h)-l;if(Math.abs(m)m?x=h:T=h,h=.5*(T-x)+x;return h},solve:function(l,o){return this.sampleCurveY(this.solveCurveX(l,o))}};var U=_(P);let L,W;function ee(){return L==null&&(L=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),L}function G(){if(W==null&&(W=!1,ee())){const o=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(o){for(let d=0;d<5*5;d++){const m=4*d;o.fillStyle=`rgb(${m},${m+1},${m+2})`,o.fillRect(d%5,Math.floor(d/5),1,1)}const h=o.getImageData(0,0,5,5).data;for(let d=0;d<5*5*4;d++)if(d%4!=3&&h[d]!==d){W=!0;break}}}return W||!1}function se(l,o,h,d){const m=new U(l,o,h,d);return v=>m.solve(v)}const fe=se(.25,.1,.25,1);function Se(l,o,h){return Math.min(h,Math.max(o,l))}function Te(l,o,h){const d=h-o,m=((l-o)%d+d)%d+o;return m===o?h:m}function Fe(l,...o){for(const h of o)for(const d in h)l[d]=h[d];return l}let Ne=1;function Oe(l,o,h){const d={};for(const m in l)d[m]=o.call(this,l[m],m,l);return d}function Je(l,o,h){const d={};for(const m in l)o.call(this,l[m],m,l)&&(d[m]=l[m]);return d}function Xe(l){return Array.isArray(l)?l.map(Xe):typeof l=="object"&&l?Oe(l,Xe):l}const qe={};function ht(l){qe[l]||(typeof console<"u"&&console.warn(l),qe[l]=!0)}function _t(l,o,h){return(h.y-l.y)*(o.x-l.x)>(o.y-l.y)*(h.x-l.x)}function Dt(l){return typeof WorkerGlobalScope<"u"&&l!==void 0&&l instanceof WorkerGlobalScope}let jt=null;function Rt(l){return typeof ImageBitmap<"u"&&l instanceof ImageBitmap}const Xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function xi(l,o,h,d,m){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const v=new VideoFrame(l,{timestamp:0});try{const x=v==null?void 0:v.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const T=x.startsWith("BGR"),I=new Uint8ClampedArray(d*m*4);if(yield v.copyTo(I,function(R,k,F,z,$){const q=4*Math.max(-k,0),Z=(Math.max(0,F)-F)*z*4+q,oe=4*z,ue=Math.max(0,k),Me=Math.max(0,F);return{rect:{x:ue,y:Me,width:Math.min(R.width,k+z)-ue,height:Math.min(R.height,F+$)-Me},layout:[{offset:Z,stride:oe}]}}(l,o,h,d,m)),T)for(let R=0;RDt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,bi=function(l,o){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){const d=In(l.url);if(d)return d(l,o);if(Dt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:l,targetMapId:Cn},o)}if(!(/^file:/.test(h=l.url)||/^file:/.test(ns())&&!/^\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(d,m){return c(this,void 0,void 0,function*(){const v=new Request(d.url,{method:d.method||"GET",body:d.body,credentials:d.credentials,headers:d.headers,cache:d.cache,referrer:ns(),signal:m.signal});d.type!=="json"||v.headers.has("Accept")||v.headers.set("Accept","application/json");const x=yield fetch(v);if(!x.ok){const R=yield x.blob();throw new hi(x.status,x.statusText,d.url,R)}let T;T=d.type==="arrayBuffer"||d.type==="image"?x.arrayBuffer():d.type==="json"?x.json():x.text();const I=yield T;if(m.signal.aborted)throw $s();return{data:I,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(l,o);if(Dt(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:l,mustQueue:!0,targetMapId:Cn},o)}var h;return function(d,m){return new Promise((v,x)=>{var T;const I=new XMLHttpRequest;I.open(d.method||"GET",d.url,!0),d.type!=="arrayBuffer"&&d.type!=="image"||(I.responseType="arraybuffer");for(const R in d.headers)I.setRequestHeader(R,d.headers[R]);d.type==="json"&&(I.responseType="text",!((T=d.headers)===null||T===void 0)&&T.Accept||I.setRequestHeader("Accept","application/json")),I.withCredentials=d.credentials==="include",I.onerror=()=>{x(new Error(I.statusText))},I.onload=()=>{if(!m.signal.aborted)if((I.status>=200&&I.status<300||I.status===0)&&I.response!==null){let R=I.response;if(d.type==="json")try{R=JSON.parse(I.response)}catch(k){return void x(k)}v({data:R,cacheControl:I.getResponseHeader("Cache-Control"),expires:I.getResponseHeader("Expires")})}else{const R=new Blob([I.response],{type:I.getResponseHeader("Content-Type")});x(new hi(I.status,I.statusText,d.url,R))}},m.signal.addEventListener("abort",()=>{I.abort(),x($s())}),I.send(d.body)})}(l,o)};function Mi(l){if(!l||l.indexOf("://")<=0||l.indexOf("data:image/")===0||l.indexOf("blob:")===0)return!0;const o=new URL(l),h=window.location;return o.protocol===h.protocol&&o.host===h.host}function Xn(l,o,h){h[l]&&h[l].indexOf(o)!==-1||(h[l]=h[l]||[],h[l].push(o))}function Fs(l,o,h){if(h&&h[l]){const d=h[l].indexOf(o);d!==-1&&h[l].splice(d,1)}}class ge{constructor(o,h={}){Fe(this,h),this.type=o}}class ve extends ge{constructor(o,h={}){super("error",Fe({error:o},h))}}class Ue{on(o,h){return this._listeners=this._listeners||{},Xn(o,h,this._listeners),this}off(o,h){return Fs(o,h,this._listeners),Fs(o,h,this._oneTimeListeners),this}once(o,h){return h?(this._oneTimeListeners=this._oneTimeListeners||{},Xn(o,h,this._oneTimeListeners),this):new Promise(d=>this.once(o,d))}fire(o,h){typeof o=="string"&&(o=new ge(o,h||{}));const d=o.type;if(this.listens(d)){o.target=this;const m=this._listeners&&this._listeners[d]?this._listeners[d].slice():[];for(const T of m)T.call(this,o);const v=this._oneTimeListeners&&this._oneTimeListeners[d]?this._oneTimeListeners[d].slice():[];for(const T of v)Fs(d,T,this._oneTimeListeners),T.call(this,o);const x=this._eventedParent;x&&(Fe(o,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(o))}else o instanceof ve&&console.error(o.error);return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,h){return this._eventedParent=o,this._eventedParentData=h,this}}var ce={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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"},volatile:{type:"boolean",default:!1},"*":{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"},volatile:{type:"boolean",default:!1},"*":{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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},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},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const We=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ge(l,o){const h={};for(const d in l)d!=="ref"&&(h[d]=l[d]);return We.forEach(d=>{d in o&&(h[d]=o[d])}),h}function Ze(l,o){if(Array.isArray(l)){if(!Array.isArray(o)||l.length!==o.length)return!1;for(let h=0;h`:l.itemType.kind==="value"?"array":`array<${o}>`}return l.kind}const Y=[Gi,et,$t,kt,wi,Dr,Qi,j(Nt),Fr,Zn,le];function ne(l,o){if(o.kind==="error")return null;if(l.kind==="array"){if(o.kind==="array"&&(o.N===0&&o.itemType.kind==="value"||!ne(l.itemType,o.itemType))&&(typeof l.N!="number"||l.N===o.N))return null}else{if(l.kind===o.kind)return null;if(l.kind==="value"){for(const h of Y)if(!ne(h,o))return null}}return`Expected ${V(l)} but found ${V(o)} instead.`}function ye(l,o){return o.some(h=>h.kind===l.kind)}function we(l,o){return o.some(h=>h==="null"?l===null:h==="array"?Array.isArray(l):h==="object"?l&&!Array.isArray(l)&&typeof l=="object":h===typeof l)}function Pe(l,o){return l.kind==="array"&&o.kind==="array"?l.itemType.kind===o.itemType.kind&&typeof l.N=="number":l.kind===o.kind}const pe=.96422,ze=.82521,He=4/29,De=6/29,nt=3*De*De,It=De*De*De,Pt=Math.PI/180,ai=180/Math.PI;function Wt(l){return(l%=360)<0&&(l+=360),l}function ni([l,o,h,d]){let m,v;const x=rs((.2225045*(l=Qt(l))+.7168786*(o=Qt(o))+.0606169*(h=Qt(h)))/1);l===o&&o===h?m=v=x:(m=rs((.4360747*l+.3850649*o+.1430804*h)/pe),v=rs((.0139322*l+.0971045*o+.7141733*h)/ze));const T=116*x-16;return[T<0?0:T,500*(m-x),200*(x-v),d]}function Qt(l){return l<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function rs(l){return l>It?Math.pow(l,1/3):l/nt+He}function Fi([l,o,h,d]){let m=(l+16)/116,v=isNaN(o)?m:m+o/500,x=isNaN(h)?m:m-h/200;return m=1*li(m),v=pe*li(v),x=ze*li(x),[qt(3.1338561*v-1.6168667*m-.4906146*x),qt(-.9787684*v+1.9161415*m+.033454*x),qt(.0719453*v-.2289914*m+1.4052427*x),d]}function qt(l){return(l=l<=.00304?12.92*l:1.055*Math.pow(l,1/2.4)-.055)<0?0:l>1?1:l}function li(l){return l>De?l*l*l:nt*(l-He)}function vi(l){return parseInt(l.padEnd(2,l),16)/255}function os(l,o){return ys(o?l/100:l,0,1)}function ys(l,o,h){return Math.min(Math.max(o,l),h)}function Hs(l){return!l.some(Number.isNaN)}const jo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class ui{constructor(o,h,d,m=1,v=!0){this.r=o,this.g=h,this.b=d,this.a=m,v||(this.r*=m,this.g*=m,this.b*=m,m||this.overwriteGetter("rgb",[o,h,d,m]))}static parse(o){if(o instanceof ui)return o;if(typeof o!="string")return;const h=function(d){if((d=d.toLowerCase().trim())==="transparent")return[0,0,0,0];const m=jo[d];if(m){const[x,T,I]=m;return[x/255,T/255,I/255,1]}if(d.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(d)){const x=d.length<6?1:2;let T=1;return[vi(d.slice(T,T+=x)),vi(d.slice(T,T+=x)),vi(d.slice(T,T+=x)),vi(d.slice(T,T+x)||"ff")]}if(d.startsWith("rgb")){const x=d.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[T,I,R,k,F,z,$,q,Z,oe,ue,Me]=x,be=[k||" ",$||" ",oe].join("");if(be===" "||be===" /"||be===",,"||be===",,,"){const Ae=[R,z,Z].join(""),Le=Ae==="%%%"?100:Ae===""?255:0;if(Le){const Ke=[ys(+I/Le,0,1),ys(+F/Le,0,1),ys(+q/Le,0,1),ue?os(+ue,Me):1];if(Hs(Ke))return Ke}}return}}const v=d.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(v){const[x,T,I,R,k,F,z,$,q]=v,Z=[I||" ",k||" ",z].join("");if(Z===" "||Z===" /"||Z===",,"||Z===",,,"){const oe=[+T,ys(+R,0,100),ys(+F,0,100),$?os(+$,q):1];if(Hs(oe))return function([ue,Me,be,Ae]){function Le(Ke){const pt=(Ke+ue/30)%12,Ot=Me*Math.min(be,1-be);return be-Ot*Math.max(-1,Math.min(pt-3,9-pt,1))}return ue=Wt(ue),Me/=100,be/=100,[Le(0),Le(8),Le(4),Ae]}(oe)}}}(o);return h?new ui(...h,!1):void 0}get rgb(){const{r:o,g:h,b:d,a:m}=this,v=m||1/0;return this.overwriteGetter("rgb",[o/v,h/v,d/v,m])}get hcl(){return this.overwriteGetter("hcl",function(o){const[h,d,m,v]=ni(o),x=Math.sqrt(d*d+m*m);return[Math.round(1e4*x)?Wt(Math.atan2(m,d)*ai):NaN,x,h,v]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ni(this.rgb))}overwriteGetter(o,h){return Object.defineProperty(this,o,{value:h}),h}toString(){const[o,h,d,m]=this.rgb;return`rgba(${[o,h,d].map(v=>Math.round(255*v)).join(",")},${m})`}}ui.black=new ui(0,0,0,1),ui.white=new ui(1,1,1,1),ui.transparent=new ui(0,0,0,0),ui.red=new ui(1,0,0,1);class Js{constructor(o,h,d){this.sensitivity=o?h?"variant":"case":h?"accent":"base",this.locale=d,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,h){return this.collator.compare(o,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class io{constructor(o,h,d,m,v){this.text=o,this.image=h,this.scale=d,this.fontStack=m,this.textColor=v}}class fs{constructor(o){this.sections=o}static fromString(o){return new fs([new io(o,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(o=>o.text.length!==0||o.image&&o.image.name.length!==0)}static factory(o){return o instanceof fs?o:fs.fromString(o)}toString(){return this.sections.length===0?"":this.sections.map(o=>o.text).join("")}}class as{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof as)return o;if(typeof o=="number")return new as([o,o,o,o]);if(Array.isArray(o)&&!(o.length<1||o.length>4)){for(const h of o)if(typeof h!="number")return;switch(o.length){case 1:o=[o[0],o[0],o[0],o[0]];break;case 2:o=[o[0],o[1],o[0],o[1]];break;case 3:o=[o[0],o[1],o[2],o[1]]}return new as(o)}}toString(){return JSON.stringify(this.values)}}const Ca=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ls{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof ls)return o;if(Array.isArray(o)&&!(o.length<1)&&o.length%2==0){for(let h=0;h=0&&l<=255&&typeof o=="number"&&o>=0&&o<=255&&typeof h=="number"&&h>=0&&h<=255?d===void 0||typeof d=="number"&&d>=0&&d<=1?null:`Invalid rgba value [${[l,o,h,d].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof d=="number"?[l,o,h,d]:[l,o,h]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function so(l){if(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"||l instanceof ui||l instanceof Js||l instanceof fs||l instanceof as||l instanceof ls||l instanceof cs)return!0;if(Array.isArray(l)){for(const o of l)if(!so(o))return!1;return!0}if(typeof l=="object"){for(const o in l)if(!so(l[o]))return!1;return!0}return!1}function Zi(l){if(l===null)return Gi;if(typeof l=="string")return $t;if(typeof l=="boolean")return kt;if(typeof l=="number")return et;if(l instanceof ui)return wi;if(l instanceof Js)return dr;if(l instanceof fs)return Dr;if(l instanceof as)return Fr;if(l instanceof ls)return le;if(l instanceof cs)return Zn;if(Array.isArray(l)){const o=l.length;let h;for(const d of l){const m=Zi(d);if(h){if(h===m)continue;h=Nt;break}h=m}return j(h||Nt,o)}return Qi}function Ws(l){const o=typeof l;return l===null?"":o==="string"||o==="number"||o==="boolean"?String(l):l instanceof ui||l instanceof fs||l instanceof as||l instanceof ls||l instanceof cs?l.toString():JSON.stringify(l)}class Gs{constructor(o,h){this.type=o,this.value=h}static parse(o,h){if(o.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!so(o[1]))return h.error("invalid value");const d=o[1];let m=Zi(d);const v=h.expectedType;return m.kind!=="array"||m.N!==0||!v||v.kind!=="array"||typeof v.N=="number"&&v.N!==0||(m=v),new Gs(m,d)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Yi{constructor(o){this.name="ExpressionEvaluationError",this.message=o}toJSON(){return this.message}}const $o={string:$t,number:et,boolean:kt,object:Qi};class gn{constructor(o,h){this.type=o,this.args=h}static parse(o,h){if(o.length<2)return h.error("Expected at least one argument.");let d,m=1;const v=o[0];if(v==="array"){let T,I;if(o.length>2){const R=o[1];if(typeof R!="string"||!(R in $o)||R==="object")return h.error('The item type argument of "array" must be one of string, number, boolean',1);T=$o[R],m++}else T=Nt;if(o.length>3){if(o[2]!==null&&(typeof o[2]!="number"||o[2]<0||o[2]!==Math.floor(o[2])))return h.error('The length argument to "array" must be a positive integer literal',2);I=o[2],m++}d=j(T,I)}else{if(!$o[v])throw new Error(`Types doesn't contain name = ${v}`);d=$o[v]}const x=[];for(;mo.outputDefined())}}const Pa={"to-boolean":kt,"to-color":wi,"to-number":et,"to-string":$t};class Qs{constructor(o,h){this.type=o,this.args=h}static parse(o,h){if(o.length<2)return h.error("Expected at least one argument.");const d=o[0];if(!Pa[d])throw new Error(`Can't parse ${d} as it is not part of the known types`);if((d==="to-boolean"||d==="to-string")&&o.length!==2)return h.error("Expected one argument.");const m=Pa[d],v=[];for(let x=1;x4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:So(h[0],h[1],h[2],h[3]),!d))return new ui(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new Yi(d||`Could not parse color from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"padding":{let h;for(const d of this.args){h=d.evaluate(o);const m=as.parse(h);if(m)return m}throw new Yi(`Could not parse padding from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"variableAnchorOffsetCollection":{let h;for(const d of this.args){h=d.evaluate(o);const m=ls.parse(h);if(m)return m}throw new Yi(`Could not parse variableAnchorOffsetCollection from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"number":{let h=null;for(const d of this.args){if(h=d.evaluate(o),h===null)return 0;const m=Number(h);if(!isNaN(m))return m}throw new Yi(`Could not convert ${JSON.stringify(h)} to number.`)}case"formatted":return fs.fromString(Ws(this.args[0].evaluate(o)));case"resolvedImage":return cs.fromString(Ws(this.args[0].evaluate(o)));default:return Ws(this.args[0].evaluate(o))}}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const no=["Unknown","Point","LineString","Polygon"];class ul{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?no[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(o){let h=this._parseColorCache[o];return h||(h=this._parseColorCache[o]=ui.parse(o)),h}}class ro{constructor(o,h,d=[],m,v=new _i,x=[]){this.registry=o,this.path=d,this.key=d.map(T=>`[${T}]`).join(""),this.scope=v,this.errors=x,this.expectedType=m,this._isConstant=h}parse(o,h,d,m,v={}){return h?this.concat(h,d,m)._parse(o,v):this._parse(o,v)}_parse(o,h){function d(m,v,x){return x==="assert"?new gn(v,[m]):x==="coerce"?new Qs(v,[m]):m}if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"||(o=["literal",o]),Array.isArray(o)){if(o.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const m=o[0];if(typeof m!="string")return this.error(`Expression name must be a string, but found ${typeof m} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const v=this.registry[m];if(v){let x=v.parse(o,this);if(!x)return null;if(this.expectedType){const T=this.expectedType,I=x.type;if(T.kind!=="string"&&T.kind!=="number"&&T.kind!=="boolean"&&T.kind!=="object"&&T.kind!=="array"||I.kind!=="value")if(T.kind!=="color"&&T.kind!=="formatted"&&T.kind!=="resolvedImage"||I.kind!=="value"&&I.kind!=="string")if(T.kind!=="padding"||I.kind!=="value"&&I.kind!=="number"&&I.kind!=="array")if(T.kind!=="variableAnchorOffsetCollection"||I.kind!=="value"&&I.kind!=="array"){if(this.checkSubtype(T,I))return null}else x=d(x,T,h.typeAnnotation||"coerce");else x=d(x,T,h.typeAnnotation||"coerce");else x=d(x,T,h.typeAnnotation||"coerce");else x=d(x,T,h.typeAnnotation||"assert")}if(!(x instanceof Gs)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const T=new ul;try{x=new Gs(x.type,x.evaluate(T))}catch(I){return this.error(I.message),null}}return x}return this.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(o===void 0?"'undefined' value invalid. Use null instead.":typeof o=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof o} instead.`)}concat(o,h,d){const m=typeof o=="number"?this.path.concat(o):this.path,v=d?this.scope.concat(d):this.scope;return new ro(this.registry,this._isConstant,m,h||null,v,this.errors)}error(o,...h){const d=`${this.key}${h.map(m=>`[${m}]`).join("")}`;this.errors.push(new mi(d,o))}checkSubtype(o,h){const d=ne(o,h);return d&&this.error(d),d}}class pr{constructor(o,h){this.type=h.type,this.bindings=[].concat(o),this.result=h}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const h of this.bindings)o(h[1]);o(this.result)}static parse(o,h){if(o.length<4)return h.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const d=[];for(let v=1;v=d.length)throw new Yi(`Array index out of bounds: ${h} > ${d.length-1}.`);if(h!==Math.floor(h))throw new Yi(`Array index must be an integer, but found ${h} instead.`);return d[h]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}}class Oc{constructor(o,h){this.type=kt,this.needle=o,this.haystack=h}static parse(o,h){if(o.length!==3)return h.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const d=h.parse(o[1],1,Nt),m=h.parse(o[2],2,Nt);return d&&m?ye(d.type,[kt,$t,et,Gi,Nt])?new Oc(d,m):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${V(d.type)} instead`):null}evaluate(o){const h=this.needle.evaluate(o),d=this.haystack.evaluate(o);if(!d)return!1;if(!we(h,["boolean","string","number","null"]))throw new Yi(`Expected first argument to be of type boolean, string, number or null, but found ${V(Zi(h))} instead.`);if(!we(d,["string","array"]))throw new Yi(`Expected second argument to be of type array or string, but found ${V(Zi(d))} instead.`);return d.indexOf(h)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}}class X{constructor(o,h,d){this.type=et,this.needle=o,this.haystack=h,this.fromIndex=d}static parse(o,h){if(o.length<=2||o.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const d=h.parse(o[1],1,Nt),m=h.parse(o[2],2,Nt);if(!d||!m)return null;if(!ye(d.type,[kt,$t,et,Gi,Nt]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${V(d.type)} instead`);if(o.length===4){const v=h.parse(o[3],3,et);return v?new X(d,m,v):null}return new X(d,m)}evaluate(o){const h=this.needle.evaluate(o),d=this.haystack.evaluate(o);if(!we(h,["boolean","string","number","null"]))throw new Yi(`Expected first argument to be of type boolean, string, number or null, but found ${V(Zi(h))} instead.`);let m;if(this.fromIndex&&(m=this.fromIndex.evaluate(o)),we(d,["string"])){const v=d.indexOf(h,m);return v===-1?-1:[...d.slice(0,v)].length}if(we(d,["array"]))return d.indexOf(h,m);throw new Yi(`Expected second argument to be of type array or string, but found ${V(Zi(d))} instead.`)}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}}class Q{constructor(o,h,d,m,v,x){this.inputType=o,this.type=h,this.input=d,this.cases=m,this.outputs=v,this.otherwise=x}static parse(o,h){if(o.length<5)return h.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!=1)return h.error("Expected an even number of arguments.");let d,m;h.expectedType&&h.expectedType.kind!=="value"&&(m=h.expectedType);const v={},x=[];for(let R=2;RNumber.MAX_SAFE_INTEGER)return z.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof q=="number"&&Math.floor(q)!==q)return z.error("Numeric branch labels must be integer values.");if(d){if(z.checkSubtype(d,Zi(q)))return null}else d=Zi(q);if(v[String(q)]!==void 0)return z.error("Branch labels must be unique.");v[String(q)]=x.length}const $=h.parse(F,R,m);if(!$)return null;m=m||$.type,x.push($)}const T=h.parse(o[1],1,Nt);if(!T)return null;const I=h.parse(o[o.length-1],o.length-1,m);return I?T.type.kind!=="value"&&h.concat(1).checkSubtype(d,T.type)?null:new Q(d,m,T,v,x,I):null}evaluate(o){const h=this.input.evaluate(o);return(Zi(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(o)}eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}}class me{constructor(o,h,d){this.type=o,this.branches=h,this.otherwise=d}static parse(o,h){if(o.length<4)return h.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!=0)return h.error("Expected an odd number of arguments.");let d;h.expectedType&&h.expectedType.kind!=="value"&&(d=h.expectedType);const m=[];for(let x=1;xh.outputDefined())&&this.otherwise.outputDefined()}}class Be{constructor(o,h,d,m){this.type=o,this.input=h,this.beginIndex=d,this.endIndex=m}static parse(o,h){if(o.length<=2||o.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const d=h.parse(o[1],1,Nt),m=h.parse(o[2],2,et);if(!d||!m)return null;if(!ye(d.type,[j(Nt),$t,Nt]))return h.error(`Expected first argument to be of type array or string, but found ${V(d.type)} instead`);if(o.length===4){const v=h.parse(o[3],3,et);return v?new Be(d.type,d,m,v):null}return new Be(d.type,d,m)}evaluate(o){const h=this.input.evaluate(o),d=this.beginIndex.evaluate(o);let m;if(this.endIndex&&(m=this.endIndex.evaluate(o)),we(h,["string"]))return[...h].slice(d,m).join("");if(we(h,["array"]))return h.slice(d,m);throw new Yi(`Expected first argument to be of type array or string, but found ${V(Zi(h))} instead.`)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}}function tt(l,o){const h=l.length-1;let d,m,v=0,x=h,T=0;for(;v<=x;)if(T=Math.floor((v+x)/2),d=l[T],m=l[T+1],d<=o){if(T===h||oo))throw new Yi("Input is not a number.");x=T-1}return 0}class vt{constructor(o,h,d){this.type=o,this.input=h,this.labels=[],this.outputs=[];for(const[m,v]of d)this.labels.push(m),this.outputs.push(v)}static parse(o,h){if(o.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return h.error("Expected an even number of arguments.");const d=h.parse(o[1],1,et);if(!d)return null;const m=[];let v=null;h.expectedType&&h.expectedType.kind!=="value"&&(v=h.expectedType);for(let x=1;x=T)return h.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',R);const F=h.parse(I,k,v);if(!F)return null;v=v||F.type,m.push([T,F])}return new vt(v,d,m)}evaluate(o){const h=this.labels,d=this.outputs;if(h.length===1)return d[0].evaluate(o);const m=this.input.evaluate(o);if(m<=h[0])return d[0].evaluate(o);const v=h.length;return m>=h[v-1]?d[v-1].evaluate(o):d[tt(h,m)].evaluate(o)}eachChild(o){o(this.input);for(const h of this.outputs)o(h)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function ii(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ts=Ss;function Ss(l,o,h,d){this.cx=3*l,this.bx=3*(h-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(d-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=o,this.p2x=h,this.p2y=d}Ss.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,o){if(o===void 0&&(o=1e-6),l<0)return 0;if(l>1)return 1;for(var h=l,d=0;d<8;d++){var m=this.sampleCurveX(h)-l;if(Math.abs(m)m?x=h:T=h,h=.5*(T-x)+x;return h},solve:function(l,o){return this.sampleCurveY(this.solveCurveX(l,o))}};var qs=ii(Ts);function Ns(l,o,h){return l+h*(o-l)}function Dc(l,o,h){return l.map((d,m)=>Ns(d,o[m],h))}const Pn={number:Ns,color:function(l,o,h,d="rgb"){switch(d){case"rgb":{const[m,v,x,T]=Dc(l.rgb,o.rgb,h);return new ui(m,v,x,T,!1)}case"hcl":{const[m,v,x,T]=l.hcl,[I,R,k,F]=o.hcl;let z,$;if(isNaN(m)||isNaN(I))isNaN(m)?isNaN(I)?z=NaN:(z=I,x!==1&&x!==0||($=R)):(z=m,k!==1&&k!==0||($=v));else{let Me=I-m;I>m&&Me>180?Me-=360:I180&&(Me+=360),z=m+h*Me}const[q,Z,oe,ue]=function([Me,be,Ae,Le]){return Me=isNaN(Me)?0:Me*Pt,Fi([Ae,Math.cos(Me)*be,Math.sin(Me)*be,Le])}([z,$??Ns(v,R,h),Ns(x,k,h),Ns(T,F,h)]);return new ui(q,Z,oe,ue,!1)}case"lab":{const[m,v,x,T]=Fi(Dc(l.lab,o.lab,h));return new ui(m,v,x,T,!1)}}},array:Dc,padding:function(l,o,h){return new as(Dc(l.values,o.values,h))},variableAnchorOffsetCollection:function(l,o,h){const d=l.values,m=o.values;if(d.length!==m.length)throw new Yi(`Cannot interpolate values of different length. from: ${l.toString()}, to: ${o.toString()}`);const v=[];for(let x=0;xtypeof k!="number"||k<0||k>1))return h.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:R}}}if(o.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return h.error("Expected an even number of arguments.");if(v=h.parse(v,2,et),!v)return null;const T=[];let I=null;d==="interpolate-hcl"||d==="interpolate-lab"?I=wi:h.expectedType&&h.expectedType.kind!=="value"&&(I=h.expectedType);for(let R=0;R=k)return h.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);const q=h.parse(F,$,I);if(!q)return null;I=I||q.type,T.push([k,q])}return Pe(I,et)||Pe(I,wi)||Pe(I,Fr)||Pe(I,le)||Pe(I,j(et))?new Mn(I,d,m,v,T):h.error(`Type ${V(I)} is not interpolatable.`)}evaluate(o){const h=this.labels,d=this.outputs;if(h.length===1)return d[0].evaluate(o);const m=this.input.evaluate(o);if(m<=h[0])return d[0].evaluate(o);const v=h.length;if(m>=h[v-1])return d[v-1].evaluate(o);const x=tt(h,m),T=Mn.interpolationFactor(this.interpolation,m,h[x],h[x+1]),I=d[x].evaluate(o),R=d[x+1].evaluate(o);switch(this.operator){case"interpolate":return Pn[this.type.kind](I,R,T);case"interpolate-hcl":return Pn.color(I,R,T,"hcl");case"interpolate-lab":return Pn.color(I,R,T,"lab")}}eachChild(o){o(this.input);for(const h of this.outputs)o(h)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function ih(l,o,h,d){const m=d-h,v=l-h;return m===0?0:o===1?v/m:(Math.pow(o,v)-1)/(Math.pow(o,m)-1)}class sh{constructor(o,h){this.type=o,this.args=h}static parse(o,h){if(o.length<2)return h.error("Expectected at least one argument.");let d=null;const m=h.expectedType;m&&m.kind!=="value"&&(d=m);const v=[];for(const T of o.slice(1)){const I=h.parse(T,1+v.length,d,void 0,{typeAnnotation:"omit"});if(!I)return null;d=d||I.type,v.push(I)}if(!d)throw new Error("No output type");const x=m&&v.some(T=>ne(m,T.type));return new sh(x?Nt:d,v)}evaluate(o){let h,d=null,m=0;for(const v of this.args)if(m++,d=v.evaluate(o),d&&d instanceof cs&&!d.available&&(h||(h=d.name),d=null,m===this.args.length&&(d=h)),d!==null)break;return d}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}function nh(l,o){return l==="=="||l==="!="?o.kind==="boolean"||o.kind==="string"||o.kind==="number"||o.kind==="null"||o.kind==="value":o.kind==="string"||o.kind==="number"||o.kind==="value"}function cm(l,o,h,d){return d.compare(o,h)===0}function hl(l,o,h){const d=l!=="=="&&l!=="!=";return class D3{constructor(v,x,T){this.type=kt,this.lhs=v,this.rhs=x,this.collator=T,this.hasUntypedArgument=v.type.kind==="value"||x.type.kind==="value"}static parse(v,x){if(v.length!==3&&v.length!==4)return x.error("Expected two or three arguments.");const T=v[0];let I=x.parse(v[1],1,Nt);if(!I)return null;if(!nh(T,I.type))return x.concat(1).error(`"${T}" comparisons are not supported for type '${V(I.type)}'.`);let R=x.parse(v[2],2,Nt);if(!R)return null;if(!nh(T,R.type))return x.concat(2).error(`"${T}" comparisons are not supported for type '${V(R.type)}'.`);if(I.type.kind!==R.type.kind&&I.type.kind!=="value"&&R.type.kind!=="value")return x.error(`Cannot compare types '${V(I.type)}' and '${V(R.type)}'.`);d&&(I.type.kind==="value"&&R.type.kind!=="value"?I=new gn(R.type,[I]):I.type.kind!=="value"&&R.type.kind==="value"&&(R=new gn(I.type,[R])));let k=null;if(v.length===4){if(I.type.kind!=="string"&&R.type.kind!=="string"&&I.type.kind!=="value"&&R.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(k=x.parse(v[3],3,dr),!k)return null}return new D3(I,R,k)}evaluate(v){const x=this.lhs.evaluate(v),T=this.rhs.evaluate(v);if(d&&this.hasUntypedArgument){const I=Zi(x),R=Zi(T);if(I.kind!==R.kind||I.kind!=="string"&&I.kind!=="number")throw new Yi(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${I.kind}, ${R.kind}) instead.`)}if(this.collator&&!d&&this.hasUntypedArgument){const I=Zi(x),R=Zi(T);if(I.kind!=="string"||R.kind!=="string")return o(v,x,T)}return this.collator?h(v,x,T,this.collator.evaluate(v)):o(v,x,T)}eachChild(v){v(this.lhs),v(this.rhs),this.collator&&v(this.collator)}outputDefined(){return!0}}}const Mb=hl("==",function(l,o,h){return o===h},cm),um=hl("!=",function(l,o,h){return o!==h},function(l,o,h,d){return!cm(0,o,h,d)}),hm=hl("<",function(l,o,h){return o",function(l,o,h){return o>h},function(l,o,h,d){return d.compare(o,h)>0}),kb=hl("<=",function(l,o,h){return o<=h},function(l,o,h,d){return d.compare(o,h)<=0}),fm=hl(">=",function(l,o,h){return o>=h},function(l,o,h,d){return d.compare(o,h)>=0});class Fc{constructor(o,h,d){this.type=dr,this.locale=d,this.caseSensitive=o,this.diacriticSensitive=h}static parse(o,h){if(o.length!==2)return h.error("Expected one argument.");const d=o[1];if(typeof d!="object"||Array.isArray(d))return h.error("Collator options argument must be an object.");const m=h.parse(d["case-sensitive"]!==void 0&&d["case-sensitive"],1,kt);if(!m)return null;const v=h.parse(d["diacritic-sensitive"]!==void 0&&d["diacritic-sensitive"],1,kt);if(!v)return null;let x=null;return d.locale&&(x=h.parse(d.locale,1,$t),!x)?null:new Fc(m,v,x)}evaluate(o){return new Js(this.caseSensitive.evaluate(o),this.diacriticSensitive.evaluate(o),this.locale?this.locale.evaluate(o):null)}eachChild(o){o(this.caseSensitive),o(this.diacriticSensitive),this.locale&&o(this.locale)}outputDefined(){return!1}}class vd{constructor(o,h,d,m,v){this.type=$t,this.number=o,this.locale=h,this.currency=d,this.minFractionDigits=m,this.maxFractionDigits=v}static parse(o,h){if(o.length!==3)return h.error("Expected two arguments.");const d=h.parse(o[1],1,et);if(!d)return null;const m=o[2];if(typeof m!="object"||Array.isArray(m))return h.error("NumberFormat options argument must be an object.");let v=null;if(m.locale&&(v=h.parse(m.locale,1,$t),!v))return null;let x=null;if(m.currency&&(x=h.parse(m.currency,1,$t),!x))return null;let T=null;if(m["min-fraction-digits"]&&(T=h.parse(m["min-fraction-digits"],1,et),!T))return null;let I=null;return m["max-fraction-digits"]&&(I=h.parse(m["max-fraction-digits"],1,et),!I)?null:new vd(d,v,x,T,I)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}}class rh{constructor(o){this.type=Dr,this.sections=o}static parse(o,h){if(o.length<2)return h.error("Expected at least one argument.");const d=o[1];if(!Array.isArray(d)&&typeof d=="object")return h.error("First argument must be an image or text section.");const m=[];let v=!1;for(let x=1;x<=o.length-1;++x){const T=o[x];if(v&&typeof T=="object"&&!Array.isArray(T)){v=!1;let I=null;if(T["font-scale"]&&(I=h.parse(T["font-scale"],1,et),!I))return null;let R=null;if(T["text-font"]&&(R=h.parse(T["text-font"],1,j($t)),!R))return null;let k=null;if(T["text-color"]&&(k=h.parse(T["text-color"],1,wi),!k))return null;const F=m[m.length-1];F.scale=I,F.font=R,F.textColor=k}else{const I=h.parse(o[x],1,Nt);if(!I)return null;const R=I.type.kind;if(R!=="string"&&R!=="value"&&R!=="null"&&R!=="resolvedImage")return h.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");v=!0,m.push({content:I,scale:null,font:null,textColor:null})}}return new rh(m)}evaluate(o){return new fs(this.sections.map(h=>{const d=h.content.evaluate(o);return Zi(d)===Zn?new io("",d,null,null,null):new io(Ws(d),null,h.scale?h.scale.evaluate(o):null,h.font?h.font.evaluate(o).join(","):null,h.textColor?h.textColor.evaluate(o):null)}))}eachChild(o){for(const h of this.sections)o(h.content),h.scale&&o(h.scale),h.font&&o(h.font),h.textColor&&o(h.textColor)}outputDefined(){return!1}}class xd{constructor(o){this.type=Zn,this.input=o}static parse(o,h){if(o.length!==2)return h.error("Expected two arguments.");const d=h.parse(o[1],1,$t);return d?new xd(d):h.error("No image name provided.")}evaluate(o){const h=this.input.evaluate(o),d=cs.fromString(h);return d&&o.availableImages&&(d.available=o.availableImages.indexOf(h)>-1),d}eachChild(o){o(this.input)}outputDefined(){return!1}}class wd{constructor(o){this.type=et,this.input=o}static parse(o,h){if(o.length!==2)return h.error(`Expected 1 argument, but found ${o.length-1} instead.`);const d=h.parse(o[1],1);return d?d.type.kind!=="array"&&d.type.kind!=="string"&&d.type.kind!=="value"?h.error(`Expected argument of type string or array, but found ${V(d.type)} instead.`):new wd(d):null}evaluate(o){const h=this.input.evaluate(o);if(typeof h=="string")return[...h].length;if(Array.isArray(h))return h.length;throw new Yi(`Expected value to be of type string or array, but found ${V(Zi(h))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}}const oo=8192;function Ob(l,o){const h=(180+l[0])/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,m=Math.pow(2,o.z);return[Math.round(h*m*oo),Math.round(d*m*oo)]}function Td(l,o){const h=Math.pow(2,o.z);return[(m=(l[0]/oo+o.x)/h,360*m-180),(d=(l[1]/oo+o.y)/h,360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90)];var d,m}function Ma(l,o){l[0]=Math.min(l[0],o[0]),l[1]=Math.min(l[1],o[1]),l[2]=Math.max(l[2],o[0]),l[3]=Math.max(l[3],o[1])}function Ho(l,o){return!(l[0]<=o[0]||l[2]>=o[2]||l[1]<=o[1]||l[3]>=o[3])}function yi(l,o,h){const d=l[0]-o[0],m=l[1]-o[1],v=l[0]-h[0],x=l[1]-h[1];return d*x-v*m==0&&d*v<=0&&m*x<=0}function oh(l,o,h,d){return(m=[d[0]-h[0],d[1]-h[1]])[0]*(v=[o[0]-l[0],o[1]-l[1]])[1]-m[1]*v[0]!=0&&!(!pm(l,o,h,d)||!pm(h,d,l,o));var m,v}function Db(l,o,h){for(const d of h)for(let m=0;m(m=l)[1]!=(x=T[I+1])[1]>m[1]&&m[0]<(x[0]-v[0])*(m[1]-v[1])/(x[1]-v[1])+v[0]&&(d=!d)}var m,v,x;return d}function Fb(l,o){for(const h of o)if(fl(l,h))return!0;return!1}function dm(l,o){for(const h of l)if(!fl(h,o))return!1;for(let h=0;h0&&T<0||x<0&&T>0}function Sd(l,o,h){const d=[];for(let m=0;mh[2]){const m=.5*d;let v=l[0]-h[0]>m?-d:h[0]-l[0]>m?d:0;v===0&&(v=l[0]-h[2]>m?-d:h[2]-l[0]>m?d:0),l[0]+=v}Ma(o,l)}function _m(l,o,h,d){const m=Math.pow(2,d.z)*oo,v=[d.x*oo,d.y*oo],x=[];for(const T of l)for(const I of T){const R=[I.x+v[0],I.y+v[1]];mm(R,o,h,m),x.push(R)}return x}function ym(l,o,h,d){const m=Math.pow(2,d.z)*oo,v=[d.x*oo,d.y*oo],x=[];for(const I of l){const R=[];for(const k of I){const F=[k.x+v[0],k.y+v[1]];Ma(o,F),R.push(F)}x.push(R)}if(o[2]-o[0]<=m/2){(T=o)[0]=T[1]=1/0,T[2]=T[3]=-1/0;for(const I of x)for(const R of I)mm(R,o,h,m)}var T;return x}class Ra{constructor(o,h){this.type=kt,this.geojson=o,this.geometries=h}static parse(o,h){if(o.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(so(o[1])){const d=o[1];if(d.type==="FeatureCollection"){const m=[];for(const v of d.features){const{type:x,coordinates:T}=v.geometry;x==="Polygon"&&m.push(T),x==="MultiPolygon"&&m.push(...T)}if(m.length)return new Ra(d,{type:"MultiPolygon",coordinates:m})}else if(d.type==="Feature"){const m=d.geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new Ra(d,d.geometry)}else if(d.type==="Polygon"||d.type==="MultiPolygon")return new Ra(d,d)}return h.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.geometryType()==="Point")return function(h,d){const m=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],x=h.canonicalID();if(d.type==="Polygon"){const T=Sd(d.coordinates,v,x),I=_m(h.geometry(),m,v,x);if(!Ho(m,v))return!1;for(const R of I)if(!fl(R,T))return!1}if(d.type==="MultiPolygon"){const T=gm(d.coordinates,v,x),I=_m(h.geometry(),m,v,x);if(!Ho(m,v))return!1;for(const R of I)if(!Fb(R,T))return!1}return!0}(o,this.geometries);if(o.geometryType()==="LineString")return function(h,d){const m=[1/0,1/0,-1/0,-1/0],v=[1/0,1/0,-1/0,-1/0],x=h.canonicalID();if(d.type==="Polygon"){const T=Sd(d.coordinates,v,x),I=ym(h.geometry(),m,v,x);if(!Ho(m,v))return!1;for(const R of I)if(!dm(R,T))return!1}if(d.type==="MultiPolygon"){const T=gm(d.coordinates,v,x),I=ym(h.geometry(),m,v,x);if(!Ho(m,v))return!1;for(const R of I)if(!Nb(R,T))return!1}return!0}(o,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let bm=class{constructor(l=[],o=(h,d)=>hd?1:0){if(this.data=l,this.length=this.data.length,this.compare=o,this.length>0)for(let h=(this.length>>1)-1;h>=0;h--)this._down(h)}push(l){this.data.push(l),this._up(this.length++)}pop(){if(this.length===0)return;const l=this.data[0],o=this.data.pop();return--this.length>0&&(this.data[0]=o,this._down(0)),l}peek(){return this.data[0]}_up(l){const{data:o,compare:h}=this,d=o[l];for(;l>0;){const m=l-1>>1,v=o[m];if(h(d,v)>=0)break;o[l]=v,l=m}o[l]=d}_down(l){const{data:o,compare:h}=this,d=this.length>>1,m=o[l];for(;l=0)break;o[l]=o[v],l=v}o[l]=m}};function Bb(l,o,h,d,m){vm(l,o,h,d||l.length-1,m||Lb)}function vm(l,o,h,d,m){for(;d>h;){if(d-h>600){var v=d-h+1,x=o-h+1,T=Math.log(v),I=.5*Math.exp(2*T/3),R=.5*Math.sqrt(T*I*(v-I)/v)*(x-v/2<0?-1:1);vm(l,o,Math.max(h,Math.floor(o-x*I/v+R)),Math.min(d,Math.floor(o+(v-x)*I/v+R)),m)}var k=l[o],F=h,z=d;for(Nc(l,h,o),m(l[d],k)>0&&Nc(l,h,d);F0;)z--}m(l[h],k)===0?Nc(l,h,z):Nc(l,++z,d),z<=o&&(h=z+1),o<=z&&(d=z-1)}}function Nc(l,o,h){var d=l[o];l[o]=l[h],l[h]=d}function Lb(l,o){return lo?1:0}function ah(l,o){if(l.length<=1)return[l];const h=[];let d,m;for(const v of l){const x=Ub(v);x!==0&&(v.area=Math.abs(x),m===void 0&&(m=x<0),m===x<0?(d&&h.push(d),d=[v]):d.push(v))}if(d&&h.push(d),o>1)for(let v=0;v1?(R=o[I+1][0],k=o[I+1][1]):$>0&&(R+=F/this.kx*$,k+=z/this.ky*$)),F=this.wrap(h[0]-R)*this.kx,z=(h[1]-k)*this.ky;const q=F*F+z*z;q180;)o-=360;return o}}function Sm(l,o){return o[0]-l[0]}function lh(l){return l[1]-l[0]+1}function Eo(l,o){return l[1]>=l[0]&&l[1]l[1])return[null,null];const h=lh(l);if(o){if(h===2)return[l,null];const m=Math.floor(h/2);return[[l[0],l[0]+m],[l[0]+m,l[1]]]}if(h===1)return[l,null];const d=Math.floor(h/2)-1;return[[l[0],l[0]+d],[l[0]+d+1,l[1]]]}function Id(l,o){if(!Eo(o,l.length))return[1/0,1/0,-1/0,-1/0];const h=[1/0,1/0,-1/0,-1/0];for(let d=o[0];d<=o[1];++d)Ma(h,l[d]);return h}function Cd(l){const o=[1/0,1/0,-1/0,-1/0];for(const h of l)for(const d of h)Ma(o,d);return o}function ch(l){return l[0]!==-1/0&&l[1]!==-1/0&&l[2]!==1/0&&l[3]!==1/0}function Pd(l,o,h){if(!ch(l)||!ch(o))return NaN;let d=0,m=0;return l[2]o[2]&&(d=l[0]-o[2]),l[1]>o[3]&&(m=l[1]-o[3]),l[3]=d)return d;if(Ho(m,v)){if(uh(l,o))return 0}else if(uh(o,l))return 0;let x=1/0;for(const T of l)for(let I=0,R=T.length,k=R-1;I0;){const I=x.pop();if(I[0]>=v)continue;const R=I[1],k=o?50:100;if(lh(R)<=k){if(!Eo(R,l.length))return NaN;if(o){const F=ei(l,R,h,d);if(isNaN(F)||F===0)return F;v=Math.min(v,F)}else for(let F=R[0];F<=R[1];++F){const z=jb(l[F],h,d);if(v=Math.min(v,z),v===0)return 0}}else{const F=Ad(R,o);Si(x,v,d,l,T,F[0]),Si(x,v,d,l,T,F[1])}}return v}function Lc(l,o,h,d,m,v=1/0){let x=Math.min(v,m.distance(l[0],h[0]));if(x===0)return x;const T=new bm([[0,[0,l.length-1],[0,h.length-1]]],Sm);for(;T.length>0;){const I=T.pop();if(I[0]>=x)continue;const R=I[1],k=I[2],F=o?50:100,z=d?50:100;if(lh(R)<=F&&lh(k)<=z){if(!Eo(R,l.length)&&Eo(k,h.length))return NaN;let $;if(o&&d)$=Vb(l,R,h,k,m),x=Math.min(x,$);else if(o&&!d){const q=l.slice(R[0],R[1]+1);for(let Z=k[0];Z<=k[1];++Z)if($=ka(h[Z],q,m),x=Math.min(x,$),x===0)return x}else if(!o&&d){const q=h.slice(k[0],k[1]+1);for(let Z=R[0];Z<=R[1];++Z)if($=ka(l[Z],q,m),x=Math.min(x,$),x===0)return x}else $=ds(l,R,h,k,m),x=Math.min(x,$)}else{const $=Ad(R,o),q=Ad(k,d);Oa(T,x,m,l,h,$[0],q[0]),Oa(T,x,m,l,h,$[0],q[1]),Oa(T,x,m,l,h,$[1],q[0]),Oa(T,x,m,l,h,$[1],q[1])}}return x}function Rd(l){return l.type==="MultiPolygon"?l.coordinates.map(o=>({type:"Polygon",coordinates:o})):l.type==="MultiLineString"?l.coordinates.map(o=>({type:"LineString",coordinates:o})):l.type==="MultiPoint"?l.coordinates.map(o=>({type:"Point",coordinates:o})):[l]}class Da{constructor(o,h){this.type=et,this.geojson=o,this.geometries=h}static parse(o,h){if(o.length!==2)return h.error(`'distance' expression requires exactly one argument, but found ${o.length-1} instead.`);if(so(o[1])){const d=o[1];if(d.type==="FeatureCollection")return new Da(d,d.features.map(m=>Rd(m.geometry)).flat());if(d.type==="Feature")return new Da(d,Rd(d.geometry));if("type"in d&&"coordinates"in d)return new Da(d,Rd(d))}return h.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.geometryType()==="Point")return function(h,d){const m=h.geometry(),v=m.flat().map(I=>Td([I.x,I.y],h.canonical));if(m.length===0)return NaN;const x=new Ed(v[0][1]);let T=1/0;for(const I of d){switch(I.type){case"Point":T=Math.min(T,Lc(v,!1,[I.coordinates],!1,x,T));break;case"LineString":T=Math.min(T,Lc(v,!1,I.coordinates,!0,x,T));break;case"Polygon":T=Math.min(T,Bc(v,!1,I.coordinates,x,T))}if(T===0)return T}return T}(o,this.geometries);if(o.geometryType()==="LineString")return function(h,d){const m=h.geometry(),v=m.flat().map(I=>Td([I.x,I.y],h.canonical));if(m.length===0)return NaN;const x=new Ed(v[0][1]);let T=1/0;for(const I of d){switch(I.type){case"Point":T=Math.min(T,Lc(v,!0,[I.coordinates],!1,x,T));break;case"LineString":T=Math.min(T,Lc(v,!0,I.coordinates,!0,x,T));break;case"Polygon":T=Math.min(T,Bc(v,!0,I.coordinates,x,T))}if(T===0)return T}return T}(o,this.geometries);if(o.geometryType()==="Polygon")return function(h,d){const m=h.geometry();if(m.length===0||m[0].length===0)return NaN;const v=ah(m,0).map(I=>I.map(R=>R.map(k=>Td([k.x,k.y],h.canonical)))),x=new Ed(v[0][0][0][1]);let T=1/0;for(const I of d)for(const R of v){switch(I.type){case"Point":T=Math.min(T,Bc([I.coordinates],!1,R,x,T));break;case"LineString":T=Math.min(T,Bc(I.coordinates,!0,R,x,T));break;case"Polygon":T=Math.min(T,Ni(R,I.coordinates,x,T))}if(T===0)return T}return T}(o,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const dl={"==":Mb,"!=":um,">":Rb,"<":hm,">=":fm,"<=":kb,array:gn,at:kc,boolean:gn,case:me,coalesce:sh,collator:Fc,format:rh,image:xd,in:Oc,"index-of":X,interpolate:Mn,"interpolate-hcl":Mn,"interpolate-lab":Mn,length:wd,let:pr,literal:Gs,match:Q,number:gn,"number-format":vd,object:gn,slice:Be,step:vt,string:gn,"to-boolean":Qs,"to-color":Qs,"to-number":Qs,"to-string":Qs,var:ci,within:Ra,distance:Da};class gr{constructor(o,h,d,m){this.name=o,this.type=h,this._evaluate=d,this.args=m}evaluate(o){return this._evaluate(o,this.args)}eachChild(o){this.args.forEach(o)}outputDefined(){return!1}static parse(o,h){const d=o[0],m=gr.definitions[d];if(!m)return h.error(`Unknown expression "${d}". If you wanted a literal array, use ["literal", [...]].`,0);const v=Array.isArray(m)?m[0]:m.type,x=Array.isArray(m)?[[m[1],m[2]]]:m.overloads,T=x.filter(([R])=>!Array.isArray(R)||R.length===o.length-1);let I=null;for(const[R,k]of T){I=new ro(h.registry,zc,h.path,null,h.scope);const F=[];let z=!1;for(let $=1;${return z=F,Array.isArray(z)?`(${z.map(V).join(", ")})`:`(${V(z.type)}...)`;var z}).join(" | "),k=[];for(let F=1;F{h=o?h&&zc(d):h&&d instanceof Gs}),!!h&&Uc(l)&&Vc(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Uc(l){if(l instanceof gr&&(l.name==="get"&&l.args.length===1||l.name==="feature-state"||l.name==="has"&&l.args.length===1||l.name==="properties"||l.name==="geometry-type"||l.name==="id"||/^filter-/.test(l.name))||l instanceof Ra||l instanceof Da)return!1;let o=!0;return l.eachChild(h=>{o&&!Uc(h)&&(o=!1)}),o}function pl(l){if(l instanceof gr&&l.name==="feature-state")return!1;let o=!0;return l.eachChild(h=>{o&&!pl(h)&&(o=!1)}),o}function Vc(l,o){if(l instanceof gr&&o.indexOf(l.name)>=0)return!1;let h=!0;return l.eachChild(d=>{h&&!Vc(d,o)&&(h=!1)}),h}function hh(l){return{result:"success",value:l}}function gl(l){return{result:"error",value:l}}function ml(l){return l["property-type"]==="data-driven"||l["property-type"]==="cross-faded-data-driven"}function Em(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Fd(l){return!!l.expression&&l.expression.interpolated}function fi(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":l===null?"null":typeof l}function fh(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function $b(l){return l}function Am(l,o){const h=o.type==="color",d=l.stops&&typeof l.stops[0][0]=="object",m=d||!(d||l.property!==void 0),v=l.type||(Fd(o)?"exponential":"interval");if(h||o.type==="padding"){const k=h?ui.parse:as.parse;(l=Jt({},l)).stops&&(l.stops=l.stops.map(F=>[F[0],k(F[1])])),l.default=k(l.default?l.default:o.default)}if(l.colorSpace&&(x=l.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${l.colorSpace}"`);var x;let T,I,R;if(v==="exponential")T=Cm;else if(v==="interval")T=dh;else if(v==="categorical"){T=Im,I=Object.create(null);for(const k of l.stops)I[k[0]]=k[1];R=typeof l.stops[0][0]}else{if(v!=="identity")throw new Error(`Unknown function type "${v}"`);T=Pm}if(d){const k={},F=[];for(let q=0;qq[0]),evaluate:({zoom:q},Z)=>Cm({stops:z,base:l.base},o,q).evaluate(q,Z)}}if(m){const k=v==="exponential"?{name:"exponential",base:l.base!==void 0?l.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:Mn.interpolationFactor.bind(void 0,k),zoomStops:l.stops.map(F=>F[0]),evaluate:({zoom:F})=>T(l,o,F,I,R)}}return{kind:"source",evaluate(k,F){const z=F&&F.properties?F.properties[l.property]:void 0;return z===void 0?_l(l.default,o.default):T(l,o,z,I,R)}}}function _l(l,o,h){return l!==void 0?l:o!==void 0?o:h!==void 0?h:void 0}function Im(l,o,h,d,m){return _l(typeof h===m?d[h]:void 0,l.default,o.default)}function dh(l,o,h){if(fi(h)!=="number")return _l(l.default,o.default);const d=l.stops.length;if(d===1||h<=l.stops[0][0])return l.stops[0][1];if(h>=l.stops[d-1][0])return l.stops[d-1][1];const m=tt(l.stops.map(v=>v[0]),h);return l.stops[m][1]}function Cm(l,o,h){const d=l.base!==void 0?l.base:1;if(fi(h)!=="number")return _l(l.default,o.default);const m=l.stops.length;if(m===1||h<=l.stops[0][0])return l.stops[0][1];if(h>=l.stops[m-1][0])return l.stops[m-1][1];const v=tt(l.stops.map(k=>k[0]),h),x=function(k,F,z,$){const q=$-z,Z=k-z;return q===0?0:F===1?Z/q:(Math.pow(F,Z)-1)/(Math.pow(F,q)-1)}(h,d,l.stops[v][0],l.stops[v+1][0]),T=l.stops[v][1],I=l.stops[v+1][1],R=Pn[o.type]||$b;return typeof T.evaluate=="function"?{evaluate(...k){const F=T.evaluate.apply(void 0,k),z=I.evaluate.apply(void 0,k);if(F!==void 0&&z!==void 0)return R(F,z,x,l.colorSpace)}}:R(T,I,x,l.colorSpace)}function Pm(l,o,h){switch(o.type){case"color":h=ui.parse(h);break;case"formatted":h=fs.fromString(h.toString());break;case"resolvedImage":h=cs.fromString(h.toString());break;case"padding":h=as.parse(h);break;default:fi(h)===o.type||o.type==="enum"&&o.values[h]||(h=void 0)}return _l(h,l.default,o.default)}gr.register(dl,{error:[{kind:"error"},[$t],(l,[o])=>{throw new Yi(o.evaluate(l))}],typeof:[$t,[Nt],(l,[o])=>V(Zi(o.evaluate(l)))],"to-rgba":[j(et,4),[wi],(l,[o])=>{const[h,d,m,v]=o.evaluate(l).rgb;return[255*h,255*d,255*m,v]}],rgb:[wi,[et,et,et],kd],rgba:[wi,[et,et,et,et],kd],has:{type:kt,overloads:[[[$t],(l,[o])=>Od(o.evaluate(l),l.properties())],[[$t,Qi],(l,[o,h])=>Od(o.evaluate(l),h.evaluate(l))]]},get:{type:Nt,overloads:[[[$t],(l,[o])=>Dd(o.evaluate(l),l.properties())],[[$t,Qi],(l,[o,h])=>Dd(o.evaluate(l),h.evaluate(l))]]},"feature-state":[Nt,[$t],(l,[o])=>Dd(o.evaluate(l),l.featureState||{})],properties:[Qi,[],l=>l.properties()],"geometry-type":[$t,[],l=>l.geometryType()],id:[Nt,[],l=>l.id()],zoom:[et,[],l=>l.globals.zoom],"heatmap-density":[et,[],l=>l.globals.heatmapDensity||0],"line-progress":[et,[],l=>l.globals.lineProgress||0],accumulated:[Nt,[],l=>l.globals.accumulated===void 0?null:l.globals.accumulated],"+":[et,Fa(et),(l,o)=>{let h=0;for(const d of o)h+=d.evaluate(l);return h}],"*":[et,Fa(et),(l,o)=>{let h=1;for(const d of o)h*=d.evaluate(l);return h}],"-":{type:et,overloads:[[[et,et],(l,[o,h])=>o.evaluate(l)-h.evaluate(l)],[[et],(l,[o])=>-o.evaluate(l)]]},"/":[et,[et,et],(l,[o,h])=>o.evaluate(l)/h.evaluate(l)],"%":[et,[et,et],(l,[o,h])=>o.evaluate(l)%h.evaluate(l)],ln2:[et,[],()=>Math.LN2],pi:[et,[],()=>Math.PI],e:[et,[],()=>Math.E],"^":[et,[et,et],(l,[o,h])=>Math.pow(o.evaluate(l),h.evaluate(l))],sqrt:[et,[et],(l,[o])=>Math.sqrt(o.evaluate(l))],log10:[et,[et],(l,[o])=>Math.log(o.evaluate(l))/Math.LN10],ln:[et,[et],(l,[o])=>Math.log(o.evaluate(l))],log2:[et,[et],(l,[o])=>Math.log(o.evaluate(l))/Math.LN2],sin:[et,[et],(l,[o])=>Math.sin(o.evaluate(l))],cos:[et,[et],(l,[o])=>Math.cos(o.evaluate(l))],tan:[et,[et],(l,[o])=>Math.tan(o.evaluate(l))],asin:[et,[et],(l,[o])=>Math.asin(o.evaluate(l))],acos:[et,[et],(l,[o])=>Math.acos(o.evaluate(l))],atan:[et,[et],(l,[o])=>Math.atan(o.evaluate(l))],min:[et,Fa(et),(l,o)=>Math.min(...o.map(h=>h.evaluate(l)))],max:[et,Fa(et),(l,o)=>Math.max(...o.map(h=>h.evaluate(l)))],abs:[et,[et],(l,[o])=>Math.abs(o.evaluate(l))],round:[et,[et],(l,[o])=>{const h=o.evaluate(l);return h<0?-Math.round(-h):Math.round(h)}],floor:[et,[et],(l,[o])=>Math.floor(o.evaluate(l))],ceil:[et,[et],(l,[o])=>Math.ceil(o.evaluate(l))],"filter-==":[kt,[$t,Nt],(l,[o,h])=>l.properties()[o.value]===h.value],"filter-id-==":[kt,[Nt],(l,[o])=>l.id()===o.value],"filter-type-==":[kt,[$t],(l,[o])=>l.geometryType()===o.value],"filter-<":[kt,[$t,Nt],(l,[o,h])=>{const d=l.properties()[o.value],m=h.value;return typeof d==typeof m&&d{const h=l.id(),d=o.value;return typeof h==typeof d&&h":[kt,[$t,Nt],(l,[o,h])=>{const d=l.properties()[o.value],m=h.value;return typeof d==typeof m&&d>m}],"filter-id->":[kt,[Nt],(l,[o])=>{const h=l.id(),d=o.value;return typeof h==typeof d&&h>d}],"filter-<=":[kt,[$t,Nt],(l,[o,h])=>{const d=l.properties()[o.value],m=h.value;return typeof d==typeof m&&d<=m}],"filter-id-<=":[kt,[Nt],(l,[o])=>{const h=l.id(),d=o.value;return typeof h==typeof d&&h<=d}],"filter->=":[kt,[$t,Nt],(l,[o,h])=>{const d=l.properties()[o.value],m=h.value;return typeof d==typeof m&&d>=m}],"filter-id->=":[kt,[Nt],(l,[o])=>{const h=l.id(),d=o.value;return typeof h==typeof d&&h>=d}],"filter-has":[kt,[Nt],(l,[o])=>o.value in l.properties()],"filter-has-id":[kt,[],l=>l.id()!==null&&l.id()!==void 0],"filter-type-in":[kt,[j($t)],(l,[o])=>o.value.indexOf(l.geometryType())>=0],"filter-id-in":[kt,[j(Nt)],(l,[o])=>o.value.indexOf(l.id())>=0],"filter-in-small":[kt,[$t,j(Nt)],(l,[o,h])=>h.value.indexOf(l.properties()[o.value])>=0],"filter-in-large":[kt,[$t,j(Nt)],(l,[o,h])=>function(d,m,v,x){for(;v<=x;){const T=v+x>>1;if(m[T]===d)return!0;m[T]>d?x=T-1:v=T+1}return!1}(l.properties()[o.value],h.value,0,h.value.length-1)],all:{type:kt,overloads:[[[kt,kt],(l,[o,h])=>o.evaluate(l)&&h.evaluate(l)],[Fa(kt),(l,o)=>{for(const h of o)if(!h.evaluate(l))return!1;return!0}]]},any:{type:kt,overloads:[[[kt,kt],(l,[o,h])=>o.evaluate(l)||h.evaluate(l)],[Fa(kt),(l,o)=>{for(const h of o)if(h.evaluate(l))return!0;return!1}]]},"!":[kt,[kt],(l,[o])=>!o.evaluate(l)],"is-supported-script":[kt,[$t],(l,[o])=>{const h=l.globals&&l.globals.isSupportedScript;return!h||h(o.evaluate(l))}],upcase:[$t,[$t],(l,[o])=>o.evaluate(l).toUpperCase()],downcase:[$t,[$t],(l,[o])=>o.evaluate(l).toLowerCase()],concat:[$t,Fa(Nt),(l,o)=>o.map(h=>Ws(h.evaluate(l))).join("")],"resolved-locale":[$t,[dr],(l,[o])=>o.evaluate(l).resolvedLocale()]});class ph{constructor(o,h){var d;this.expression=o,this._warningHistory={},this._evaluator=new ul,this._defaultValue=h?(d=h).type==="color"&&fh(d.default)?new ui(0,0,0,0):d.type==="color"?ui.parse(d.default)||null:d.type==="padding"?as.parse(d.default)||null:d.type==="variableAnchorOffsetCollection"?ls.parse(d.default)||null:d.default===void 0?null:d.default:null,this._enumValues=h&&h.type==="enum"?h.values:null}evaluateWithoutErrorHandling(o,h,d,m,v,x){return this._evaluator.globals=o,this._evaluator.feature=h,this._evaluator.featureState=d,this._evaluator.canonical=m,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(o,h,d,m,v,x){this._evaluator.globals=o,this._evaluator.feature=h||null,this._evaluator.featureState=d||null,this._evaluator.canonical=m,this._evaluator.availableImages=v||null,this._evaluator.formattedSection=x||null;try{const T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new Yi(`Expected value to be one of ${Object.keys(this._enumValues).map(I=>JSON.stringify(I)).join(", ")}, but found ${JSON.stringify(T)} instead.`);return T}catch(T){return this._warningHistory[T.message]||(this._warningHistory[T.message]=!0,typeof console<"u"&&console.warn(T.message)),this._defaultValue}}}function gh(l){return Array.isArray(l)&&l.length>0&&typeof l[0]=="string"&&l[0]in dl}function yl(l,o){const h=new ro(dl,zc,[],o?function(m){const v={color:wi,string:$t,number:et,enum:$t,boolean:kt,formatted:Dr,padding:Fr,resolvedImage:Zn,variableAnchorOffsetCollection:le};return m.type==="array"?j(v[m.value]||Nt,m.length):v[m.type]}(o):void 0),d=h.parse(l,void 0,void 0,void 0,o&&o.type==="string"?{typeAnnotation:"coerce"}:void 0);return d?hh(new ph(d,o)):gl(h.errors)}class bl{constructor(o,h){this.kind=o,this._styleExpression=h,this.isStateDependent=o!=="constant"&&!pl(h.expression)}evaluateWithoutErrorHandling(o,h,d,m,v,x){return this._styleExpression.evaluateWithoutErrorHandling(o,h,d,m,v,x)}evaluate(o,h,d,m,v,x){return this._styleExpression.evaluate(o,h,d,m,v,x)}}class vl{constructor(o,h,d,m){this.kind=o,this.zoomStops=d,this._styleExpression=h,this.isStateDependent=o!=="camera"&&!pl(h.expression),this.interpolationType=m}evaluateWithoutErrorHandling(o,h,d,m,v,x){return this._styleExpression.evaluateWithoutErrorHandling(o,h,d,m,v,x)}evaluate(o,h,d,m,v,x){return this._styleExpression.evaluate(o,h,d,m,v,x)}interpolationFactor(o,h,d){return this.interpolationType?Mn.interpolationFactor(this.interpolationType,o,h,d):0}}function Nd(l,o){const h=yl(l,o);if(h.result==="error")return h;const d=h.value.expression,m=Uc(d);if(!m&&!ml(o))return gl([new mi("","data expressions not supported")]);const v=Vc(d,["zoom"]);if(!v&&!Em(o))return gl([new mi("","zoom expressions not supported")]);const x=jc(d);return x||v?x instanceof mi?gl([x]):x instanceof Mn&&!Fd(o)?gl([new mi("",'"interpolate" expressions cannot be used with this property')]):hh(x?new vl(m?"camera":"composite",h.value,x.labels,x instanceof Mn?x.interpolation:void 0):new bl(m?"constant":"source",h.value)):gl([new mi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class xl{constructor(o,h){this._parameters=o,this._specification=h,Jt(this,Am(this._parameters,this._specification))}static deserialize(o){return new xl(o._parameters,o._specification)}static serialize(o){return{_parameters:o._parameters,_specification:o._specification}}}function jc(l){let o=null;if(l instanceof pr)o=jc(l.result);else if(l instanceof sh){for(const h of l.args)if(o=jc(h),o)break}else(l instanceof vt||l instanceof Mn)&&l.input instanceof gr&&l.input.name==="zoom"&&(o=l);return o instanceof mi||l.eachChild(h=>{const d=jc(h);d instanceof mi?o=d:!o&&d?o=new mi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&d&&o!==d&&(o=new mi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function mh(l){if(l===!0||l===!1)return!0;if(!Array.isArray(l)||l.length===0)return!1;switch(l[0]){case"has":return l.length>=2&&l[1]!=="$id"&&l[1]!=="$type";case"in":return l.length>=3&&(typeof l[1]!="string"||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return l.length!==3||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const o of l.slice(1))if(!mh(o)&&typeof o!="boolean")return!1;return!0;default:return!0}}const _h={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Bd(l){if(l==null)return{filter:()=>!0,needGeometry:!1};mh(l)||(l=yh(l));const o=yl(l,_h);if(o.result==="error")throw new Error(o.value.map(h=>`${h.key}: ${h.message}`).join(", "));return{filter:(h,d,m)=>o.value.evaluate(h,d,{},m),needGeometry:Mm(l)}}function Hb(l,o){return lo?1:0}function Mm(l){if(!Array.isArray(l))return!1;if(l[0]==="within"||l[0]==="distance")return!0;for(let o=1;o"||o==="<="||o===">="?Ld(l[1],l[2],o):o==="any"?(h=l.slice(1),["any"].concat(h.map(yh))):o==="all"?["all"].concat(l.slice(1).map(yh)):o==="none"?["all"].concat(l.slice(1).map(yh).map(en)):o==="in"?$c(l[1],l.slice(2)):o==="!in"?en($c(l[1],l.slice(2))):o==="has"?Hc(l[1]):o!=="!has"||en(Hc(l[1]));var h}function Ld(l,o,h){switch(l){case"$type":return[`filter-type-${h}`,o];case"$id":return[`filter-id-${h}`,o];default:return[`filter-${h}`,l,o]}}function $c(l,o){if(o.length===0)return!1;switch(l){case"$type":return["filter-type-in",["literal",o]];case"$id":return["filter-id-in",["literal",o]];default:return o.length>200&&!o.some(h=>typeof h!=typeof o[0])?["filter-in-large",l,["literal",o.sort(Hb)]]:["filter-in-small",l,["literal",o]]}}function Hc(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function en(l){return["!",l]}function Na(l){const o=typeof l;if(o==="number"||o==="boolean"||o==="string"||l==null)return JSON.stringify(l);if(Array.isArray(l)){let m="[";for(const v of l)m+=`${Na(v)},`;return`${m}]`}const h=Object.keys(l).sort();let d="{";for(let m=0;md.maximum?[new je(o,h,`${h} is greater than the maximum value ${d.maximum}`)]:[]}function bh(l){const o=l.valueSpec,h=ps(l.value.type);let d,m,v,x={};const T=h!=="categorical"&&l.value.property===void 0,I=!T,R=fi(l.value.stops)==="array"&&fi(l.value.stops[0])==="array"&&fi(l.value.stops[0][0])==="object",k=Yn({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function($){if(h==="identity")return[new je($.key,$.value,'identity function may not have a "stops" property')];let q=[];const Z=$.value;return q=q.concat(Wc({key:$.key,value:Z,valueSpec:$.valueSpec,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:F})),fi(Z)==="array"&&Z.length===0&&q.push(new je($.key,Z,"array must have at least one stop")),q},default:function($){return $.validateSpec({key:$.key,value:$.value,valueSpec:o,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec})}}});return h==="identity"&&T&&k.push(new je(l.key,l.value,'missing required property "property"')),h==="identity"||l.value.stops||k.push(new je(l.key,l.value,'missing required property "stops"')),h==="exponential"&&l.valueSpec.expression&&!Fd(l.valueSpec)&&k.push(new je(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(I&&!ml(l.valueSpec)?k.push(new je(l.key,l.value,"property functions not supported")):T&&!Em(l.valueSpec)&&k.push(new je(l.key,l.value,"zoom functions not supported"))),h!=="categorical"&&!R||l.value.property!==void 0||k.push(new je(l.key,l.value,'"property" property is required')),k;function F($){let q=[];const Z=$.value,oe=$.key;if(fi(Z)!=="array")return[new je(oe,Z,`array expected, ${fi(Z)} found`)];if(Z.length!==2)return[new je(oe,Z,`array length 2 expected, length ${Z.length} found`)];if(R){if(fi(Z[0])!=="object")return[new je(oe,Z,`object expected, ${fi(Z[0])} found`)];if(Z[0].zoom===void 0)return[new je(oe,Z,"object stop key must have zoom")];if(Z[0].value===void 0)return[new je(oe,Z,"object stop key must have value")];if(v&&v>ps(Z[0].zoom))return[new je(oe,Z[0].zoom,"stop zoom values must appear in ascending order")];ps(Z[0].zoom)!==v&&(v=ps(Z[0].zoom),m=void 0,x={}),q=q.concat(Yn({key:`${oe}[0]`,value:Z[0],valueSpec:{zoom:{}},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:zd,value:z}}))}else q=q.concat(z({key:`${oe}[0]`,value:Z[0],valueSpec:{},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec},Z));return gh(Nr(Z[1]))?q.concat([new je(`${oe}[1]`,Z[1],"expressions are not allowed in function stops.")]):q.concat($.validateSpec({key:`${oe}[1]`,value:Z[1],valueSpec:o,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec}))}function z($,q){const Z=fi($.value),oe=ps($.value),ue=$.value!==null?$.value:q;if(d){if(Z!==d)return[new je($.key,ue,`${Z} stop domain type must match previous stop domain type ${d}`)]}else d=Z;if(Z!=="number"&&Z!=="string"&&Z!=="boolean")return[new je($.key,ue,"stop domain value must be a number, string, or boolean")];if(Z!=="number"&&h!=="categorical"){let Me=`number expected, ${Z} found`;return ml(o)&&h===void 0&&(Me+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new je($.key,ue,Me)]}return h!=="categorical"||Z!=="number"||isFinite(oe)&&Math.floor(oe)===oe?h!=="categorical"&&Z==="number"&&m!==void 0&&oenew je(`${l.key}${d.key}`,l.value,d.message));const h=o.value.expression||o.value._styleExpression.expression;if(l.expressionContext==="property"&&l.propertyKey==="text-font"&&!h.outputDefined())return[new je(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if(l.expressionContext==="property"&&l.propertyType==="layout"&&!pl(h))return[new je(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if(l.expressionContext==="filter"&&!pl(h))return[new je(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&l.expressionContext.indexOf("cluster")===0){if(!Vc(h,["zoom","feature-state"]))return[new je(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(l.expressionContext==="cluster-initial"&&!Uc(h))return[new je(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ao(l){const o=l.key,h=l.value,d=l.valueSpec,m=[];return Array.isArray(d.values)?d.values.indexOf(ps(h))===-1&&m.push(new je(o,h,`expected one of [${d.values.join(", ")}], ${JSON.stringify(h)} found`)):Object.keys(d.values).indexOf(ps(h))===-1&&m.push(new je(o,h,`expected one of [${Object.keys(d.values).join(", ")}], ${JSON.stringify(h)} found`)),m}function Ud(l){return mh(Nr(l.value))?wl(Jt({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):vh(l)}function vh(l){const o=l.value,h=l.key;if(fi(o)!=="array")return[new je(h,o,`array expected, ${fi(o)} found`)];const d=l.styleSpec;let m,v=[];if(o.length<1)return[new je(h,o,"filter array must have at least 1 element")];switch(v=v.concat(Ao({key:`${h}[0]`,value:o[0],valueSpec:d.filter_operator,style:l.style,styleSpec:l.styleSpec})),ps(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&ps(o[1])==="$type"&&v.push(new je(h,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":o.length!==3&&v.push(new je(h,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(m=fi(o[1]),m!=="string"&&v.push(new je(`${h}[1]`,o[1],`string expected, ${m} found`)));for(let x=2;x{R in h&&o.push(new je(d,h[R],`"${R}" is prohibited for ref layers`))}),m.layers.forEach(R=>{ps(R.id)===T&&(I=R)}),I?I.ref?o.push(new je(d,h.ref,"ref cannot reference another ref layer")):x=ps(I.type):o.push(new je(d,h.ref,`ref layer "${T}" not found`))}else if(x!=="background")if(h.source){const I=m.sources&&m.sources[h.source],R=I&&ps(I.type);I?R==="vector"&&x==="raster"?o.push(new je(d,h.source,`layer "${h.id}" requires a raster source`)):R!=="raster-dem"&&x==="hillshade"?o.push(new je(d,h.source,`layer "${h.id}" requires a raster-dem source`)):R==="raster"&&x!=="raster"?o.push(new je(d,h.source,`layer "${h.id}" requires a vector source`)):R!=="vector"||h["source-layer"]?R==="raster-dem"&&x!=="hillshade"?o.push(new je(d,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!h.paint||!h.paint["line-gradient"]||R==="geojson"&&I.lineMetrics||o.push(new je(d,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new je(d,h,`layer "${h.id}" must specify a "source-layer"`)):o.push(new je(d,h.source,`source "${h.source}" not found`))}else o.push(new je(d,h,'missing required property "source"'));return o=o.concat(Yn({key:d,value:h,valueSpec:v.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${d}.type`,value:h.type,valueSpec:v.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:h,objectKey:"type"}),filter:Ud,layout:I=>Yn({layer:h,key:I.key,value:I.value,style:I.style,styleSpec:I.styleSpec,validateSpec:I.validateSpec,objectElementValidators:{"*":R=>jd(Jt({layerType:x},R))}}),paint:I=>Yn({layer:h,key:I.key,value:I.value,style:I.style,styleSpec:I.styleSpec,validateSpec:I.validateSpec,objectElementValidators:{"*":R=>xh(Jt({layerType:x},R))}})}})),o}function Ba(l){const o=l.value,h=l.key,d=fi(o);return d!=="string"?[new je(h,o,`string expected, ${d} found`)]:[]}const wh={promoteId:function({key:l,value:o}){if(fi(o)==="string")return Ba({key:l,value:o});{const h=[];for(const d in o)h.push(...Ba({key:`${l}.${d}`,value:o[d]}));return h}}};function qc(l){const o=l.value,h=l.key,d=l.styleSpec,m=l.style,v=l.validateSpec;if(!o.type)return[new je(h,o,'"type" is required')];const x=ps(o.type);let T;switch(x){case"vector":case"raster":return T=Yn({key:h,value:o,valueSpec:d[`source_${x.replace("-","_")}`],style:l.style,styleSpec:d,objectElementValidators:wh,validateSpec:v}),T;case"raster-dem":return T=function(I){var R;const k=(R=I.sourceName)!==null&&R!==void 0?R:"",F=I.value,z=I.styleSpec,$=z.source_raster_dem,q=I.style;let Z=[];const oe=fi(F);if(F===void 0)return Z;if(oe!=="object")return Z.push(new je("source_raster_dem",F,`object expected, ${oe} found`)),Z;const ue=ps(F.encoding)==="custom",Me=["redFactor","greenFactor","blueFactor","baseShift"],be=I.value.encoding?`"${I.value.encoding}"`:"Default";for(const Ae in F)!ue&&Me.includes(Ae)?Z.push(new je(Ae,F[Ae],`In "${k}": "${Ae}" is only valid when "encoding" is set to "custom". ${be} encoding found`)):$[Ae]?Z=Z.concat(I.validateSpec({key:Ae,value:F[Ae],valueSpec:$[Ae],validateSpec:I.validateSpec,style:q,styleSpec:z})):Z.push(new je(Ae,F[Ae],`unknown property "${Ae}"`));return Z}({sourceName:h,value:o,style:l.style,styleSpec:d,validateSpec:v}),T;case"geojson":if(T=Yn({key:h,value:o,valueSpec:d.source_geojson,style:m,styleSpec:d,validateSpec:v,objectElementValidators:wh}),o.cluster)for(const I in o.clusterProperties){const[R,k]=o.clusterProperties[I],F=typeof R=="string"?[R,["accumulated"],["get",I]]:R;T.push(...wl({key:`${h}.${I}.map`,value:k,validateSpec:v,expressionContext:"cluster-map"})),T.push(...wl({key:`${h}.${I}.reduce`,value:F,validateSpec:v,expressionContext:"cluster-reduce"}))}return T;case"video":return Yn({key:h,value:o,valueSpec:d.source_video,style:m,validateSpec:v,styleSpec:d});case"image":return Yn({key:h,value:o,valueSpec:d.source_image,style:m,validateSpec:v,styleSpec:d});case"canvas":return[new je(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ao({key:`${h}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:m,validateSpec:v,styleSpec:d})}}function Hd(l){const o=l.value,h=l.styleSpec,d=h.light,m=l.style;let v=[];const x=fi(o);if(o===void 0)return v;if(x!=="object")return v=v.concat([new je("light",o,`object expected, ${x} found`)]),v;for(const T in o){const I=T.match(/^(.*)-transition$/);v=v.concat(I&&d[I[1]]&&d[I[1]].transition?l.validateSpec({key:T,value:o[T],valueSpec:h.transition,validateSpec:l.validateSpec,style:m,styleSpec:h}):d[T]?l.validateSpec({key:T,value:o[T],valueSpec:d[T],validateSpec:l.validateSpec,style:m,styleSpec:h}):[new je(T,o[T],`unknown property "${T}"`)])}return v}function Wd(l){const o=l.value,h=l.styleSpec,d=h.sky,m=l.style,v=fi(o);if(o===void 0)return[];if(v!=="object")return[new je("sky",o,`object expected, ${v} found`)];let x=[];for(const T in o)x=x.concat(d[T]?l.validateSpec({key:T,value:o[T],valueSpec:d[T],style:m,styleSpec:h}):[new je(T,o[T],`unknown property "${T}"`)]);return x}function qd(l){const o=l.value,h=l.styleSpec,d=h.terrain,m=l.style;let v=[];const x=fi(o);if(o===void 0)return v;if(x!=="object")return v=v.concat([new je("terrain",o,`object expected, ${x} found`)]),v;for(const T in o)v=v.concat(d[T]?l.validateSpec({key:T,value:o[T],valueSpec:d[T],validateSpec:l.validateSpec,style:m,styleSpec:h}):[new je(T,o[T],`unknown property "${T}"`)]);return v}function Xd(l){let o=[];const h=l.value,d=l.key;if(Array.isArray(h)){const m=[],v=[];for(const x in h)h[x].id&&m.includes(h[x].id)&&o.push(new je(d,h,`all the sprites' ids must be unique, but ${h[x].id} is duplicated`)),m.push(h[x].id),h[x].url&&v.includes(h[x].url)&&o.push(new je(d,h,`all the sprites' URLs must be unique, but ${h[x].url} is duplicated`)),v.push(h[x].url),o=o.concat(Yn({key:`${d}[${x}]`,value:h[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return o}return Ba({key:d,value:h})}const Th={"*":()=>[],array:Wc,boolean:function(l){const o=l.value,h=l.key,d=fi(o);return d!=="boolean"?[new je(h,o,`boolean expected, ${d} found`)]:[]},number:zd,color:function(l){const o=l.key,h=l.value,d=fi(h);return d!=="string"?[new je(o,h,`color expected, ${d} found`)]:ui.parse(String(h))?[]:[new je(o,h,`color expected, "${h}" found`)]},constants:km,enum:Ao,filter:Ud,function:bh,layer:$d,object:Yn,source:qc,light:Hd,sky:Wd,terrain:qd,projection:function(l){const o=l.value,h=l.styleSpec,d=h.projection,m=l.style,v=fi(o);if(o===void 0)return[];if(v!=="object")return[new je("projection",o,`object expected, ${v} found`)];let x=[];for(const T in o)x=x.concat(d[T]?l.validateSpec({key:T,value:o[T],valueSpec:d[T],style:m,styleSpec:h}):[new je(T,o[T],`unknown property "${T}"`)]);return x},string:Ba,formatted:function(l){return Ba(l).length===0?[]:wl(l)},resolvedImage:function(l){return Ba(l).length===0?[]:wl(l)},padding:function(l){const o=l.key,h=l.value;if(fi(h)==="array"){if(h.length<1||h.length>4)return[new je(o,h,`padding requires 1 to 4 values; ${h.length} values found`)];const d={type:"number"};let m=[];for(let v=0;v[]}})),l.constants&&(h=h.concat(km({key:"constants",value:l.constants,style:l,styleSpec:o,validateSpec:Tl}))),Zd(h)}function ao(l){return function(o){return l({...o,validateSpec:Tl})}}function Zd(l){return[].concat(l).sort((o,h)=>o.line-h.line)}function Br(l){return function(...o){return Zd(l.apply(this,o))}}mr.source=Br(ao(qc)),mr.sprite=Br(ao(Xd)),mr.glyphs=Br(ao(Om)),mr.light=Br(ao(Hd)),mr.sky=Br(ao(Wd)),mr.terrain=Br(ao(qd)),mr.layer=Br(ao($d)),mr.filter=Br(ao(Ud)),mr.paintProperty=Br(ao(xh)),mr.layoutProperty=Br(ao(jd));const La=mr,Wb=La.light,qb=La.sky,Dm=La.paintProperty,Fm=La.layoutProperty;function Yd(l,o){let h=!1;if(o&&o.length)for(const d of o)l.fire(new ve(new Error(d.message))),h=!0;return h}class Sl{constructor(o,h,d){const m=this.cells=[];if(o instanceof ArrayBuffer){this.arrayBuffer=o;const x=new Int32Array(this.arrayBuffer);o=x[0],this.d=(h=x[1])+2*(d=x[2]);for(let I=0;I=F[q+0]&&m>=F[q+1])?(T[$]=!0,x.push(k[$])):T[$]=!1}}}}_forEachCell(o,h,d,m,v,x,T,I){const R=this._convertToCellCoord(o),k=this._convertToCellCoord(h),F=this._convertToCellCoord(d),z=this._convertToCellCoord(m);for(let $=R;$<=F;$++)for(let q=k;q<=z;q++){const Z=this.d*q+$;if((!I||I(this._convertFromCellCoord($),this._convertFromCellCoord(q),this._convertFromCellCoord($+1),this._convertFromCellCoord(q+1)))&&v.call(this,o,h,d,m,Z,x,T,I))return}}_convertFromCellCoord(o){return(o-this.padding)/this.scale}_convertToCellCoord(o){return Math.max(0,Math.min(this.d-1,Math.floor(o*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const o=this.cells,h=3+this.cells.length+1+1;let d=0;for(let x=0;x=0)continue;const x=l[v];m[v]=_r[h].shallow.indexOf(v)>=0?x:El(x,o)}l instanceof Error&&(m.message=l.message)}if(m.$name)throw new Error("$name property is reserved for worker serialization logic.");return h!=="Object"&&(m.$name=h),m}function Al(l){if(Nm(l))return l;if(Array.isArray(l))return l.map(Al);if(typeof l!="object")throw new Error("can't deserialize object of type "+typeof l);const o=Kd(l)||"Object";if(!_r[o])throw new Error(`can't deserialize unregistered class ${o}`);const{klass:h}=_r[o];if(!h)throw new Error(`can't deserialize unregistered class ${o}`);if(h.deserialize)return h.deserialize(l);const d=Object.create(h.prototype);for(const m of Object.keys(l)){if(m==="$name")continue;const v=l[m];d[m]=_r[o].shallow.indexOf(m)>=0?v:Al(v)}return d}class Jd{constructor(){this.first=!0}update(o,h){const d=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=d,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=d,!0):(this.lastFloorZoom>d?(this.lastIntegerZoom=d+1,this.lastIntegerZoomTime=h):this.lastFloorZooml>=128&&l<=255,"Hangul Jamo":l=>l>=4352&&l<=4607,Khmer:l=>l>=6016&&l<=6143,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Katakana:l=>l>=12448&&l<=12543,Kanbun:l=>l>=12688&&l<=12703,"CJK Strokes":l=>l>=12736&&l<=12783,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"Private Use Area":l=>l>=57344&&l<=63743,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function Gd(l){for(const o of l)if(ep(o.charCodeAt(0)))return!0;return!1}function Xb(l){for(const o of l)if(!Il(o.charCodeAt(0)))return!1;return!0}function Qd(l){const o=l.map(h=>{try{return new RegExp(`\\p{sc=${h}}`,"u").source}catch{return null}}).filter(h=>h);return new RegExp(o.join("|"),"u")}const Zb=Qd(["Arab","Dupl","Mong","Ougr","Syrc"]);function Il(l){return!Zb.test(String.fromCodePoint(l))}const Bm=Qd(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ep(l){return!(l!==746&&l!==747&&(l<4352||!(ri["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||ri["CJK Compatibility"](l)||ri["CJK Strokes"](l)||!(!ri["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||l===12336)||ri["Enclosed CJK Letters and Months"](l)||ri["Ideographic Description Characters"](l)||ri.Kanbun(l)||ri.Katakana(l)&&l!==12540||!(!ri["Halfwidth and Fullwidth Forms"](l)||l===65288||l===65289||l===65293||l>=65306&&l<=65310||l===65339||l===65341||l===65343||l>=65371&&l<=65503||l===65507||l>=65512&&l<=65519)||!(!ri["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||ri["Vertical Forms"](l)||ri["Yijing Hexagram Symbols"](l)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(l))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(l))||Bm.test(String.fromCodePoint(l)))))}function Lm(l){return!(ep(l)||function(o){return!!(ri["Latin-1 Supplement"](o)&&(o===167||o===169||o===174||o===177||o===188||o===189||o===190||o===215||o===247)||ri["General Punctuation"](o)&&(o===8214||o===8224||o===8225||o===8240||o===8241||o===8251||o===8252||o===8258||o===8263||o===8264||o===8265||o===8273)||ri["Letterlike Symbols"](o)||ri["Number Forms"](o)||ri["Miscellaneous Technical"](o)&&(o>=8960&&o<=8967||o>=8972&&o<=8991||o>=8996&&o<=9e3||o===9003||o>=9085&&o<=9114||o>=9150&&o<=9165||o===9167||o>=9169&&o<=9179||o>=9186&&o<=9215)||ri["Control Pictures"](o)&&o!==9251||ri["Optical Character Recognition"](o)||ri["Enclosed Alphanumerics"](o)||ri["Geometric Shapes"](o)||ri["Miscellaneous Symbols"](o)&&!(o>=9754&&o<=9759)||ri["Miscellaneous Symbols and Arrows"](o)&&(o>=11026&&o<=11055||o>=11088&&o<=11097||o>=11192&&o<=11243)||ri["CJK Symbols and Punctuation"](o)||ri.Katakana(o)||ri["Private Use Area"](o)||ri["CJK Compatibility Forms"](o)||ri["Small Form Variants"](o)||ri["Halfwidth and Fullwidth Forms"](o)||o===8734||o===8756||o===8757||o>=9984&&o<=10087||o>=10102&&o<=10131||o===65532||o===65533)}(l))}const Yb=Qd(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function tp(l){return Yb.test(String.fromCodePoint(l))}function Kb(l,o){return!(!o&&tp(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||ri.Khmer(l))}function Jb(l){for(const o of l)if(tp(o.charCodeAt(0)))return!0;return!1}const Kn=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(l){this.pluginStatus=l.pluginStatus,this.pluginURL=l.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(l){this.applyArabicShaping=l.applyArabicShaping,this.processBidirectionalText=l.processBidirectionalText,this.processStyledBidirectionalText=l.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class zi{constructor(o,h){this.zoom=o,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Jd,this.transition={})}isSupportedScript(o){return function(h,d){for(const m of h)if(!Kb(m.charCodeAt(0),d))return!1;return!0}(o,Kn.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const o=this.zoom,h=o-Math.floor(o),d=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*d}:{fromScale:.5,toScale:1,t:1-(1-d)*h}}}class Cl{constructor(o,h){this.property=o,this.value=h,this.expression=function(d,m){if(fh(d))return new xl(d,m);if(gh(d)){const v=Nd(d,m);if(v.result==="error")throw new Error(v.value.map(x=>`${x.key}: ${x.message}`).join(", "));return v.value}{let v=d;return m.type==="color"&&typeof d=="string"?v=ui.parse(d):m.type!=="padding"||typeof d!="number"&&!Array.isArray(d)?m.type==="variableAnchorOffsetCollection"&&Array.isArray(d)&&(v=ls.parse(d)):v=as.parse(d),{kind:"constant",evaluate:()=>v}}}(h===void 0?o.specification.default:h,o.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(o,h,d){return this.property.possiblyEvaluate(this,o,h,d)}}class Eh{constructor(o){this.property=o,this.value=new Cl(o,void 0)}transitioned(o,h){return new zm(this.property,this.value,h,Fe({},o.transition,this.transition),o.now)}untransitioned(){return new zm(this.property,this.value,null,{},0)}}class Ah{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)}getValue(o){return Xe(this._values[o].value.value)}setValue(o,h){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new Eh(this._values[o].property)),this._values[o].value=new Cl(this._values[o].property,h===null?void 0:Xe(h))}getTransition(o){return Xe(this._values[o].transition)}setTransition(o,h){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new Eh(this._values[o].property)),this._values[o].transition=Xe(h)||void 0}serialize(){const o={};for(const h of Object.keys(this._values)){const d=this.getValue(h);d!==void 0&&(o[h]=d);const m=this.getTransition(h);m!==void 0&&(o[`${h}-transition`]=m)}return o}transitioned(o,h){const d=new Xc(this._properties);for(const m of Object.keys(this._values))d._values[m]=this._values[m].transitioned(o,h._values[m]);return d}untransitioned(){const o=new Xc(this._properties);for(const h of Object.keys(this._values))o._values[h]=this._values[h].untransitioned();return o}}class zm{constructor(o,h,d,m,v){this.property=o,this.value=h,this.begin=v+m.delay||0,this.end=this.begin+m.duration||0,o.specification.transition&&(m.delay||m.duration)&&(this.prior=d)}possiblyEvaluate(o,h,d){const m=o.now||0,v=this.value.possiblyEvaluate(o,h,d),x=this.prior;if(x){if(m>this.end)return this.prior=null,v;if(this.value.isDataDriven())return this.prior=null,v;if(m=1)return 1;const R=I*I,k=R*I;return 4*(I<.5?k:3*(I-R)+k-.75)}(T))}}return v}}class Xc{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitioningPropertyValues)}possiblyEvaluate(o,h,d){const m=new Yc(this._properties);for(const v of Object.keys(this._values))m._values[v]=this._values[v].possiblyEvaluate(o,h,d);return m}hasTransition(){for(const o of Object.keys(this._values))if(this._values[o].prior)return!0;return!1}}class Zc{constructor(o){this._properties=o,this._values=Object.create(o.defaultPropertyValues)}hasValue(o){return this._values[o].value!==void 0}getValue(o){return Xe(this._values[o].value)}setValue(o,h){this._values[o]=new Cl(this._values[o].property,h===null?void 0:Xe(h))}serialize(){const o={};for(const h of Object.keys(this._values)){const d=this.getValue(h);d!==void 0&&(o[h]=d)}return o}possiblyEvaluate(o,h,d){const m=new Yc(this._properties);for(const v of Object.keys(this._values))m._values[v]=this._values[v].possiblyEvaluate(o,h,d);return m}}class lo{constructor(o,h,d){this.property=o,this.value=h,this.parameters=d}isConstant(){return this.value.kind==="constant"}constantOr(o){return this.value.kind==="constant"?this.value.value:o}evaluate(o,h,d,m){return this.property.evaluate(this.value,this.parameters,o,h,d,m)}}class Yc{constructor(o){this._properties=o,this._values=Object.create(o.defaultPossiblyEvaluatedValues)}get(o){return this._values[o]}}class Tt{constructor(o){this.specification=o}possiblyEvaluate(o,h){if(o.isDataDriven())throw new Error("Value should not be data driven");return o.expression.evaluate(h)}interpolate(o,h,d){const m=Pn[this.specification.type];return m?m(o,h,d):o}}class Ft{constructor(o,h){this.specification=o,this.overrides=h}possiblyEvaluate(o,h,d,m){return new lo(this,o.expression.kind==="constant"||o.expression.kind==="camera"?{kind:"constant",value:o.expression.evaluate(h,null,{},d,m)}:o.expression,h)}interpolate(o,h,d){if(o.value.kind!=="constant"||h.value.kind!=="constant")return o;if(o.value.value===void 0||h.value.value===void 0)return new lo(this,{kind:"constant",value:void 0},o.parameters);const m=Pn[this.specification.type];if(m){const v=m(o.value.value,h.value.value,d);return new lo(this,{kind:"constant",value:v},o.parameters)}return o}evaluate(o,h,d,m,v,x){return o.kind==="constant"?o.value:o.evaluate(h,d,m,v,x)}}class Ih extends Ft{possiblyEvaluate(o,h,d,m){if(o.value===void 0)return new lo(this,{kind:"constant",value:void 0},h);if(o.expression.kind==="constant"){const v=o.expression.evaluate(h,null,{},d,m),x=o.property.specification.type==="resolvedImage"&&typeof v!="string"?v.name:v,T=this._calculate(x,x,x,h);return new lo(this,{kind:"constant",value:T},h)}if(o.expression.kind==="camera"){const v=this._calculate(o.expression.evaluate({zoom:h.zoom-1}),o.expression.evaluate({zoom:h.zoom}),o.expression.evaluate({zoom:h.zoom+1}),h);return new lo(this,{kind:"constant",value:v},h)}return new lo(this,o.expression,h)}evaluate(o,h,d,m,v,x){if(o.kind==="source"){const T=o.evaluate(h,d,m,v,x);return this._calculate(T,T,T,h)}return o.kind==="composite"?this._calculate(o.evaluate({zoom:Math.floor(h.zoom)-1},d,m),o.evaluate({zoom:Math.floor(h.zoom)},d,m),o.evaluate({zoom:Math.floor(h.zoom)+1},d,m),h):o.value}_calculate(o,h,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:o,to:h}:{from:d,to:h}}interpolate(o){return o}}class Ch{constructor(o){this.specification=o}possiblyEvaluate(o,h,d,m){if(o.value!==void 0){if(o.expression.kind==="constant"){const v=o.expression.evaluate(h,null,{},d,m);return this._calculate(v,v,v,h)}return this._calculate(o.expression.evaluate(new zi(Math.floor(h.zoom-1),h)),o.expression.evaluate(new zi(Math.floor(h.zoom),h)),o.expression.evaluate(new zi(Math.floor(h.zoom+1),h)),h)}}_calculate(o,h,d,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:o,to:h}:{from:d,to:h}}interpolate(o){return o}}class ip{constructor(o){this.specification=o}possiblyEvaluate(o,h,d,m){return!!o.expression.evaluate(h,null,{},d,m)}interpolate(){return!1}}class b{constructor(o){this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const h in o){const d=o[h];d.specification.overridable&&this.overridableProperties.push(h);const m=this.defaultPropertyValues[h]=new Cl(d,void 0),v=this.defaultTransitionablePropertyValues[h]=new Eh(d);this.defaultTransitioningPropertyValues[h]=v.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=m.possiblyEvaluate({})}}}bt("DataDrivenProperty",Ft),bt("DataConstantProperty",Tt),bt("CrossFadedDataDrivenProperty",Ih),bt("CrossFadedProperty",Ch),bt("ColorRampProperty",ip);const r="-transition";class f extends Ue{constructor(o,h){if(super(),this.id=o.id,this.type=o.type,this._featureFilter={filter:()=>!0,needGeometry:!1},o.type!=="custom"&&(this.metadata=o.metadata,this.minzoom=o.minzoom,this.maxzoom=o.maxzoom,o.type!=="background"&&(this.source=o.source,this.sourceLayer=o["source-layer"],this.filter=o.filter),h.layout&&(this._unevaluatedLayout=new Zc(h.layout)),h.paint)){this._transitionablePaint=new Ah(h.paint);for(const d in o.paint)this.setPaintProperty(d,o.paint[d],{validate:!1});for(const d in o.layout)this.setLayoutProperty(d,o.layout[d],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Yc(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(o){return o==="visibility"?this.visibility:this._unevaluatedLayout.getValue(o)}setLayoutProperty(o,h,d={}){h!=null&&this._validate(Fm,`layers.${this.id}.layout.${o}`,o,h,d)||(o!=="visibility"?this._unevaluatedLayout.setValue(o,h):this.visibility=h)}getPaintProperty(o){return o.endsWith(r)?this._transitionablePaint.getTransition(o.slice(0,-11)):this._transitionablePaint.getValue(o)}setPaintProperty(o,h,d={}){if(h!=null&&this._validate(Dm,`layers.${this.id}.paint.${o}`,o,h,d))return!1;if(o.endsWith(r))return this._transitionablePaint.setTransition(o.slice(0,-11),h||void 0),!1;{const m=this._transitionablePaint._values[o],v=m.property.specification["property-type"]==="cross-faded-data-driven",x=m.value.isDataDriven(),T=m.value;this._transitionablePaint.setValue(o,h),this._handleSpecialPaintPropertyUpdate(o);const I=this._transitionablePaint._values[o].value;return I.isDataDriven()||x||v||this._handleOverridablePaintPropertyUpdate(o,T,I)}}_handleSpecialPaintPropertyUpdate(o){}_handleOverridablePaintPropertyUpdate(o,h,d){return!1}isHidden(o){return!!(this.minzoom&&o=this.maxzoom)||this.visibility==="none"}updateTransitions(o){this._transitioningPaint=this._transitionablePaint.transitioned(o,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(o,h){o.getCrossfadeParameters&&(this._crossfadeParameters=o.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(o,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(o,void 0,h)}serialize(){const o={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&&(o.layout=o.layout||{},o.layout.visibility=this.visibility),Je(o,(h,d)=>!(h===void 0||d==="layout"&&!Object.keys(h).length||d==="paint"&&!Object.keys(h).length))}_validate(o,h,d,m,v={}){return(!v||v.validate!==!1)&&Yd(this,o.call(La,{key:h,layerType:this.type,objectKey:d,value:m,styleSpec:ce,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const o in this.paint._values){const h=this.paint.get(o);if(h instanceof lo&&ml(h.property.specification)&&(h.value.kind==="source"||h.value.kind==="composite")&&h.value.isStateDependent)return!0}return!1}}const p={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class g{constructor(o,h){this._structArray=o,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class y{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(o,h){return o._trim(),h&&(o.isTransferred=!0,h.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}}static deserialize(o){const h=Object.create(this.prototype);return h.arrayBuffer=o.arrayBuffer,h.length=o.length,h.capacity=o.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(o){this.reserve(o),this.length=o}reserve(o){if(o>this.capacity){this.capacity=Math.max(o,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function E(l,o=1){let h=0,d=0;return{members:l.map(m=>{const v=p[m.type].BYTES_PER_ELEMENT,x=h=C(h,Math.max(o,v)),T=m.components||1;return d=Math.max(d,v),h+=v*T,{name:m.name,type:m.type,components:T,offset:x}}),size:C(h,Math.max(d,o)),alignment:o}}function C(l,o){return Math.ceil(l/o)*o}class M extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h){const d=this.length;return this.resize(d+1),this.emplace(d,o,h)}emplace(o,h,d){const m=2*o;return this.int16[m+0]=h,this.int16[m+1]=d,o}}M.prototype.bytesPerElement=4,bt("StructArrayLayout2i4",M);class O extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,h,d)}emplace(o,h,d,m){const v=3*o;return this.int16[v+0]=h,this.int16[v+1]=d,this.int16[v+2]=m,o}}O.prototype.bytesPerElement=6,bt("StructArrayLayout3i6",O);class N extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,o,h,d,m)}emplace(o,h,d,m,v){const x=4*o;return this.int16[x+0]=h,this.int16[x+1]=d,this.int16[x+2]=m,this.int16[x+3]=v,o}}N.prototype.bytesPerElement=8,bt("StructArrayLayout4i8",N);class B extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,o,h,d,m,v,x)}emplace(o,h,d,m,v,x,T){const I=6*o;return this.int16[I+0]=h,this.int16[I+1]=d,this.int16[I+2]=m,this.int16[I+3]=v,this.int16[I+4]=x,this.int16[I+5]=T,o}}B.prototype.bytesPerElement=12,bt("StructArrayLayout2i4i12",B);class H extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,o,h,d,m,v,x)}emplace(o,h,d,m,v,x,T){const I=4*o,R=8*o;return this.int16[I+0]=h,this.int16[I+1]=d,this.uint8[R+4]=m,this.uint8[R+5]=v,this.uint8[R+6]=x,this.uint8[R+7]=T,o}}H.prototype.bytesPerElement=8,bt("StructArrayLayout2i4ub8",H);class J extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,h){const d=this.length;return this.resize(d+1),this.emplace(d,o,h)}emplace(o,h,d){const m=2*o;return this.float32[m+0]=h,this.float32[m+1]=d,o}}J.prototype.bytesPerElement=8,bt("StructArrayLayout2f8",J);class te extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x,T,I,R,k){const F=this.length;return this.resize(F+1),this.emplace(F,o,h,d,m,v,x,T,I,R,k)}emplace(o,h,d,m,v,x,T,I,R,k,F){const z=10*o;return this.uint16[z+0]=h,this.uint16[z+1]=d,this.uint16[z+2]=m,this.uint16[z+3]=v,this.uint16[z+4]=x,this.uint16[z+5]=T,this.uint16[z+6]=I,this.uint16[z+7]=R,this.uint16[z+8]=k,this.uint16[z+9]=F,o}}te.prototype.bytesPerElement=20,bt("StructArrayLayout10ui20",te);class ae extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x,T,I,R,k,F,z){const $=this.length;return this.resize($+1),this.emplace($,o,h,d,m,v,x,T,I,R,k,F,z)}emplace(o,h,d,m,v,x,T,I,R,k,F,z,$){const q=12*o;return this.int16[q+0]=h,this.int16[q+1]=d,this.int16[q+2]=m,this.int16[q+3]=v,this.uint16[q+4]=x,this.uint16[q+5]=T,this.uint16[q+6]=I,this.uint16[q+7]=R,this.int16[q+8]=k,this.int16[q+9]=F,this.int16[q+10]=z,this.int16[q+11]=$,o}}ae.prototype.bytesPerElement=24,bt("StructArrayLayout4i4ui4i24",ae);class he extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,h,d)}emplace(o,h,d,m){const v=3*o;return this.float32[v+0]=h,this.float32[v+1]=d,this.float32[v+2]=m,o}}he.prototype.bytesPerElement=12,bt("StructArrayLayout3f12",he);class de extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o){const h=this.length;return this.resize(h+1),this.emplace(h,o)}emplace(o,h){return this.uint32[1*o+0]=h,o}}de.prototype.bytesPerElement=4,bt("StructArrayLayout1ul4",de);class _e extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x,T,I,R){const k=this.length;return this.resize(k+1),this.emplace(k,o,h,d,m,v,x,T,I,R)}emplace(o,h,d,m,v,x,T,I,R,k){const F=10*o,z=5*o;return this.int16[F+0]=h,this.int16[F+1]=d,this.int16[F+2]=m,this.int16[F+3]=v,this.int16[F+4]=x,this.int16[F+5]=T,this.uint32[z+3]=I,this.uint16[F+8]=R,this.uint16[F+9]=k,o}}_e.prototype.bytesPerElement=20,bt("StructArrayLayout6i1ul2ui20",_e);class re extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,o,h,d,m,v,x)}emplace(o,h,d,m,v,x,T){const I=6*o;return this.int16[I+0]=h,this.int16[I+1]=d,this.int16[I+2]=m,this.int16[I+3]=v,this.int16[I+4]=x,this.int16[I+5]=T,o}}re.prototype.bytesPerElement=12,bt("StructArrayLayout2i2i2i12",re);class xe extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v){const x=this.length;return this.resize(x+1),this.emplace(x,o,h,d,m,v)}emplace(o,h,d,m,v,x){const T=4*o,I=8*o;return this.float32[T+0]=h,this.float32[T+1]=d,this.float32[T+2]=m,this.int16[I+6]=v,this.int16[I+7]=x,o}}xe.prototype.bytesPerElement=16,bt("StructArrayLayout2f1f2i16",xe);class Ee extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,h,d,m,v,x){const T=this.length;return this.resize(T+1),this.emplace(T,o,h,d,m,v,x)}emplace(o,h,d,m,v,x,T){const I=16*o,R=4*o,k=8*o;return this.uint8[I+0]=h,this.uint8[I+1]=d,this.float32[R+1]=m,this.float32[R+2]=v,this.int16[k+6]=x,this.int16[k+7]=T,o}}Ee.prototype.bytesPerElement=16,bt("StructArrayLayout2ub2f2i16",Ee);class Re extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,h,d)}emplace(o,h,d,m){const v=3*o;return this.uint16[v+0]=h,this.uint16[v+1]=d,this.uint16[v+2]=m,o}}Re.prototype.bytesPerElement=6,bt("StructArrayLayout3ui6",Re);class $e extends y{_refreshViews(){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)}emplaceBack(o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue){const Me=this.length;return this.resize(Me+1),this.emplace(Me,o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue)}emplace(o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue,Me){const be=24*o,Ae=12*o,Le=48*o;return this.int16[be+0]=h,this.int16[be+1]=d,this.uint16[be+2]=m,this.uint16[be+3]=v,this.uint32[Ae+2]=x,this.uint32[Ae+3]=T,this.uint32[Ae+4]=I,this.uint16[be+10]=R,this.uint16[be+11]=k,this.uint16[be+12]=F,this.float32[Ae+7]=z,this.float32[Ae+8]=$,this.uint8[Le+36]=q,this.uint8[Le+37]=Z,this.uint8[Le+38]=oe,this.uint32[Ae+10]=ue,this.int16[be+22]=Me,o}}$e.prototype.bytesPerElement=48,bt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",$e);class st extends y{_refreshViews(){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)}emplaceBack(o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue,Me,be,Ae,Le,Ke,pt,Ot,ft,ct,At,xt){const yt=this.length;return this.resize(yt+1),this.emplace(yt,o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue,Me,be,Ae,Le,Ke,pt,Ot,ft,ct,At,xt)}emplace(o,h,d,m,v,x,T,I,R,k,F,z,$,q,Z,oe,ue,Me,be,Ae,Le,Ke,pt,Ot,ft,ct,At,xt,yt){const Ve=32*o,Ct=16*o;return this.int16[Ve+0]=h,this.int16[Ve+1]=d,this.int16[Ve+2]=m,this.int16[Ve+3]=v,this.int16[Ve+4]=x,this.int16[Ve+5]=T,this.int16[Ve+6]=I,this.int16[Ve+7]=R,this.uint16[Ve+8]=k,this.uint16[Ve+9]=F,this.uint16[Ve+10]=z,this.uint16[Ve+11]=$,this.uint16[Ve+12]=q,this.uint16[Ve+13]=Z,this.uint16[Ve+14]=oe,this.uint16[Ve+15]=ue,this.uint16[Ve+16]=Me,this.uint16[Ve+17]=be,this.uint16[Ve+18]=Ae,this.uint16[Ve+19]=Le,this.uint16[Ve+20]=Ke,this.uint16[Ve+21]=pt,this.uint16[Ve+22]=Ot,this.uint32[Ct+12]=ft,this.float32[Ct+13]=ct,this.float32[Ct+14]=At,this.uint16[Ve+30]=xt,this.uint16[Ve+31]=yt,o}}st.prototype.bytesPerElement=64,bt("StructArrayLayout8i15ui1ul2f2ui64",st);class ut extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o){const h=this.length;return this.resize(h+1),this.emplace(h,o)}emplace(o,h){return this.float32[1*o+0]=h,o}}ut.prototype.bytesPerElement=4,bt("StructArrayLayout1f4",ut);class mt extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,h,d)}emplace(o,h,d,m){const v=3*o;return this.uint16[6*o+0]=h,this.float32[v+1]=d,this.float32[v+2]=m,o}}mt.prototype.bytesPerElement=12,bt("StructArrayLayout1ui2f12",mt);class ot extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h,d){const m=this.length;return this.resize(m+1),this.emplace(m,o,h,d)}emplace(o,h,d,m){const v=4*o;return this.uint32[2*o+0]=h,this.uint16[v+2]=d,this.uint16[v+3]=m,o}}ot.prototype.bytesPerElement=8,bt("StructArrayLayout1ul2ui8",ot);class rt extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,h){const d=this.length;return this.resize(d+1),this.emplace(d,o,h)}emplace(o,h,d){const m=2*o;return this.uint16[m+0]=h,this.uint16[m+1]=d,o}}rt.prototype.bytesPerElement=4,bt("StructArrayLayout2ui4",rt);class St extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o){const h=this.length;return this.resize(h+1),this.emplace(h,o)}emplace(o,h){return this.uint16[1*o+0]=h,o}}St.prototype.bytesPerElement=2,bt("StructArrayLayout1ui2",St);class Ht extends y{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,h,d,m){const v=this.length;return this.resize(v+1),this.emplace(v,o,h,d,m)}emplace(o,h,d,m,v){const x=4*o;return this.float32[x+0]=h,this.float32[x+1]=d,this.float32[x+2]=m,this.float32[x+3]=v,o}}Ht.prototype.bytesPerElement=16,bt("StructArrayLayout4f16",Ht);class lt extends g{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new A(this.anchorPointX,this.anchorPointY)}}lt.prototype.size=20;class dt extends _e{get(o){return new lt(this,o)}}bt("CollisionBoxArray",dt);class zt extends g{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(o){this._structArray.uint8[this._pos1+37]=o}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(o){this._structArray.uint8[this._pos1+38]=o}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(o){this._structArray.uint32[this._pos4+10]=o}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}zt.prototype.size=48;class Ui extends $e{get(o){return new zt(this,o)}}bt("PlacedSymbolArray",Ui);class Yt extends g{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(o){this._structArray.uint32[this._pos4+12]=o}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Yt.prototype.size=64;class si extends st{get(o){return new Yt(this,o)}}bt("SymbolInstanceArray",si);class Vi extends ut{getoffsetX(o){return this.float32[1*o+0]}}bt("GlyphOffsetArray",Vi);class tn extends O{getx(o){return this.int16[3*o+0]}gety(o){return this.int16[3*o+1]}gettileUnitDistanceFromAnchor(o){return this.int16[3*o+2]}}bt("SymbolLineVertexArray",tn);class Lr extends g{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Lr.prototype.size=12;class ji extends mt{get(o){return new Lr(this,o)}}bt("TextAnchorOffsetArray",ji);class Rn extends g{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Rn.prototype.size=8;class mn extends ot{get(o){return new Rn(this,o)}}bt("FeatureIndexArray",mn);class sn extends M{}class _n extends M{}class co extends M{}class Pl extends B{}class Ph extends H{}class Ml extends J{}class yr extends te{}class Mh extends ae{}class sp extends he{}class br extends de{}class vr extends re{}class Wo extends Ee{}class zr extends Re{}class Xs extends rt{}const nn=E([{name:"a_pos",components:2,type:"Int16"}],4),{members:Jn}=nn;class oi{constructor(o=[]){this.segments=o}prepareSegment(o,h,d,m){let v=this.segments[this.segments.length-1];return o>oi.MAX_VERTEX_ARRAY_LENGTH&&ht(`Max vertices per segment is ${oi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${o}`),(!v||v.vertexLength+o>oi.MAX_VERTEX_ARRAY_LENGTH||v.sortKey!==m)&&(v={vertexOffset:h.length,primitiveOffset:d.length,vertexLength:0,primitiveLength:0},m!==void 0&&(v.sortKey=m),this.segments.push(v)),v}get(){return this.segments}destroy(){for(const o of this.segments)for(const h in o.vaos)o.vaos[h].destroy()}static simpleSegment(o,h,d,m){return new oi([{vertexOffset:o,primitiveOffset:h,vertexLength:d,primitiveLength:m,vaos:{},sortKey:0}])}}function za(l,o){return 256*(l=Se(Math.floor(l),0,255))+Se(Math.floor(o),0,255)}oi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,bt("SegmentVector",oi);const Rl=E([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var kl={exports:{}},Um={exports:{}};Um.exports=function(l,o){var h,d,m,v,x,T,I,R;for(d=l.length-(h=3&l.length),m=o,x=3432918353,T=461845907,R=0;R>>16)*x&65535)<<16)&4294967295)<<15|I>>>17))*T+(((I>>>16)*T&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(v>>>16)&65535)<<16);switch(I=0,h){case 3:I^=(255&l.charCodeAt(R+2))<<16;case 2:I^=(255&l.charCodeAt(R+1))<<8;case 1:m^=I=(65535&(I=(I=(65535&(I^=255&l.charCodeAt(R)))*x+(((I>>>16)*x&65535)<<16)&4294967295)<<15|I>>>17))*T+(((I>>>16)*T&65535)<<16)&4294967295}return m^=l.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0};var Gb=Um.exports,Vm={exports:{}};Vm.exports=function(l,o){for(var h,d=l.length,m=o^d,v=0;d>=4;)h=1540483477*(65535&(h=255&l.charCodeAt(v)|(255&l.charCodeAt(++v))<<8|(255&l.charCodeAt(++v))<<16|(255&l.charCodeAt(++v))<<24))+((1540483477*(h>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),d-=4,++v;switch(d){case 3:m^=(255&l.charCodeAt(v+2))<<16;case 2:m^=(255&l.charCodeAt(v+1))<<8;case 1:m=1540483477*(65535&(m^=255&l.charCodeAt(v)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0};var qo=Gb,jm=Vm.exports;kl.exports=qo,kl.exports.murmur3=qo,kl.exports.murmur2=jm;var Rh=_(kl.exports);class Kc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(o,h,d,m){this.ids.push(kh(o)),this.positions.push(h,d,m)}getPositions(o){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const h=kh(o);let d=0,m=this.ids.length-1;for(;d>1;this.ids[x]>=h?m=x:d=x+1}const v=[];for(;this.ids[d]===h;)v.push({index:this.positions[3*d],start:this.positions[3*d+1],end:this.positions[3*d+2]}),d++;return v}static serialize(o,h){const d=new Float64Array(o.ids),m=new Uint32Array(o.positions);return Oh(d,m,0,d.length-1),h&&h.push(d.buffer,m.buffer),{ids:d,positions:m}}static deserialize(o){const h=new Kc;return h.ids=o.ids,h.positions=o.positions,h.indexed=!0,h}}function kh(l){const o=+l;return!isNaN(o)&&o<=Number.MAX_SAFE_INTEGER?o:Rh(String(l))}function Oh(l,o,h,d){for(;h>1];let v=h-1,x=d+1;for(;;){do v++;while(l[v]m);if(v>=x)break;Ol(l,v,x),Ol(o,3*v,3*x),Ol(o,3*v+1,3*x+1),Ol(o,3*v+2,3*x+2)}x-h`u_${m}`),this.type=d}setUniform(o,h,d){o.set(d.constantOr(this.value))}getBinding(o,h,d){return this.type==="color"?new GS(o,h):new $m(o,h)}}class Dh{constructor(o,h){this.uniformNames=h.map(d=>`u_${d}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(o,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=o.tlbr}setUniform(o,h,d,m){const v=m==="u_pattern_to"?this.patternTo:m==="u_pattern_from"?this.patternFrom:m==="u_pixel_ratio_to"?this.pixelRatioTo:m==="u_pixel_ratio_from"?this.pixelRatioFrom:null;v&&o.set(v)}getBinding(o,h,d){return d.substr(0,9)==="u_pattern"?new JS(o,h):new $m(o,h)}}class Ua{constructor(o,h,d,m){this.expression=o,this.type=d,this.maxValue=0,this.paintVertexAttributes=h.map(v=>({name:`a_${v}`,type:"Float32",components:d==="color"?2:1,offset:0})),this.paintVertexArray=new m}populatePaintArray(o,h,d,m,v){const x=this.paintVertexArray.length,T=this.expression.evaluate(new zi(0),h,{},m,[],v);this.paintVertexArray.resize(o),this._setPaintValue(x,o,T)}updatePaintArray(o,h,d,m){const v=this.expression.evaluate({zoom:0},d,m);this._setPaintValue(o,h,v)}_setPaintValue(o,h,d){if(this.type==="color"){const m=Qb(d);for(let v=o;v`u_${T}_t`),this.type=d,this.useIntegerZoom=m,this.zoom=v,this.maxValue=0,this.paintVertexAttributes=h.map(T=>({name:`a_${T}`,type:"Float32",components:d==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(o,h,d,m,v){const x=this.expression.evaluate(new zi(this.zoom),h,{},m,[],v),T=this.expression.evaluate(new zi(this.zoom+1),h,{},m,[],v),I=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(I,o,x,T)}updatePaintArray(o,h,d,m){const v=this.expression.evaluate({zoom:this.zoom},d,m),x=this.expression.evaluate({zoom:this.zoom+1},d,m);this._setPaintValue(o,h,v,x)}_setPaintValue(o,h,d,m){if(this.type==="color"){const v=Qb(d),x=Qb(m);for(let T=o;T`#define HAS_UNIFORM_${m}`))}return o}getBinderAttributes(){const o=[];for(const h in this.binders){const d=this.binders[h];if(d instanceof Ua||d instanceof Io)for(let m=0;m!0){this.programConfigurations={};for(const m of o)this.programConfigurations[m.id]=new QS(m,h,d);this.needsUpload=!1,this._featureMap=new Kc,this._bufferOffset=0}populatePaintArrays(o,h,d,m,v,x){for(const T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(o,h,m,v,x);h.id!==void 0&&this._featureMap.add(h.id,d,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0}updatePaintArrays(o,h,d,m){for(const v of d)this.needsUpload=this.programConfigurations[v.id].updatePaintArrays(o,this._featureMap,h,v,m)||this.needsUpload}get(o){return this.programConfigurations[o]}upload(o){if(this.needsUpload){for(const h in this.programConfigurations)this.programConfigurations[h].upload(o);this.needsUpload=!1}}destroy(){for(const o in this.programConfigurations)this.programConfigurations[o].destroy()}}function tF(l,o){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"]}[l]||[l.replace(`${o}-`,"").replace(/-/g,"_")]}function eE(l,o,h){const d={color:{source:J,composite:Ht},number:{source:ut,composite:J}},m=function(v){return{"line-pattern":{source:yr,composite:yr},"fill-pattern":{source:yr,composite:yr},"fill-extrusion-pattern":{source:yr,composite:yr}}[v]}(l);return m&&m[h]||d[o][h]}bt("ConstantBinder",np),bt("CrossFadedConstantBinder",Dh),bt("SourceExpressionBinder",Ua),bt("CrossFadedCompositeBinder",Dl),bt("CompositeExpressionBinder",Io),bt("ProgramConfiguration",QS,{omit:["_buffers"]}),bt("ProgramConfigurationSet",Gc);const Es=8192,ev=Math.pow(2,14)-1,tE=-ev-1;function Qc(l){const o=Es/l.extent,h=l.loadGeometry();for(let d=0;dx.x+1||Ix.y+1)&&ht("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return h}function eu(l,o){return{type:l.type,id:l.id,properties:l.properties,geometry:o?Qc(l):[]}}function Hm(l,o,h,d,m){l.emplaceBack(2*o+(d+1)/2,2*h+(m+1)/2)}class tv{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(h=>h.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new _n,this.indexArray=new zr,this.segments=new oi,this.programConfigurations=new Gc(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(o,h,d){const m=this.layers[0],v=[];let x=null,T=!1;m.type==="circle"&&(x=m.layout.get("circle-sort-key"),T=!x.isConstant());for(const{feature:I,id:R,index:k,sourceLayerIndex:F}of o){const z=this.layers[0]._featureFilter.needGeometry,$=eu(I,z);if(!this.layers[0]._featureFilter.filter(new zi(this.zoom),$,d))continue;const q=T?x.evaluate($,{},d):void 0,Z={id:R,properties:I.properties,type:I.type,sourceLayerIndex:F,index:k,geometry:z?$.geometry:Qc(I),patterns:{},sortKey:q};v.push(Z)}T&&v.sort((I,R)=>I.sortKey-R.sortKey);for(const I of v){const{geometry:R,index:k,sourceLayerIndex:F}=I,z=o[k].feature;this.addFeature(I,R,k,d),h.featureIndex.insert(z,R,k,F,this.index)}}update(o,h,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,h,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Jn),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(o,h,d,m){for(const v of h)for(const x of v){const T=x.x,I=x.y;if(T<0||T>=Es||I<0||I>=Es)continue;const R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),k=R.vertexLength;Hm(this.layoutVertexArray,T,I,-1,-1),Hm(this.layoutVertexArray,T,I,1,-1),Hm(this.layoutVertexArray,T,I,1,1),Hm(this.layoutVertexArray,T,I,-1,1),this.indexArray.emplaceBack(k,k+1,k+2),this.indexArray.emplaceBack(k,k+3,k+2),R.vertexLength+=4,R.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,d,{},m)}}function iE(l,o){for(let h=0;h1){if(iv(l,o))return!0;for(let d=0;d1?h:h.sub(o)._mult(m)._add(o))}function rE(l,o){let h,d,m,v=!1;for(let x=0;xo.y!=m.y>o.y&&o.x<(m.x-d.x)*(o.y-d.y)/(m.y-d.y)+d.x&&(v=!v)}return v}function Fh(l,o){let h=!1;for(let d=0,m=l.length-1;do.y!=x.y>o.y&&o.x<(x.x-v.x)*(o.y-v.y)/(x.y-v.y)+v.x&&(h=!h)}return h}function rF(l,o,h){const d=h[0],m=h[2];if(l.xm.x&&o.x>m.x||l.ym.y&&o.y>m.y)return!1;const v=_t(l,o,h[0]);return v!==_t(l,o,h[1])||v!==_t(l,o,h[2])||v!==_t(l,o,h[3])}function rp(l,o,h){const d=o.paint.get(l).value;return d.kind==="constant"?d.value:h.programConfigurations.get(o.id).getMaxValue(l)}function Wm(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function qm(l,o,h,d,m){if(!o[0]&&!o[1])return l;const v=A.convert(o)._mult(m);h==="viewport"&&v._rotate(-d);const x=[];for(let T=0;TcE(oe,Z))}(R,I),$=F?k*T:k;for(const q of m)for(const Z of q){const oe=F?Z:cE(Z,I);let ue=$;const Me=Xm([],[Z.x,Z.y,0,1],I);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ue*=Me[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ue*=x.cameraToCenterDistance/Me[3]),iF(z,oe,ue))return!0}return!1}}function cE(l,o){const h=Xm([],[l.x,l.y,0,1],o);return new A(h[0]/h[3],h[1]/h[3])}class uE extends tv{}let hE;bt("HeatmapBucket",uE,{omit:["layers"]});var cF={get paint(){return hE=hE||new b({"heatmap-radius":new Ft(ce.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ft(ce.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Tt(ce.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ip(ce.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Tt(ce.paint_heatmap["heatmap-opacity"])})}};function rv(l,{width:o,height:h},d,m){if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==o*h*d)throw new RangeError(`mismatched image size. expected: ${m.length} but got: ${o*h*d}`)}else m=new Uint8Array(o*h*d);return l.width=o,l.height=h,l.data=m,l}function fE(l,{width:o,height:h},d){if(o===l.width&&h===l.height)return;const m=rv({},{width:o,height:h},d);ov(l,m,{x:0,y:0},{x:0,y:0},{width:Math.min(l.width,o),height:Math.min(l.height,h)},d),l.width=o,l.height=h,l.data=m.data}function ov(l,o,h,d,m,v){if(m.width===0||m.height===0)return o;if(m.width>l.width||m.height>l.height||h.x>l.width-m.width||h.y>l.height-m.height)throw new RangeError("out of range source coordinates for image copy");if(m.width>o.width||m.height>o.height||d.x>o.width-m.width||d.y>o.height-m.height)throw new RangeError("out of range destination coordinates for image copy");const x=l.data,T=o.data;if(x===T)throw new Error("srcData equals dstData, so image is already copied");for(let I=0;I{o[l.evaluationKey]=I;const R=l.expression.evaluate(o);m.data[x+T+0]=Math.floor(255*R.r/R.a),m.data[x+T+1]=Math.floor(255*R.g/R.a),m.data[x+T+2]=Math.floor(255*R.b/R.a),m.data[x+T+3]=Math.floor(255*R.a)};if(l.clips)for(let x=0,T=0;x80*h){T=1/0,I=1/0;let k=-1/0,F=-1/0;for(let z=h;zk&&(k=$),q>F&&(F=q)}R=Math.max(k-T,F-I),R=R!==0?32767/R:0}return lp(v,x,h,T,I,R,0),x}function mE(l,o,h,d,m){let v;if(m===function(x,T,I,R){let k=0;for(let F=T,z=I-R;F0)for(let x=o;x=o;x-=d)v=bE(x/d|0,l[x],l[x+1],v);return v&&Zm(v,v.next)&&(up(v),v=v.next),v}function tu(l,o){if(!l)return l;o||(o=l);let h,d=l;do if(h=!1,d.steiner||!Zm(d,d.next)&&bs(d.prev,d,d.next)!==0)d=d.next;else{if(up(d),d=o=d.prev,d===d.next)break;h=!0}while(h||d!==o);return o}function lp(l,o,h,d,m,v,x){if(!l)return;!x&&v&&function(I,R,k,F){let z=I;do z.z===0&&(z.z=lv(z.x,z.y,R,k,F)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==I);z.prevZ.nextZ=null,z.prevZ=null,function($){let q,Z=1;do{let oe,ue=$;$=null;let Me=null;for(q=0;ue;){q++;let be=ue,Ae=0;for(let Ke=0;Ke0||Le>0&&be;)Ae!==0&&(Le===0||!be||ue.z<=be.z)?(oe=ue,ue=ue.nextZ,Ae--):(oe=be,be=be.nextZ,Le--),Me?Me.nextZ=oe:$=oe,oe.prevZ=Me,Me=oe;ue=be}Me.nextZ=null,Z*=2}while(q>1)}(z)}(l,d,m,v);let T=l;for(;l.prev!==l.next;){const I=l.prev,R=l.next;if(v?mF(l,d,m,v):gF(l))o.push(I.i,l.i,R.i),up(l),l=R.next,T=R.next;else if((l=R)===T){x?x===1?lp(l=_F(tu(l),o),o,h,d,m,v,2):x===2&&yF(l,o,h,d,m,v):lp(tu(l),o,h,d,m,v,1);break}}}function gF(l){const o=l.prev,h=l,d=l.next;if(bs(o,h,d)>=0)return!1;const m=o.x,v=h.x,x=d.x,T=o.y,I=h.y,R=d.y,k=mv?m>x?m:x:v>x?v:x,$=T>I?T>R?T:R:I>R?I:R;let q=d.next;for(;q!==o;){if(q.x>=k&&q.x<=z&&q.y>=F&&q.y<=$&&Bh(m,T,v,I,x,R,q.x,q.y)&&bs(q.prev,q,q.next)>=0)return!1;q=q.next}return!0}function mF(l,o,h,d){const m=l.prev,v=l,x=l.next;if(bs(m,v,x)>=0)return!1;const T=m.x,I=v.x,R=x.x,k=m.y,F=v.y,z=x.y,$=TI?T>R?T:R:I>R?I:R,oe=k>F?k>z?k:z:F>z?F:z,ue=lv($,q,o,h,d),Me=lv(Z,oe,o,h,d);let be=l.prevZ,Ae=l.nextZ;for(;be&&be.z>=ue&&Ae&&Ae.z<=Me;){if(be.x>=$&&be.x<=Z&&be.y>=q&&be.y<=oe&&be!==m&&be!==x&&Bh(T,k,I,F,R,z,be.x,be.y)&&bs(be.prev,be,be.next)>=0||(be=be.prevZ,Ae.x>=$&&Ae.x<=Z&&Ae.y>=q&&Ae.y<=oe&&Ae!==m&&Ae!==x&&Bh(T,k,I,F,R,z,Ae.x,Ae.y)&&bs(Ae.prev,Ae,Ae.next)>=0))return!1;Ae=Ae.nextZ}for(;be&&be.z>=ue;){if(be.x>=$&&be.x<=Z&&be.y>=q&&be.y<=oe&&be!==m&&be!==x&&Bh(T,k,I,F,R,z,be.x,be.y)&&bs(be.prev,be,be.next)>=0)return!1;be=be.prevZ}for(;Ae&&Ae.z<=Me;){if(Ae.x>=$&&Ae.x<=Z&&Ae.y>=q&&Ae.y<=oe&&Ae!==m&&Ae!==x&&Bh(T,k,I,F,R,z,Ae.x,Ae.y)&&bs(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.nextZ}return!0}function _F(l,o){let h=l;do{const d=h.prev,m=h.next.next;!Zm(d,m)&&_E(d,h,h.next,m)&&cp(d,m)&&cp(m,d)&&(o.push(d.i,h.i,m.i),up(h),up(h.next),h=l=m),h=h.next}while(h!==l);return tu(h)}function yF(l,o,h,d,m,v){let x=l;do{let T=x.next.next;for(;T!==x.prev;){if(x.i!==T.i&&TF(x,T)){let I=yE(x,T);return x=tu(x,x.next),I=tu(I,I.next),lp(x,o,h,d,m,v,0),void lp(I,o,h,d,m,v,0)}T=T.next}x=x.next}while(x!==l)}function bF(l,o){return l.x-o.x}function vF(l,o){const h=function(m,v){let x=v;const T=m.x,I=m.y;let R,k=-1/0;do{if(I<=x.y&&I>=x.next.y&&x.next.y!==x.y){const Z=x.x+(I-x.y)*(x.next.x-x.x)/(x.next.y-x.y);if(Z<=T&&Z>k&&(k=Z,R=x.x=x.x&&x.x>=z&&T!==x.x&&Bh(I<$?T:k,I,z,$,I<$?k:T,I,x.x,x.y)){const Z=Math.abs(I-x.y)/(T-x.x);cp(x,m)&&(ZR.x||x.x===R.x&&xF(R,x)))&&(R=x,q=Z)}x=x.next}while(x!==F);return R}(l,o);if(!h)return o;const d=yE(h,l);return tu(d,d.next),tu(h,h.next)}function xF(l,o){return bs(l.prev,l,o.prev)<0&&bs(o.next,l,l.next)<0}function lv(l,o,h,d,m){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-h)*m|0)|l<<8))|l<<4))|l<<2))|l<<1))|(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=(o-d)*m|0)|o<<8))|o<<4))|o<<2))|o<<1))<<1}function wF(l){let o=l,h=l;do(o.x=(l-x)*(v-T)&&(l-x)*(d-T)>=(h-x)*(o-T)&&(h-x)*(v-T)>=(m-x)*(d-T)}function TF(l,o){return l.next.i!==o.i&&l.prev.i!==o.i&&!function(h,d){let m=h;do{if(m.i!==h.i&&m.next.i!==h.i&&m.i!==d.i&&m.next.i!==d.i&&_E(m,m.next,h,d))return!0;m=m.next}while(m!==h);return!1}(l,o)&&(cp(l,o)&&cp(o,l)&&function(h,d){let m=h,v=!1;const x=(h.x+d.x)/2,T=(h.y+d.y)/2;do m.y>T!=m.next.y>T&&m.next.y!==m.y&&x<(m.next.x-m.x)*(T-m.y)/(m.next.y-m.y)+m.x&&(v=!v),m=m.next;while(m!==h);return v}(l,o)&&(bs(l.prev,l,o.prev)||bs(l,o.prev,o))||Zm(l,o)&&bs(l.prev,l,l.next)>0&&bs(o.prev,o,o.next)>0)}function bs(l,o,h){return(o.y-l.y)*(h.x-o.x)-(o.x-l.x)*(h.y-o.y)}function Zm(l,o){return l.x===o.x&&l.y===o.y}function _E(l,o,h,d){const m=Km(bs(l,o,h)),v=Km(bs(l,o,d)),x=Km(bs(h,d,l)),T=Km(bs(h,d,o));return m!==v&&x!==T||!(m!==0||!Ym(l,h,o))||!(v!==0||!Ym(l,d,o))||!(x!==0||!Ym(h,l,d))||!(T!==0||!Ym(h,o,d))}function Ym(l,o,h){return o.x<=Math.max(l.x,h.x)&&o.x>=Math.min(l.x,h.x)&&o.y<=Math.max(l.y,h.y)&&o.y>=Math.min(l.y,h.y)}function Km(l){return l>0?1:l<0?-1:0}function cp(l,o){return bs(l.prev,l,l.next)<0?bs(l,o,l.next)>=0&&bs(l,l.prev,o)>=0:bs(l,o,l.prev)<0||bs(l,l.next,o)<0}function yE(l,o){const h=cv(l.i,l.x,l.y),d=cv(o.i,o.x,o.y),m=l.next,v=o.prev;return l.next=o,o.prev=l,h.next=m,m.prev=h,d.next=h,h.prev=d,v.next=d,d.prev=v,d}function bE(l,o,h,d){const m=cv(l,o,h);return d?(m.next=d.next,m.prev=d,d.next.prev=m,d.next=m):(m.prev=m,m.next=m),m}function up(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function cv(l,o,h){return{i:l,x:o,y:h,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function uv(l,o,h){const d=h.patternDependencies;let m=!1;for(const v of o){const x=v.paint.get(`${l}-pattern`);x.isConstant()||(m=!0);const T=x.constantOr(null);T&&(m=!0,d[T.to]=!0,d[T.from]=!0)}return m}function hv(l,o,h,d,m){const v=m.patternDependencies;for(const x of o){const T=x.paint.get(`${l}-pattern`).value;if(T.kind!=="constant"){let I=T.evaluate({zoom:d-1},h,{},m.availableImages),R=T.evaluate({zoom:d},h,{},m.availableImages),k=T.evaluate({zoom:d+1},h,{},m.availableImages);I=I&&I.name?I.name:I,R=R&&R.name?R.name:R,k=k&&k.name?k.name:k,v[I]=!0,v[R]=!0,v[k]=!0,h.patterns[x.id]={min:I,mid:R,max:k}}}return h}class fv{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(h=>h.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new co,this.indexArray=new zr,this.indexArray2=new Xs,this.programConfigurations=new Gc(o.layers,o.zoom),this.segments=new oi,this.segments2=new oi,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(o,h,d){this.hasPattern=uv("fill",this.layers,h);const m=this.layers[0].layout.get("fill-sort-key"),v=!m.isConstant(),x=[];for(const{feature:T,id:I,index:R,sourceLayerIndex:k}of o){const F=this.layers[0]._featureFilter.needGeometry,z=eu(T,F);if(!this.layers[0]._featureFilter.filter(new zi(this.zoom),z,d))continue;const $=v?m.evaluate(z,{},d,h.availableImages):void 0,q={id:I,properties:T.properties,type:T.type,sourceLayerIndex:k,index:R,geometry:F?z.geometry:Qc(T),patterns:{},sortKey:$};x.push(q)}v&&x.sort((T,I)=>T.sortKey-I.sortKey);for(const T of x){const{geometry:I,index:R,sourceLayerIndex:k}=T;if(this.hasPattern){const F=hv("fill",this.layers,T,this.zoom,h);this.patternFeatures.push(F)}else this.addFeature(T,I,R,d,{});h.featureIndex.insert(o[R].feature,I,R,k,this.index)}}update(o,h,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,h,this.stateDependentLayers,d)}addFeatures(o,h,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,h,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,pF),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(o,h,d,m,v){for(const x of ah(h,500)){let T=0;for(const $ of x)T+=$.length;const I=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray),R=I.vertexLength,k=[],F=[];for(const $ of x){if($.length===0)continue;$!==x[0]&&F.push(k.length/2);const q=this.segments2.prepareSegment($.length,this.layoutVertexArray,this.indexArray2),Z=q.vertexLength;this.layoutVertexArray.emplaceBack($[0].x,$[0].y),this.indexArray2.emplaceBack(Z+$.length-1,Z),k.push($[0].x),k.push($[0].y);for(let oe=1;oe<$.length;oe++)this.layoutVertexArray.emplaceBack($[oe].x,$[oe].y),this.indexArray2.emplaceBack(Z+oe-1,Z+oe),k.push($[oe].x),k.push($[oe].y);q.vertexLength+=$.length,q.primitiveLength+=$.length}const z=gE(k,F);for(let $=0;$>3}if(m--,d===1||d===2)v+=l.readSVarint(),x+=l.readSVarint(),d===1&&(o&&T.push(o),o=[]),o.push(new PF(v,x));else{if(d!==7)throw new Error("unknown command "+d);o&&o.push(o[0].clone())}}return o&&T.push(o),T},Lh.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var o=l.readVarint()+l.pos,h=1,d=0,m=0,v=0,x=1/0,T=-1/0,I=1/0,R=-1/0;l.pos>3}if(d--,h===1||h===2)(m+=l.readSVarint())T&&(T=m),(v+=l.readSVarint())R&&(R=v);else if(h!==7)throw new Error("unknown command "+h)}return[x,I,T,R]},Lh.prototype.toGeoJSON=function(l,o,h){var d,m,v=this.extent*Math.pow(2,h),x=this.extent*l,T=this.extent*o,I=this.loadGeometry(),R=Lh.types[this.type];function k($){for(var q=0;q<$.length;q++){var Z=$[q];$[q]=[360*(Z.x+x)/v-180,360/Math.PI*Math.atan(Math.exp((180-360*(Z.y+T)/v)*Math.PI/180))-90]}}switch(this.type){case 1:var F=[];for(d=0;d>3;m=x===1?d.readString():x===2?d.readFloat():x===3?d.readDouble():x===4?d.readVarint64():x===5?d.readVarint():x===6?d.readSVarint():x===7?d.readBoolean():null}return m}(h))}SE.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var o=this._pbf.readVarint()+this._pbf.pos;return new kF(this._pbf,o,this.extent,this._keys,this._values)};var DF=TE;function FF(l,o,h){if(l===3){var d=new DF(h,h.readVarint()+h.pos);d.length&&(o[d.name]=d)}}Fl.VectorTile=function(l,o){this.layers=l.readFields(FF,{},o)},Fl.VectorTileFeature=wE,Fl.VectorTileLayer=TE;const NF=Fl.VectorTileFeature.types,dv=Math.pow(2,13);function hp(l,o,h,d,m,v,x,T){l.emplaceBack(o,h,2*Math.floor(d*dv)+x,m*dv*2,v*dv*2,Math.round(T))}class pv{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(h=>h.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Pl,this.centroidVertexArray=new sn,this.indexArray=new zr,this.programConfigurations=new Gc(o.layers,o.zoom),this.segments=new oi,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(o,h,d){this.features=[],this.hasPattern=uv("fill-extrusion",this.layers,h);for(const{feature:m,id:v,index:x,sourceLayerIndex:T}of o){const I=this.layers[0]._featureFilter.needGeometry,R=eu(m,I);if(!this.layers[0]._featureFilter.filter(new zi(this.zoom),R,d))continue;const k={id:v,sourceLayerIndex:T,index:x,geometry:I?R.geometry:Qc(m),properties:m.properties,type:m.type,patterns:{}};this.hasPattern?this.features.push(hv("fill-extrusion",this.layers,k,this.zoom,h)):this.addFeature(k,k.geometry,x,d,{}),h.featureIndex.insert(m,k.geometry,x,T,this.index,!0)}}addFeatures(o,h,d){for(const m of this.features){const{geometry:v}=m;this.addFeature(m,v,m.index,h,d)}}update(o,h,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,h,this.stateDependentLayers,d)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,CF),this.centroidVertexBuffer=o.createVertexBuffer(this.centroidVertexArray,IF.members,!0),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(o,h,d,m,v){for(const x of ah(h,500)){const T={x:0,y:0,vertexCount:0};let I=0;for(const q of x)I+=q.length;let R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const q of x){if(q.length===0||LF(q))continue;let Z=0;for(let oe=0;oe=1){const Me=q[oe-1];if(!BF(ue,Me)){R.vertexLength+4>oi.MAX_VERTEX_ARRAY_LENGTH&&(R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const be=ue.sub(Me)._perp()._unit(),Ae=Me.dist(ue);Z+Ae>32768&&(Z=0),hp(this.layoutVertexArray,ue.x,ue.y,be.x,be.y,0,0,Z),hp(this.layoutVertexArray,ue.x,ue.y,be.x,be.y,0,1,Z),T.x+=2*ue.x,T.y+=2*ue.y,T.vertexCount+=2,Z+=Ae,hp(this.layoutVertexArray,Me.x,Me.y,be.x,be.y,0,0,Z),hp(this.layoutVertexArray,Me.x,Me.y,be.x,be.y,0,1,Z),T.x+=2*Me.x,T.y+=2*Me.y,T.vertexCount+=2;const Le=R.vertexLength;this.indexArray.emplaceBack(Le,Le+2,Le+1),this.indexArray.emplaceBack(Le+1,Le+2,Le+3),R.vertexLength+=4,R.primitiveLength+=2}}}}if(R.vertexLength+I>oi.MAX_VERTEX_ARRAY_LENGTH&&(R=this.segments.prepareSegment(I,this.layoutVertexArray,this.indexArray)),NF[o.type]!=="Polygon")continue;const k=[],F=[],z=R.vertexLength;for(const q of x)if(q.length!==0){q!==x[0]&&F.push(k.length/2);for(let Z=0;ZEs)||l.y===o.y&&(l.y<0||l.y>Es)}function LF(l){return l.every(o=>o.x<0)||l.every(o=>o.x>Es)||l.every(o=>o.y<0)||l.every(o=>o.y>Es)}let EE;bt("FillExtrusionBucket",pv,{omit:["layers","features"]});var zF={get paint(){return EE=EE||new b({"fill-extrusion-opacity":new Tt(ce["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ft(ce["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Tt(ce["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Tt(ce["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ih(ce["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ft(ce["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ft(ce["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Tt(ce["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class UF extends f{constructor(o){super(o,zF)}createBucket(o){return new pv(o)}queryRadius(){return Wm(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(o,h,d,m,v,x,T,I){const R=qm(o,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,T),k=this.paint.get("fill-extrusion-height").evaluate(h,d),F=this.paint.get("fill-extrusion-base").evaluate(h,d),z=function(q,Z,oe,ue){const Me=[];for(const be of q){const Ae=[be.x,be.y,0,1];Xm(Ae,Ae,Z),Me.push(new A(Ae[0]/Ae[3],Ae[1]/Ae[3]))}return Me}(R,I),$=function(q,Z,oe,ue){const Me=[],be=[],Ae=ue[8]*Z,Le=ue[9]*Z,Ke=ue[10]*Z,pt=ue[11]*Z,Ot=ue[8]*oe,ft=ue[9]*oe,ct=ue[10]*oe,At=ue[11]*oe;for(const xt of q){const yt=[],Ve=[];for(const Ct of xt){const Et=Ct.x,Ut=Ct.y,Ri=ue[0]*Et+ue[4]*Ut+ue[12],Ai=ue[1]*Et+ue[5]*Ut+ue[13],Bs=ue[2]*Et+ue[6]*Ut+ue[14],uo=ue[3]*Et+ue[7]*Ut+ue[15],on=Bs+Ke,Ls=uo+pt,On=Ri+Ot,Dn=Ai+ft,Fn=Bs+ct,gs=uo+At,zs=new A((Ri+Ae)/Ls,(Ai+Le)/Ls);zs.z=on/Ls,yt.push(zs);const yn=new A(On/gs,Dn/gs);yn.z=Fn/gs,Ve.push(yn)}Me.push(yt),be.push(Ve)}return[Me,be]}(m,F,k,I);return function(q,Z,oe){let ue=1/0;sE(oe,Z)&&(ue=AE(oe,Z[0]));for(let Me=0;Meh.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new Ph,this.layoutVertexArray2=new Ml,this.indexArray=new zr,this.programConfigurations=new Gc(o.layers,o.zoom),this.segments=new oi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(o,h,d){this.hasPattern=uv("line",this.layers,h);const m=this.layers[0].layout.get("line-sort-key"),v=!m.isConstant(),x=[];for(const{feature:T,id:I,index:R,sourceLayerIndex:k}of o){const F=this.layers[0]._featureFilter.needGeometry,z=eu(T,F);if(!this.layers[0]._featureFilter.filter(new zi(this.zoom),z,d))continue;const $=v?m.evaluate(z,{},d):void 0,q={id:I,properties:T.properties,type:T.type,sourceLayerIndex:k,index:R,geometry:F?z.geometry:Qc(T),patterns:{},sortKey:$};x.push(q)}v&&x.sort((T,I)=>T.sortKey-I.sortKey);for(const T of x){const{geometry:I,index:R,sourceLayerIndex:k}=T;if(this.hasPattern){const F=hv("line",this.layers,T,this.zoom,h);this.patternFeatures.push(F)}else this.addFeature(T,I,R,d,{});h.featureIndex.insert(o[R].feature,I,R,k,this.index)}}update(o,h,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,h,this.stateDependentLayers,d)}addFeatures(o,h,d){for(const m of this.patternFeatures)this.addFeature(m,m.geometry,m.index,h,d)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,HF)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,jF),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(o){if(o.properties&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}}addFeature(o,h,d,m,v){const x=this.layers[0].layout,T=x.get("line-join").evaluate(o,{}),I=x.get("line-cap"),R=x.get("line-miter-limit"),k=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(const F of h)this.addLine(F,o,T,I,R,k);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,d,v,m)}addLine(o,h,d,m,v,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ue=0;ue=2&&o[I-1].equals(o[I-2]);)I--;let R=0;for(;R0;if(pt&&ue>R){const At=z.dist($);if(At>2*k){const xt=z.sub(z.sub($)._mult(k/At)._round());this.updateDistance($,xt),this.addCurrentVertex(xt,Z,0,0,F),$=xt}}const ft=$&&q;let ct=ft?d:T?"butt":m;if(ft&&ct==="round"&&(Lev&&(ct="bevel"),ct==="bevel"&&(Le>2&&(ct="flipbevel"),Le100)Me=oe.mult(-1);else{const At=Le*Z.add(oe).mag()/Z.sub(oe).mag();Me._perp()._mult(At*(Ot?-1:1))}this.addCurrentVertex(z,Me,0,0,F),this.addCurrentVertex(z,Me.mult(-1),0,0,F)}else if(ct==="bevel"||ct==="fakeround"){const At=-Math.sqrt(Le*Le-1),xt=Ot?At:0,yt=Ot?0:At;if($&&this.addCurrentVertex(z,Z,xt,yt,F),ct==="fakeround"){const Ve=Math.round(180*Ke/Math.PI/20);for(let Ct=1;Ct2*k){const xt=z.add(q.sub(z)._mult(k/At)._round());this.updateDistance(z,xt),this.addCurrentVertex(xt,oe,0,0,F),z=xt}}}}addCurrentVertex(o,h,d,m,v,x=!1){const T=h.y*m-h.x,I=-h.y-h.x*m;this.addHalfVertex(o,h.x+h.y*d,h.y-h.x*d,x,!1,d,v),this.addHalfVertex(o,T,I,x,!0,-m,v),this.distance>IE/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(o,h,d,m,v,x))}addHalfVertex({x:o,y:h},d,m,v,x,T,I){const R=.5*(this.lineClips?this.scaledDistance*(IE-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o<<1)+(v?1:0),(h<<1)+(x?1:0),Math.round(63*d)+128,Math.round(63*m)+128,1+(T===0?0:T<0?-1:1)|(63&R)<<2,R>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const k=I.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,k),I.primitiveLength++),x?this.e2=k:this.e1=k}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(o,h){this.distance+=o.dist(h),this.updateScaledDistance()}}let CE,PE;bt("LineBucket",gv,{omit:["layers","patternFeatures"]});var ME={get paint(){return PE=PE||new b({"line-opacity":new Ft(ce.paint_line["line-opacity"]),"line-color":new Ft(ce.paint_line["line-color"]),"line-translate":new Tt(ce.paint_line["line-translate"]),"line-translate-anchor":new Tt(ce.paint_line["line-translate-anchor"]),"line-width":new Ft(ce.paint_line["line-width"]),"line-gap-width":new Ft(ce.paint_line["line-gap-width"]),"line-offset":new Ft(ce.paint_line["line-offset"]),"line-blur":new Ft(ce.paint_line["line-blur"]),"line-dasharray":new Ch(ce.paint_line["line-dasharray"]),"line-pattern":new Ih(ce.paint_line["line-pattern"]),"line-gradient":new ip(ce.paint_line["line-gradient"])})},get layout(){return CE=CE||new b({"line-cap":new Tt(ce.layout_line["line-cap"]),"line-join":new Ft(ce.layout_line["line-join"]),"line-miter-limit":new Tt(ce.layout_line["line-miter-limit"]),"line-round-limit":new Tt(ce.layout_line["line-round-limit"]),"line-sort-key":new Ft(ce.layout_line["line-sort-key"])})}};class XF extends Ft{possiblyEvaluate(o,h){return h=new zi(Math.floor(h.zoom),{now:h.now,fadeDuration:h.fadeDuration,zoomHistory:h.zoomHistory,transition:h.transition}),super.possiblyEvaluate(o,h)}evaluate(o,h,d,m){return h=Fe({},h,{zoom:Math.floor(h.zoom)}),super.evaluate(o,h,d,m)}}let Jm;class ZF extends f{constructor(o){super(o,ME),this.gradientVersion=0,Jm||(Jm=new XF(ME.paint.properties["line-width"].specification),Jm.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(o){if(o==="line-gradient"){const h=this.gradientExpression();this.stepInterpolant=!!function(d){return d._styleExpression!==void 0}(h)&&h._styleExpression.expression instanceof vt,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(o,h){super.recalculate(o,h),this.paint._values["line-floorwidth"]=Jm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,o)}createBucket(o){return new gv(o)}queryRadius(o){const h=o,d=RE(rp("line-width",this,h),rp("line-gap-width",this,h)),m=rp("line-offset",this,h);return d/2+Math.abs(m)+Wm(this.paint.get("line-translate"))}queryIntersectsFeature(o,h,d,m,v,x,T){const I=qm(o,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,T),R=T/2*RE(this.paint.get("line-width").evaluate(h,d),this.paint.get("line-gap-width").evaluate(h,d)),k=this.paint.get("line-offset").evaluate(h,d);return k&&(m=function(F,z){const $=[];for(let q=0;q=3){for(let oe=0;oe0?o+2*l:l}const YF=E([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),KF=E([{name:"a_projected_pos",components:3,type:"Float32"}],4);E([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const JF=E([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);E([{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"}]);const kE=E([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),GF=E([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function QF(l,o,h){return l.sections.forEach(d=>{d.text=function(m,v,x){const T=v.layout.get("text-transform").evaluate(x,{});return T==="uppercase"?m=m.toLocaleUpperCase():T==="lowercase"&&(m=m.toLocaleLowerCase()),Kn.applyArabicShaping&&(m=Kn.applyArabicShaping(m)),m}(d.text,o,h)}),l}E([{name:"triangle",components:3,type:"Uint16"}]),E([{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"}]),E([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),E([{type:"Float32",name:"offsetX"}]),E([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),E([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const dp={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Cs=24,OE=Ei,DE=function(l,o,h,d,m){var v,x,T=8*m-d-1,I=(1<>1,k=-7,F=m-1,z=-1,$=l[o+F];for(F+=z,v=$&(1<<-k)-1,$>>=-k,k+=T;k>0;v=256*v+l[o+F],F+=z,k-=8);for(x=v&(1<<-k)-1,v>>=-k,k+=d;k>0;x=256*x+l[o+F],F+=z,k-=8);if(v===0)v=1-R;else{if(v===I)return x?NaN:1/0*($?-1:1);x+=Math.pow(2,d),v-=R}return($?-1:1)*x*Math.pow(2,v-d)},FE=function(l,o,h,d,m,v){var x,T,I,R=8*v-m-1,k=(1<>1,z=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=0,q=1,Z=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(T=isNaN(o)?1:0,x=k):(x=Math.floor(Math.log(o)/Math.LN2),o*(I=Math.pow(2,-x))<1&&(x--,I*=2),(o+=x+F>=1?z/I:z*Math.pow(2,1-F))*I>=2&&(x++,I/=2),x+F>=k?(T=0,x=k):x+F>=1?(T=(o*I-1)*Math.pow(2,m),x+=F):(T=o*Math.pow(2,F-1)*Math.pow(2,m),x=0));m>=8;l[h+$]=255&T,$+=q,T/=256,m-=8);for(x=x<0;l[h+$]=255&x,$+=q,x/=256,R-=8);l[h+$-q]|=128*Z};function Ei(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ei.Varint=0,Ei.Fixed64=1,Ei.Bytes=2,Ei.Fixed32=5;var mv=4294967296,NE=1/mv,BE=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Va(l){return l.type===Ei.Bytes?l.readVarint()+l.pos:l.pos+1}function zh(l,o,h){return h?4294967296*o+(l>>>0):4294967296*(o>>>0)+(l>>>0)}function LE(l,o,h){var d=o<=16383?1:o<=2097151?2:o<=268435455?3:Math.floor(Math.log(o)/(7*Math.LN2));h.realloc(d);for(var m=h.pos-1;m>=l;m--)h.buf[m+d]=h.buf[m]}function eN(l,o){for(var h=0;h>>8,l[h+2]=o>>>16,l[h+3]=o>>>24}function zE(l,o){return(l[o]|l[o+1]<<8|l[o+2]<<16)+(l[o+3]<<24)}Ei.prototype={destroy:function(){this.buf=null},readFields:function(l,o,h){for(h=h||this.length;this.pos>3,v=this.pos;this.type=7&d,l(m,o,this),this.pos===v&&this.skip(d)}return o},readMessage:function(l,o){return this.readFields(l,o,this.readVarint()+this.pos)},readFixed32:function(){var l=Gm(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=zE(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Gm(this.buf,this.pos)+Gm(this.buf,this.pos+4)*mv;return this.pos+=8,l},readSFixed64:function(){var l=Gm(this.buf,this.pos)+zE(this.buf,this.pos+4)*mv;return this.pos+=8,l},readFloat:function(){var l=DE(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=DE(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var o,h,d=this.buf;return o=127&(h=d[this.pos++]),h<128?o:(o|=(127&(h=d[this.pos++]))<<7,h<128?o:(o|=(127&(h=d[this.pos++]))<<14,h<128?o:(o|=(127&(h=d[this.pos++]))<<21,h<128?o:function(m,v,x){var T,I,R=x.buf;if(T=(112&(I=R[x.pos++]))>>4,I<128||(T|=(127&(I=R[x.pos++]))<<3,I<128)||(T|=(127&(I=R[x.pos++]))<<10,I<128)||(T|=(127&(I=R[x.pos++]))<<17,I<128)||(T|=(127&(I=R[x.pos++]))<<24,I<128)||(T|=(1&(I=R[x.pos++]))<<31,I<128))return zh(m,T,v);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&(h=d[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var l=this.readVarint()+this.pos,o=this.pos;return this.pos=l,l-o>=12&&BE?function(h,d,m){return BE.decode(h.subarray(d,m))}(this.buf,o,l):function(h,d,m){for(var v="",x=d;x239?4:k>223?3:k>191?2:1;if(x+z>m)break;z===1?k<128&&(F=k):z===2?(192&(T=h[x+1]))==128&&(F=(31&k)<<6|63&T)<=127&&(F=null):z===3?(I=h[x+2],(192&(T=h[x+1]))==128&&(192&I)==128&&((F=(15&k)<<12|(63&T)<<6|63&I)<=2047||F>=55296&&F<=57343)&&(F=null)):z===4&&(I=h[x+2],R=h[x+3],(192&(T=h[x+1]))==128&&(192&I)==128&&(192&R)==128&&((F=(15&k)<<18|(63&T)<<12|(63&I)<<6|63&R)<=65535||F>=1114112)&&(F=null)),F===null?(F=65533,z=1):F>65535&&(F-=65536,v+=String.fromCharCode(F>>>10&1023|55296),F=56320|1023&F),v+=String.fromCharCode(F),x+=z}return v}(this.buf,o,l)},readBytes:function(){var l=this.readVarint()+this.pos,o=this.buf.subarray(this.pos,l);return this.pos=l,o},readPackedVarint:function(l,o){if(this.type!==Ei.Bytes)return l.push(this.readVarint(o));var h=Va(this);for(l=l||[];this.pos127;);else if(o===Ei.Bytes)this.pos=this.readVarint()+this.pos;else if(o===Ei.Fixed32)this.pos+=4;else{if(o!==Ei.Fixed64)throw new Error("Unimplemented type: "+o);this.pos+=8}},writeTag:function(l,o){this.writeVarint(l<<3|o)},realloc:function(l){for(var o=this.length||16;o268435455||l<0?function(o,h){var d,m;if(o>=0?(d=o%4294967296|0,m=o/4294967296|0):(m=~(-o/4294967296),4294967295^(d=~(-o%4294967296))?d=d+1|0:(d=0,m=m+1|0)),o>=18446744073709552e3||o<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(v,x,T){T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,v>>>=7,T.buf[T.pos++]=127&v|128,T.buf[T.pos]=127&(v>>>=7)}(d,0,h),function(v,x){var T=(7&v)<<4;x.buf[x.pos++]|=T|((v>>>=3)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v|((v>>>=7)?128:0),v&&(x.buf[x.pos++]=127&v)))))}(m,h)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(!!l)},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var o=this.pos;this.pos=function(d,m,v){for(var x,T,I=0;I55295&&x<57344){if(!T){x>56319||I+1===m.length?(d[v++]=239,d[v++]=191,d[v++]=189):T=x;continue}if(x<56320){d[v++]=239,d[v++]=191,d[v++]=189,T=x;continue}x=T-55296<<10|x-56320|65536,T=null}else T&&(d[v++]=239,d[v++]=191,d[v++]=189,T=null);x<128?d[v++]=x:(x<2048?d[v++]=x>>6|192:(x<65536?d[v++]=x>>12|224:(d[v++]=x>>18|240,d[v++]=x>>12&63|128),d[v++]=x>>6&63|128),d[v++]=63&x|128)}return v}(this.buf,l,this.pos);var h=this.pos-o;h>=128&&LE(o,h,this),this.pos=o-1,this.writeVarint(h),this.pos+=h},writeFloat:function(l){this.realloc(4),FE(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),FE(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var o=l.length;this.writeVarint(o),this.realloc(o);for(var h=0;h=128&&LE(h,d,this),this.pos=h-1,this.writeVarint(d),this.pos+=d},writeMessage:function(l,o,h){this.writeTag(l,Ei.Bytes),this.writeRawMessage(o,h)},writePackedVarint:function(l,o){o.length&&this.writeMessage(l,eN,o)},writePackedSVarint:function(l,o){o.length&&this.writeMessage(l,tN,o)},writePackedBoolean:function(l,o){o.length&&this.writeMessage(l,nN,o)},writePackedFloat:function(l,o){o.length&&this.writeMessage(l,iN,o)},writePackedDouble:function(l,o){o.length&&this.writeMessage(l,sN,o)},writePackedFixed32:function(l,o){o.length&&this.writeMessage(l,rN,o)},writePackedSFixed32:function(l,o){o.length&&this.writeMessage(l,oN,o)},writePackedFixed64:function(l,o){o.length&&this.writeMessage(l,aN,o)},writePackedSFixed64:function(l,o){o.length&&this.writeMessage(l,lN,o)},writeBytesField:function(l,o){this.writeTag(l,Ei.Bytes),this.writeBytes(o)},writeFixed32Field:function(l,o){this.writeTag(l,Ei.Fixed32),this.writeFixed32(o)},writeSFixed32Field:function(l,o){this.writeTag(l,Ei.Fixed32),this.writeSFixed32(o)},writeFixed64Field:function(l,o){this.writeTag(l,Ei.Fixed64),this.writeFixed64(o)},writeSFixed64Field:function(l,o){this.writeTag(l,Ei.Fixed64),this.writeSFixed64(o)},writeVarintField:function(l,o){this.writeTag(l,Ei.Varint),this.writeVarint(o)},writeSVarintField:function(l,o){this.writeTag(l,Ei.Varint),this.writeSVarint(o)},writeStringField:function(l,o){this.writeTag(l,Ei.Bytes),this.writeString(o)},writeFloatField:function(l,o){this.writeTag(l,Ei.Fixed32),this.writeFloat(o)},writeDoubleField:function(l,o){this.writeTag(l,Ei.Fixed64),this.writeDouble(o)},writeBooleanField:function(l,o){this.writeVarintField(l,!!o)}};var _v=_(OE);const yv=3;function cN(l,o,h){l===1&&h.readMessage(uN,o)}function uN(l,o,h){if(l===3){const{id:d,bitmap:m,width:v,height:x,left:T,top:I,advance:R}=h.readMessage(hN,{});o.push({id:d,bitmap:new ap({width:v+2*yv,height:x+2*yv},m),metrics:{width:v,height:x,left:T,top:I,advance:R}})}}function hN(l,o,h){l===1?o.id=h.readVarint():l===2?o.bitmap=h.readBytes():l===3?o.width=h.readVarint():l===4?o.height=h.readVarint():l===5?o.left=h.readSVarint():l===6?o.top=h.readSVarint():l===7&&(o.advance=h.readVarint())}const UE=yv;function VE(l){let o=0,h=0;for(const x of l)o+=x.w*x.h,h=Math.max(h,x.w);l.sort((x,T)=>T.h-x.h);const d=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),h),h:1/0}];let m=0,v=0;for(const x of l)for(let T=d.length-1;T>=0;T--){const I=d[T];if(!(x.w>I.w||x.h>I.h)){if(x.x=I.x,x.y=I.y,v=Math.max(v,x.y+x.h),m=Math.max(m,x.x+x.w),x.w===I.w&&x.h===I.h){const R=d.pop();T=0&&d>=o&&e_[this.text.charCodeAt(d)];d--)h--;this.text=this.text.substring(o,h),this.sectionIndex=this.sectionIndex.slice(o,h)}substring(o,h){const d=new Vh;return d.text=this.text.substring(o,h),d.sectionIndex=this.sectionIndex.slice(o,h),d.sections=this.sections,d}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((o,h)=>Math.max(o,this.sections[h].scale),0)}addTextSection(o,h){this.text+=o.text,this.sections.push(gp.forText(o.scale,o.fontStack||h));const d=this.sections.length-1;for(let m=0;m=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Qm(l,o,h,d,m,v,x,T,I,R,k,F,z,$,q){const Z=Vh.fromFeature(l,m);let oe;F===u.ah.vertical&&Z.verticalizePunctuation();const{processBidirectionalText:ue,processStyledBidirectionalText:Me}=Kn;if(ue&&Z.sections.length===1){oe=[];const Le=ue(Z.toString(),vv(Z,R,v,o,d,$));for(const Ke of Le){const pt=new Vh;pt.text=Ke,pt.sections=Z.sections;for(let Ot=0;Ot0&&ja>ln&&(ln=ja)}else{const $r=pt[di.fontStack],Zs=$r&&$r[$i];if(Zs&&Zs.rect)Wh=Zs.rect,us=Zs.metrics;else{const ja=Ke[di.fontStack],xp=ja&&ja[$i];if(!xp)continue;us=xp.metrics}xr=(zs-di.scale)*Cs}ho?(Le.verticalizable=!0,Nn.push({glyph:$i,imageName:Zo,x:Ut,y:Ri+xr,vertical:ho,scale:di.scale,fontStack:di.fontStack,sectionIndex:Bi,metrics:us,rect:Wh}),Ut+=Yo*di.scale+Ve):(Nn.push({glyph:$i,imageName:Zo,x:Ut,y:Ri+xr,vertical:ho,scale:di.scale,fontStack:di.fontStack,sectionIndex:Bi,metrics:us,rect:Wh}),Ut+=us.advance*di.scale+Ve)}Nn.length!==0&&(Ai=Math.max(Ut-Ve,Ai),gN(Nn,0,Nn.length-1,uo,ln)),Ut=0;const jr=ct*zs+ln;an.lineOffset=Math.max(ln,yn),Ri+=jr,Bs=Math.max(jr,Bs),++on}var Ls;const On=Ri-pp,{horizontalAlign:Dn,verticalAlign:Fn}=xv(At);(function(gs,zs,yn,an,Nn,ln,jr,Qn,di){const Bi=(zs-yn)*Nn;let $i=0;$i=ln!==jr?-Qn*an-pp:(-an*di+.5)*jr;for(const xr of gs)for(const us of xr.positionedGlyphs)us.x+=Bi,us.y+=$i})(Le.positionedLines,uo,Dn,Fn,Ai,Bs,ct,On,ft.length),Le.top+=-Fn*On,Le.bottom=Le.top+On,Le.left+=-Dn*Ai,Le.right=Le.left+Ai}(Ae,o,h,d,oe,x,T,I,F,R,z,q),!function(Le){for(const Ke of Le)if(Ke.positionedGlyphs.length!==0)return!1;return!0}(be)&&Ae}const e_={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fN={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},dN={40:!0};function $E(l,o,h,d,m,v){if(o.imageName){const x=d[o.imageName];return x?x.displaySize[0]*o.scale*Cs/v+m:0}{const x=h[o.fontStack],T=x&&x[l];return T?T.metrics.advance*o.scale+m:0}}function HE(l,o,h,d){const m=Math.pow(l-o,2);return d?l=0;let R=0;for(let F=0;FR){const k=Math.ceil(v/R);m*=k/x,x=k}return{x1:d,y1:m,x2:d+v,y2:m+x}}function ZE(l,o,h,d,m,v){const x=l.image;let T;if(x.content){const oe=x.content,ue=x.pixelRatio||1;T=[oe[0]/ue,oe[1]/ue,x.displaySize[0]-oe[2]/ue,x.displaySize[1]-oe[3]/ue]}const I=o.left*v,R=o.right*v;let k,F,z,$;h==="width"||h==="both"?($=m[0]+I-d[3],F=m[0]+R+d[1]):($=m[0]+(I+R-x.displaySize[0])/2,F=$+x.displaySize[0]);const q=o.top*v,Z=o.bottom*v;return h==="height"||h==="both"?(k=m[1]+q-d[0],z=m[1]+Z+d[2]):(k=m[1]+(q+Z-x.displaySize[1])/2,z=k+x.displaySize[1]),{image:x,top:k,right:F,bottom:z,left:$,collisionPadding:T}}const mp=255,Xo=128,Bl=mp*Xo;function YE(l,o){const{expression:h}=o;if(h.kind==="constant")return{kind:"constant",layoutSize:h.evaluate(new zi(l+1))};if(h.kind==="source")return{kind:"source"};{const{zoomStops:d,interpolationType:m}=h;let v=0;for(;vx.id),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=nv([]),this.placementViewportMatrix=nv([]);const h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=YE(this.zoom,h["text-size"]),this.iconSizeData=YE(this.zoom,h["icon-size"]);const d=this.layers[0].layout,m=d.get("symbol-sort-key"),v=d.get("symbol-z-order");this.canOverlap=wv(d,"text-overlap","text-allow-overlap")!=="never"||wv(d,"icon-overlap","icon-allow-overlap")!=="never"||d.get("text-ignore-placement")||d.get("icon-ignore-placement"),this.sortFeaturesByKey=v!=="viewport-y"&&!m.isConstant(),this.sortFeaturesByY=(v==="viewport-y"||v==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,d.get("symbol-placement")==="point"&&(this.writingModes=d.get("text-writing-mode").map(x=>u.ah[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=o.sourceID}createArrays(){this.text=new Sv(new Gc(this.layers,this.zoom,o=>/^text/.test(o))),this.icon=new Sv(new Gc(this.layers,this.zoom,o=>/^icon/.test(o))),this.glyphOffsetArray=new Vi,this.lineVertexArray=new tn,this.symbolInstances=new si,this.textAnchorOffsets=new ji}calculateGlyphDependencies(o,h,d,m,v){for(let x=0;x0)&&(x.value.kind!=="constant"||x.value.value.length>0),k=I.value.kind!=="constant"||!!I.value.value||Object.keys(I.parameters).length>0,F=v.get("symbol-sort-key");if(this.features=[],!R&&!k)return;const z=h.iconDependencies,$=h.glyphDependencies,q=h.availableImages,Z=new zi(this.zoom);for(const{feature:oe,id:ue,index:Me,sourceLayerIndex:be}of o){const Ae=m._featureFilter.needGeometry,Le=eu(oe,Ae);if(!m._featureFilter.filter(Z,Le,d))continue;let Ke,pt;if(Ae||(Le.geometry=Qc(oe)),R){const ft=m.getValueAndResolveTokens("text-field",Le,d,q),ct=fs.factory(ft),At=this.hasRTLText=this.hasRTLText||bN(ct);(!At||Kn.getRTLTextPluginStatus()==="unavailable"||At&&Kn.isParsed())&&(Ke=QF(ct,m,Le))}if(k){const ft=m.getValueAndResolveTokens("icon-image",Le,d,q);pt=ft instanceof cs?ft:cs.fromString(ft)}if(!Ke&&!pt)continue;const Ot=this.sortFeaturesByKey?F.evaluate(Le,{},d):void 0;if(this.features.push({id:ue,text:Ke,icon:pt,index:Me,sourceLayerIndex:be,geometry:Le.geometry,properties:oe.properties,type:_N[oe.type],sortKey:Ot}),pt&&(z[pt.name]=!0),Ke){const ft=x.evaluate(Le,{},d).join(","),ct=v.get("text-rotation-alignment")!=="viewport"&&v.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(u.ah.vertical)>=0;for(const At of Ke.sections)if(At.image)z[At.image.name]=!0;else{const xt=Gd(Ke.toString()),yt=At.fontStack||ft,Ve=$[yt]=$[yt]||{};this.calculateGlyphDependencies(At.text,Ve,ct,this.allowVerticalPlacement,xt)}}}v.get("symbol-placement")==="line"&&(this.features=function(oe){const ue={},Me={},be=[];let Ae=0;function Le(ft){be.push(oe[ft]),Ae++}function Ke(ft,ct,At){const xt=Me[ft];return delete Me[ft],Me[ct]=xt,be[xt].geometry[0].pop(),be[xt].geometry[0]=be[xt].geometry[0].concat(At[0]),xt}function pt(ft,ct,At){const xt=ue[ct];return delete ue[ct],ue[ft]=xt,be[xt].geometry[0].shift(),be[xt].geometry[0]=At[0].concat(be[xt].geometry[0]),xt}function Ot(ft,ct,At){const xt=At?ct[0][ct[0].length-1]:ct[0][0];return`${ft}:${xt.x}:${xt.y}`}for(let ft=0;ftft.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((oe,ue)=>oe.sortKey-ue.sortKey)}update(o,h,d){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,h,this.layers,d),this.icon.programConfigurations.updatePaintArrays(o,h,this.layers,d))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(o,h){const d=this.lineVertexArray.length;if(o.segment!==void 0){let m=o.dist(h[o.segment+1]),v=o.dist(h[o.segment]);const x={};for(let T=o.segment+1;T=0;T--)x[T]={x:h[T].x,y:h[T].y,tileUnitDistanceFromAnchor:v},T>0&&(v+=h[T-1].dist(h[T]));for(let T=0;T0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(o,h){const d=o.placedSymbolArray.get(h),m=d.vertexStartIndex+4*d.numGlyphs;for(let v=d.vertexStartIndex;vm[T]-m[I]||v[I]-v[T]),x}addToSortKeyRanges(o,h){const d=this.sortKeyRanges[this.sortKeyRanges.length-1];d&&d.sortKey===h?d.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:o,symbolInstanceEnd:o+1})}sortFeatures(o){if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const h of this.symbolInstanceIndexes){const d=this.symbolInstances.get(h);this.featureSortOrder.push(d.featureIndex),[d.rightJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.leftJustifiedTextSymbolIndex].forEach((m,v,x)=>{m>=0&&x.indexOf(m)===v&&this.addIndicesForPlacedSymbol(this.text,m)}),d.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,d.verticalPlacedTextSymbolIndex),d.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.placedIconSymbolIndex),d.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,d.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let KE,JE;bt("SymbolBucket",jh,{omit:["layers","collisionBoxArray","features","compareText"]}),jh.MAX_GLYPHS=65535,jh.addDynamicAttributes=Tv;var Av={get paint(){return JE=JE||new b({"icon-opacity":new Ft(ce.paint_symbol["icon-opacity"]),"icon-color":new Ft(ce.paint_symbol["icon-color"]),"icon-halo-color":new Ft(ce.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ft(ce.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ft(ce.paint_symbol["icon-halo-blur"]),"icon-translate":new Tt(ce.paint_symbol["icon-translate"]),"icon-translate-anchor":new Tt(ce.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ft(ce.paint_symbol["text-opacity"]),"text-color":new Ft(ce.paint_symbol["text-color"],{runtimeType:wi,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new Ft(ce.paint_symbol["text-halo-color"]),"text-halo-width":new Ft(ce.paint_symbol["text-halo-width"]),"text-halo-blur":new Ft(ce.paint_symbol["text-halo-blur"]),"text-translate":new Tt(ce.paint_symbol["text-translate"]),"text-translate-anchor":new Tt(ce.paint_symbol["text-translate-anchor"])})},get layout(){return KE=KE||new b({"symbol-placement":new Tt(ce.layout_symbol["symbol-placement"]),"symbol-spacing":new Tt(ce.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Tt(ce.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ft(ce.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Tt(ce.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Tt(ce.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Tt(ce.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Tt(ce.layout_symbol["icon-ignore-placement"]),"icon-optional":new Tt(ce.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Tt(ce.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ft(ce.layout_symbol["icon-size"]),"icon-text-fit":new Tt(ce.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Tt(ce.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ft(ce.layout_symbol["icon-image"]),"icon-rotate":new Ft(ce.layout_symbol["icon-rotate"]),"icon-padding":new Ft(ce.layout_symbol["icon-padding"]),"icon-keep-upright":new Tt(ce.layout_symbol["icon-keep-upright"]),"icon-offset":new Ft(ce.layout_symbol["icon-offset"]),"icon-anchor":new Ft(ce.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Tt(ce.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Tt(ce.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Tt(ce.layout_symbol["text-rotation-alignment"]),"text-field":new Ft(ce.layout_symbol["text-field"]),"text-font":new Ft(ce.layout_symbol["text-font"]),"text-size":new Ft(ce.layout_symbol["text-size"]),"text-max-width":new Ft(ce.layout_symbol["text-max-width"]),"text-line-height":new Tt(ce.layout_symbol["text-line-height"]),"text-letter-spacing":new Ft(ce.layout_symbol["text-letter-spacing"]),"text-justify":new Ft(ce.layout_symbol["text-justify"]),"text-radial-offset":new Ft(ce.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Tt(ce.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ft(ce.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ft(ce.layout_symbol["text-anchor"]),"text-max-angle":new Tt(ce.layout_symbol["text-max-angle"]),"text-writing-mode":new Tt(ce.layout_symbol["text-writing-mode"]),"text-rotate":new Ft(ce.layout_symbol["text-rotate"]),"text-padding":new Tt(ce.layout_symbol["text-padding"]),"text-keep-upright":new Tt(ce.layout_symbol["text-keep-upright"]),"text-transform":new Ft(ce.layout_symbol["text-transform"]),"text-offset":new Ft(ce.layout_symbol["text-offset"]),"text-allow-overlap":new Tt(ce.layout_symbol["text-allow-overlap"]),"text-overlap":new Tt(ce.layout_symbol["text-overlap"]),"text-ignore-placement":new Tt(ce.layout_symbol["text-ignore-placement"]),"text-optional":new Tt(ce.layout_symbol["text-optional"])})}};class GE{constructor(o){if(o.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=o.property.overrides?o.property.overrides.runtimeType:Gi,this.defaultValue=o}evaluate(o){if(o.formattedSection){const h=this.defaultValue.property.overrides;if(h&&h.hasOverride(o.formattedSection))return h.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default}eachChild(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}bt("FormatSectionOverride",GE,{omit:["defaultValue"]});class i_ extends f{constructor(o){super(o,Av)}recalculate(o,h){if(super.recalculate(o,h),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const d=this.layout.get("text-writing-mode");if(d){const m=[];for(const v of d)m.indexOf(v)<0&&m.push(v);this.layout._values["text-writing-mode"]=m}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(o,h,d,m){const v=this.layout.get(o).evaluate(h,{},d,m),x=this._unevaluatedLayout._values[o];return x.isDataDriven()||gh(x.value)||!v?v:function(T,I){return I.replace(/{([^{}]+)}/g,(R,k)=>T&&k in T?String(T[k]):"")}(h.properties,v)}createBucket(o){return new jh(o)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const o of Av.paint.overridableProperties){if(!i_.hasPaintOverride(this.layout,o))continue;const h=this.paint.get(o),d=new GE(h),m=new ph(d,h.property.specification);let v=null;v=h.value.kind==="constant"||h.value.kind==="source"?new bl("source",m):new vl("composite",m,h.value.zoomStops),this.paint._values[o]=new lo(h.property,v,h.parameters)}}_handleOverridablePaintPropertyUpdate(o,h,d){return!(!this.layout||h.isDataDriven()||d.isDataDriven())&&i_.hasPaintOverride(this.layout,o)}static hasPaintOverride(o,h){const d=o.get("text-field"),m=Av.paint.properties[h];let v=!1;const x=T=>{for(const I of T)if(m.overrides&&m.overrides.hasOverride(I))return void(v=!0)};if(d.value.kind==="constant"&&d.value.value instanceof fs)x(d.value.value.sections);else if(d.value.kind==="source"){const T=R=>{v||(R instanceof Gs&&Zi(R.value)===Dr?x(R.value.sections):R instanceof rh?x(R.sections):R.eachChild(T))},I=d.value;I._styleExpression&&T(I._styleExpression.expression)}return v}}let QE;var vN={get paint(){return QE=QE||new b({"background-color":new Tt(ce.paint_background["background-color"]),"background-pattern":new Ch(ce.paint_background["background-pattern"]),"background-opacity":new Tt(ce.paint_background["background-opacity"])})}};class xN extends f{constructor(o){super(o,vN)}}let eA;var wN={get paint(){return eA=eA||new b({"raster-opacity":new Tt(ce.paint_raster["raster-opacity"]),"raster-hue-rotate":new Tt(ce.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Tt(ce.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Tt(ce.paint_raster["raster-brightness-max"]),"raster-saturation":new Tt(ce.paint_raster["raster-saturation"]),"raster-contrast":new Tt(ce.paint_raster["raster-contrast"]),"raster-resampling":new Tt(ce.paint_raster["raster-resampling"]),"raster-fade-duration":new Tt(ce.paint_raster["raster-fade-duration"])})}};class TN extends f{constructor(o){super(o,wN)}}class SN extends f{constructor(o){super(o,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=o}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class EN{constructor(o){this._methodToThrottle=o,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Iv=63710088e-1;class Ll{constructor(o,h){if(isNaN(o)||isNaN(h))throw new Error(`Invalid LngLat object: (${o}, ${h})`);if(this.lng=+o,this.lat=+h,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ll(Te(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(o){const h=Math.PI/180,d=this.lat*h,m=o.lat*h,v=Math.sin(d)*Math.sin(m)+Math.cos(d)*Math.cos(m)*Math.cos((o.lng-this.lng)*h);return Iv*Math.acos(Math.min(v,1))}static convert(o){if(o instanceof Ll)return o;if(Array.isArray(o)&&(o.length===2||o.length===3))return new Ll(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&typeof o=="object"&&o!==null)return new Ll(Number("lng"in o?o.lng:o.lon),Number(o.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const tA=2*Math.PI*Iv;function iA(l){return tA*Math.cos(l*Math.PI/180)}function sA(l){return(180+l)/360}function nA(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function rA(l,o){return l/iA(o)}function Cv(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class _p{constructor(o,h,d=0){this.x=+o,this.y=+h,this.z=+d}static fromLngLat(o,h=0){const d=Ll.convert(o);return new _p(sA(d.lng),nA(d.lat),rA(h,d.lat))}toLngLat(){return new Ll(360*this.x-180,Cv(this.y))}toAltitude(){return this.z*iA(Cv(this.y))}meterInMercatorCoordinateUnits(){return 1/tA*(o=Cv(this.y),1/Math.cos(o*Math.PI/180));var o}}function oA(l,o,h){var d=2*Math.PI*6378137/256/Math.pow(2,h);return[l*d-2*Math.PI*6378137/2,o*d-2*Math.PI*6378137/2]}class Pv{constructor(o,h,d){if(!function(m,v,x){return!(m<0||m>25||x<0||x>=Math.pow(2,m)||v<0||v>=Math.pow(2,m))}(o,h,d))throw new Error(`x=${h}, y=${d}, z=${o} outside of bounds. 0<=x<${Math.pow(2,o)}, 0<=y<${Math.pow(2,o)} 0<=z<=25 `);this.z=o,this.x=h,this.y=d,this.key=yp(0,o,o,h,d)}equals(o){return this.z===o.z&&this.x===o.x&&this.y===o.y}url(o,h,d){const m=(x=this.y,T=this.z,I=oA(256*(v=this.x),256*(x=Math.pow(2,T)-x-1),T),R=oA(256*(v+1),256*(x+1),T),I[0]+","+I[1]+","+R[0]+","+R[1]);var v,x,T,I,R;const k=function(F,z,$){let q,Z="";for(let oe=F;oe>0;oe--)q=1<1?"@2x":"").replace(/{quadkey}/g,k).replace(/{bbox-epsg-3857}/g,m)}isChildOf(o){const h=this.z-o.z;return h>0&&o.x===this.x>>h&&o.y===this.y>>h}getTilePoint(o){const h=Math.pow(2,this.z);return new A((o.x*h-this.x)*Es,(o.y*h-this.y)*Es)}toString(){return`${this.z}/${this.x}/${this.y}`}}class aA{constructor(o,h){this.wrap=o,this.canonical=h,this.key=yp(o,h.z,h.z,h.x,h.y)}}class Vr{constructor(o,h,d,m,v){if(o= z; overscaledZ = ${o}; z = ${d}`);this.overscaledZ=o,this.wrap=h,this.canonical=new Pv(d,+m,+v),this.key=yp(h,o,d,m,v)}clone(){return new Vr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(o){return this.overscaledZ===o.overscaledZ&&this.wrap===o.wrap&&this.canonical.equals(o.canonical)}scaledTo(o){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const h=this.canonical.z-o;return o>this.canonical.z?new Vr(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Vr(o,this.wrap,o,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(o,h){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const d=this.canonical.z-o;return o>this.canonical.z?yp(this.wrap*+h,o,this.canonical.z,this.canonical.x,this.canonical.y):yp(this.wrap*+h,o,o,this.canonical.x>>d,this.canonical.y>>d)}isChildOf(o){if(o.wrap!==this.wrap)return!1;const h=this.canonical.z-o.canonical.z;return o.overscaledZ===0||o.overscaledZ>h&&o.canonical.y===this.canonical.y>>h}children(o){if(this.overscaledZ>=o)return[new Vr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const h=this.canonical.z+1,d=2*this.canonical.x,m=2*this.canonical.y;return[new Vr(h,this.wrap,h,d,m),new Vr(h,this.wrap,h,d+1,m),new Vr(h,this.wrap,h,d,m+1),new Vr(h,this.wrap,h,d+1,m+1)]}isLessThan(o){return this.wrapo.wrap)&&(this.overscaledZo.overscaledZ)&&(this.canonical.xo.canonical.x)&&this.canonical.ythis.max&&(this.max=F),F=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(h+1)*this.stride+(o+1)}unpack(o,h,d){return o*this.redFactor+h*this.greenFactor+d*this.blueFactor-this.baseShift}getPixels(){return new Ur({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(o,h,d){if(this.dim!==o.dim)throw new Error("dem dimension mismatch");let m=h*this.dim,v=h*this.dim+this.dim,x=d*this.dim,T=d*this.dim+this.dim;switch(h){case-1:m=v-1;break;case 1:v=m+1}switch(d){case-1:x=T-1;break;case 1:T=x+1}const I=-h*this.dim,R=-d*this.dim;for(let k=x;k=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${o} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[o]}}class uA{constructor(o,h,d,m,v){this.type="Feature",this._vectorTileFeature=o,o._z=h,o._x=d,o._y=m,this.properties=o.properties,this.id=v}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(o){this._geometry=o}toJSON(){const o={geometry:this.geometry};for(const h in this)h!=="_geometry"&&h!=="_vectorTileFeature"&&(o[h]=this[h]);return o}}class hA{constructor(o,h){this.tileID=o,this.x=o.canonical.x,this.y=o.canonical.y,this.z=o.canonical.z,this.grid=new Sl(Es,16,0),this.grid3D=new Sl(Es,16,0),this.featureIndexArray=new mn,this.promoteId=h}insert(o,h,d,m,v,x){const T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(d,m,v);const I=x?this.grid3D:this.grid;for(let R=0;R=0&&F[3]>=0&&I.insert(T,F[0],F[1],F[2],F[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Fl.VectorTile(new _v(this.rawTileData)).layers,this.sourceLayerCoder=new cA(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(o,h,d,m){this.loadVTLayers();const v=o.params||{},x=Es/o.tileSize/o.scale,T=Bd(v.filter),I=o.queryGeometry,R=o.queryPadding*x,k=dA(I),F=this.grid.query(k.minX-R,k.minY-R,k.maxX+R,k.maxY+R),z=dA(o.cameraQueryGeometry),$=this.grid3D.query(z.minX-R,z.minY-R,z.maxX+R,z.maxY+R,(oe,ue,Me,be)=>function(Ae,Le,Ke,pt,Ot){for(const ct of Ae)if(Le<=ct.x&&Ke<=ct.y&&pt>=ct.x&&Ot>=ct.y)return!0;const ft=[new A(Le,Ke),new A(Le,Ot),new A(pt,Ot),new A(pt,Ke)];if(Ae.length>2){for(const ct of ft)if(Fh(Ae,ct))return!0}for(let ct=0;ct(be||(be=Qc(Ae)),Le.queryIntersectsFeature(I,Ae,Ke,be,this.z,o.transform,x,o.pixelPosMatrix)))}return q}loadMatchingFeature(o,h,d,m,v,x,T,I,R,k,F){const z=this.bucketLayerIDs[h];if(x&&!function(oe,ue){for(let Me=0;Me=0)return!0;return!1}(x,z))return;const $=this.sourceLayerCoder.decode(d),q=this.vtLayers[$].feature(m);if(v.needGeometry){const oe=eu(q,!0);if(!v.filter(new zi(this.tileID.overscaledZ),oe,this.tileID.canonical))return}else if(!v.filter(new zi(this.tileID.overscaledZ),q))return;const Z=this.getId(q,$);for(let oe=0;oe{const T=o instanceof Yc?o.get(x):null;return T&&T.evaluate?T.evaluate(h,d,m):T})}function dA(l){let o=1/0,h=1/0,d=-1/0,m=-1/0;for(const v of l)o=Math.min(o,v.x),h=Math.min(h,v.y),d=Math.max(d,v.x),m=Math.max(m,v.y);return{minX:o,minY:h,maxX:d,maxY:m}}function AN(l,o){return o-l}function pA(l,o,h,d,m){const v=[];for(let x=0;x=d&&F.x>=d||(k.x>=d?k=new A(d,k.y+(d-k.x)/(F.x-k.x)*(F.y-k.y))._round():F.x>=d&&(F=new A(d,k.y+(d-k.x)/(F.x-k.x)*(F.y-k.y))._round()),k.y>=m&&F.y>=m||(k.y>=m?k=new A(k.x+(m-k.y)/(F.y-k.y)*(F.x-k.x),m)._round():F.y>=m&&(F=new A(k.x+(m-k.y)/(F.y-k.y)*(F.x-k.x),m)._round()),I&&k.equals(I[I.length-1])||(I=[k],v.push(I)),I.push(F)))))}}return v}bt("FeatureIndex",hA,{omit:["rawTileData","sourceLayerCoder"]});class zl extends A{constructor(o,h,d,m){super(o,h),this.angle=d,m!==void 0&&(this.segment=m)}clone(){return new zl(this.x,this.y,this.angle,this.segment)}}function gA(l,o,h,d,m){if(o.segment===void 0||h===0)return!0;let v=o,x=o.segment+1,T=0;for(;T>-h/2;){if(x--,x<0)return!1;T-=l[x].dist(v),v=l[x]}T+=l[x].dist(l[x+1]),x++;const I=[];let R=0;for(;Td;)R-=I.shift().angleDelta;if(R>m)return!1;x++,T+=k.dist(F)}return!0}function mA(l){let o=0;for(let h=0;hR){const q=(R-I)/$,Z=Pn.number(F.x,z.x,q),oe=Pn.number(F.y,z.y,q),ue=new zl(Z,oe,z.angleTo(F),k);return ue._round(),!x||gA(l,ue,T,x,o)?ue:void 0}I+=$}}function CN(l,o,h,d,m,v,x,T,I){const R=_A(d,v,x),k=yA(d,m),F=k*x,z=l[0].x===0||l[0].x===I||l[0].y===0||l[0].y===I;return o-F=0&&Ae=0&&Le=0&&z+R<=k){const Ke=new zl(Ae,Le,Me,q);Ke._round(),d&&!gA(l,Ke,v,d,m)||$.push(Ke)}}F+=ue}return T||$.length||x||($=bA(l,F/2,h,d,m,v,x,!0,I)),$}bt("Anchor",zl);const $h=Gn;function vA(l,o,h,d){const m=[],v=l.image,x=v.pixelRatio,T=v.paddedRect.w-2*$h,I=v.paddedRect.h-2*$h;let R={x1:l.left,y1:l.top,x2:l.right,y2:l.bottom};const k=v.stretchX||[[0,T]],F=v.stretchY||[[0,I]],z=(Ve,Ct)=>Ve+Ct[1]-Ct[0],$=k.reduce(z,0),q=F.reduce(z,0),Z=T-$,oe=I-q;let ue=0,Me=$,be=0,Ae=q,Le=0,Ke=Z,pt=0,Ot=oe;if(v.content&&d){const Ve=v.content,Ct=Ve[2]-Ve[0],Et=Ve[3]-Ve[1];(v.textFitWidth||v.textFitHeight)&&(R=XE(l)),ue=s_(k,0,Ve[0]),be=s_(F,0,Ve[1]),Me=s_(k,Ve[0],Ve[2]),Ae=s_(F,Ve[1],Ve[3]),Le=Ve[0]-ue,pt=Ve[1]-be,Ke=Ct-Me,Ot=Et-Ae}const ft=R.x1,ct=R.y1,At=R.x2-ft,xt=R.y2-ct,yt=(Ve,Ct,Et,Ut)=>{const Ri=n_(Ve.stretch-ue,Me,At,ft),Ai=r_(Ve.fixed-Le,Ke,Ve.stretch,$),Bs=n_(Ct.stretch-be,Ae,xt,ct),uo=r_(Ct.fixed-pt,Ot,Ct.stretch,q),on=n_(Et.stretch-ue,Me,At,ft),Ls=r_(Et.fixed-Le,Ke,Et.stretch,$),On=n_(Ut.stretch-be,Ae,xt,ct),Dn=r_(Ut.fixed-pt,Ot,Ut.stretch,q),Fn=new A(Ri,Bs),gs=new A(on,Bs),zs=new A(on,On),yn=new A(Ri,On),an=new A(Ai/x,uo/x),Nn=new A(Ls/x,Dn/x),ln=o*Math.PI/180;if(ln){const di=Math.sin(ln),Bi=Math.cos(ln),$i=[Bi,-di,di,Bi];Fn._matMult($i),gs._matMult($i),yn._matMult($i),zs._matMult($i)}const jr=Ve.stretch+Ve.fixed,Qn=Ct.stretch+Ct.fixed;return{tl:Fn,tr:gs,bl:yn,br:zs,tex:{x:v.paddedRect.x+$h+jr,y:v.paddedRect.y+$h+Qn,w:Et.stretch+Et.fixed-jr,h:Ut.stretch+Ut.fixed-Qn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:an,pixelOffsetBR:Nn,minFontScaleX:Ke/x/At,minFontScaleY:Ot/x/xt,isSDF:h}};if(d&&(v.stretchX||v.stretchY)){const Ve=xA(k,Z,$),Ct=xA(F,oe,q);for(let Et=0;Et0&&(Z=Math.max(10,Z),this.circleDiameter=Z)}else{const z=!((F=x.image)===null||F===void 0)&&F.content&&(x.image.textFitWidth||x.image.textFitHeight)?XE(x):{x1:x.left,y1:x.top,x2:x.right,y2:x.bottom};z.y1=z.y1*T-I[0],z.y2=z.y2*T+I[2],z.x1=z.x1*T-I[3],z.x2=z.x2*T+I[1];const $=x.collisionPadding;if($&&(z.x1-=$[0]*T,z.y1-=$[1]*T,z.x2+=$[2]*T,z.y2+=$[3]*T),k){const q=new A(z.x1,z.y1),Z=new A(z.x2,z.y1),oe=new A(z.x1,z.y2),ue=new A(z.x2,z.y2),Me=k*Math.PI/180;q._rotate(Me),Z._rotate(Me),oe._rotate(Me),ue._rotate(Me),z.x1=Math.min(q.x,Z.x,oe.x,ue.x),z.x2=Math.max(q.x,Z.x,oe.x,ue.x),z.y1=Math.min(q.y,Z.y,oe.y,ue.y),z.y2=Math.max(q.y,Z.y,oe.y,ue.y)}o.emplaceBack(h.x,h.y,z.x1,z.y1,z.x2,z.y2,d,m,v)}this.boxEndIndex=o.length}}class PN{constructor(o=[],h=(d,m)=>dm?1:0){if(this.data=o,this.length=this.data.length,this.compare=h,this.length>0)for(let d=(this.length>>1)-1;d>=0;d--)this._down(d)}push(o){this.data.push(o),this._up(this.length++)}pop(){if(this.length===0)return;const o=this.data[0],h=this.data.pop();return--this.length>0&&(this.data[0]=h,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:h,compare:d}=this,m=h[o];for(;o>0;){const v=o-1>>1,x=h[v];if(d(m,x)>=0)break;h[o]=x,o=v}h[o]=m}_down(o){const{data:h,compare:d}=this,m=this.length>>1,v=h[o];for(;o=0)break;h[o]=h[x],o=x}h[o]=v}}function MN(l,o=1,h=!1){let d=1/0,m=1/0,v=-1/0,x=-1/0;const T=l[0];for(let $=0;$v)&&(v=q.x),(!$||q.y>x)&&(x=q.y)}const I=Math.min(v-d,x-m);let R=I/2;const k=new PN([],RN);if(I===0)return new A(d,m);for(let $=d;$F.d||!F.d)&&(F=$,h&&console.log("found best %d after %d probes",Math.round(1e4*$.d)/1e4,z)),$.max-F.d<=o||(R=$.h/2,k.push(new Hh($.p.x-R,$.p.y-R,R,l)),k.push(new Hh($.p.x+R,$.p.y-R,R,l)),k.push(new Hh($.p.x-R,$.p.y+R,R,l)),k.push(new Hh($.p.x+R,$.p.y+R,R,l)),z+=4)}return h&&(console.log(`num probes: ${z}`),console.log(`best distance: ${F.d}`)),F.p}function RN(l,o){return o.max-l.max}function Hh(l,o,h,d){this.p=new A(l,o),this.h=h,this.d=function(m,v){let x=!1,T=1/0;for(let I=0;Im.y!=q.y>m.y&&m.x<(q.x-$.x)*(m.y-$.y)/(q.y-$.y)+$.x&&(x=!x),T=Math.min(T,nE(m,$,q))}}return(x?1:-1)*Math.sqrt(T)}(this.p,d),this.max=this.d+this.h*Math.SQRT2}var rn;u.aq=void 0,(rn=u.aq||(u.aq={}))[rn.center=1]="center",rn[rn.left=2]="left",rn[rn.right=3]="right",rn[rn.top=4]="top",rn[rn.bottom=5]="bottom",rn[rn["top-left"]=6]="top-left",rn[rn["top-right"]=7]="top-right",rn[rn["bottom-left"]=8]="bottom-left",rn[rn["bottom-right"]=9]="bottom-right";const Ul=7,Mv=Number.POSITIVE_INFINITY;function wA(l,o){return o[1]!==Mv?function(h,d,m){let v=0,x=0;switch(d=Math.abs(d),m=Math.abs(m),h){case"top-right":case"top-left":case"top":x=m-Ul;break;case"bottom-right":case"bottom-left":case"bottom":x=-m+Ul}switch(h){case"top-right":case"bottom-right":case"right":v=-d;break;case"top-left":case"bottom-left":case"left":v=d}return[v,x]}(l,o[0],o[1]):function(h,d){let m=0,v=0;d<0&&(d=0);const x=d/Math.SQRT2;switch(h){case"top-right":case"top-left":v=x-Ul;break;case"bottom-right":case"bottom-left":v=-x+Ul;break;case"bottom":v=-d+Ul;break;case"top":v=d-Ul}switch(h){case"top-right":case"bottom-right":m=-x;break;case"top-left":case"bottom-left":m=x;break;case"left":m=d;break;case"right":m=-d}return[m,v]}(l,o[0])}function TA(l,o,h){var d;const m=l.layout,v=(d=m.get("text-variable-anchor-offset"))===null||d===void 0?void 0:d.evaluate(o,{},h);if(v){const T=v.values,I=[];for(let R=0;Rz*Cs);k.startsWith("top")?F[1]-=Ul:k.startsWith("bottom")&&(F[1]+=Ul),I[R+1]=F}return new ls(I)}const x=m.get("text-variable-anchor");if(x){let T;T=l._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[m.get("text-radial-offset").evaluate(o,{},h)*Cs,Mv]:m.get("text-offset").evaluate(o,{},h).map(R=>R*Cs);const I=[];for(const R of x)I.push(R,wA(R,T));return new ls(I)}return null}function Rv(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function kN(l,o,h,d,m,v,x,T,I,R,k){let F=v.textMaxSize.evaluate(o,{});F===void 0&&(F=x);const z=l.layers[0].layout,$=z.get("icon-offset").evaluate(o,{},k),q=EA(h.horizontal),Z=x/24,oe=l.tilePixelRatio*Z,ue=l.tilePixelRatio*F/24,Me=l.tilePixelRatio*T,be=l.tilePixelRatio*z.get("symbol-spacing"),Ae=z.get("text-padding")*l.tilePixelRatio,Le=function(Ve,Ct,Et,Ut=1){const Ri=Ve.get("icon-padding").evaluate(Ct,{},Et),Ai=Ri&&Ri.values;return[Ai[0]*Ut,Ai[1]*Ut,Ai[2]*Ut,Ai[3]*Ut]}(z,o,k,l.tilePixelRatio),Ke=z.get("text-max-angle")/180*Math.PI,pt=z.get("text-rotation-alignment")!=="viewport"&&z.get("symbol-placement")!=="point",Ot=z.get("icon-rotation-alignment")==="map"&&z.get("symbol-placement")!=="point",ft=z.get("symbol-placement"),ct=be/2,At=z.get("icon-text-fit");let xt;d&&At!=="none"&&(l.allowVerticalPlacement&&h.vertical&&(xt=ZE(d,h.vertical,At,z.get("icon-text-fit-padding"),$,Z)),q&&(d=ZE(d,q,At,z.get("icon-text-fit-padding"),$,Z)));const yt=(Ve,Ct)=>{Ct.x<0||Ct.x>=Es||Ct.y<0||Ct.y>=Es||function(Et,Ut,Ri,Ai,Bs,uo,on,Ls,On,Dn,Fn,gs,zs,yn,an,Nn,ln,jr,Qn,di,Bi,$i,xr,us,Wh){const Zo=Et.addToLineVertexArray(Ut,Ri);let Yo,ho,$r,Zs,ja=0,xp=0,PA=0,MA=0,zv=-1,Uv=-1;const $a={};let RA=Rh("");if(Et.allowVerticalPlacement&&Ai.vertical){const bn=Ls.layout.get("text-rotate").evaluate(Bi,{},us)+90;$r=new o_(On,Ut,Dn,Fn,gs,Ai.vertical,zs,yn,an,bn),on&&(Zs=new o_(On,Ut,Dn,Fn,gs,on,ln,jr,an,bn))}if(Bs){const bn=Ls.layout.get("icon-rotate").evaluate(Bi,{}),Hr=Ls.layout.get("icon-text-fit")!=="none",iu=vA(Bs,bn,xr,Hr),Po=on?vA(on,bn,xr,Hr):void 0;ho=new o_(On,Ut,Dn,Fn,gs,Bs,ln,jr,!1,bn),ja=4*iu.length;const su=Et.iconSizeData;let Ko=null;su.kind==="source"?(Ko=[Xo*Ls.layout.get("icon-size").evaluate(Bi,{})],Ko[0]>Bl&&ht(`${Et.layerIds[0]}: Value for "icon-size" is >= ${mp}. Reduce your "icon-size".`)):su.kind==="composite"&&(Ko=[Xo*$i.compositeIconSizes[0].evaluate(Bi,{},us),Xo*$i.compositeIconSizes[1].evaluate(Bi,{},us)],(Ko[0]>Bl||Ko[1]>Bl)&&ht(`${Et.layerIds[0]}: Value for "icon-size" is >= ${mp}. Reduce your "icon-size".`)),Et.addSymbols(Et.icon,iu,Ko,di,Qn,Bi,u.ah.none,Ut,Zo.lineStartIndex,Zo.lineLength,-1,us),zv=Et.icon.placedSymbolArray.length-1,Po&&(xp=4*Po.length,Et.addSymbols(Et.icon,Po,Ko,di,Qn,Bi,u.ah.vertical,Ut,Zo.lineStartIndex,Zo.lineLength,-1,us),Uv=Et.icon.placedSymbolArray.length-1)}const kA=Object.keys(Ai.horizontal);for(const bn of kA){const Hr=Ai.horizontal[bn];if(!Yo){RA=Rh(Hr.text);const Po=Ls.layout.get("text-rotate").evaluate(Bi,{},us);Yo=new o_(On,Ut,Dn,Fn,gs,Hr,zs,yn,an,Po)}const iu=Hr.positionedLines.length===1;if(PA+=SA(Et,Ut,Hr,uo,Ls,an,Bi,Nn,Zo,Ai.vertical?u.ah.horizontal:u.ah.horizontalOnly,iu?kA:[bn],$a,zv,$i,us),iu)break}Ai.vertical&&(MA+=SA(Et,Ut,Ai.vertical,uo,Ls,an,Bi,Nn,Zo,u.ah.vertical,["vertical"],$a,Uv,$i,us));const FN=Yo?Yo.boxStartIndex:Et.collisionBoxArray.length,NN=Yo?Yo.boxEndIndex:Et.collisionBoxArray.length,BN=$r?$r.boxStartIndex:Et.collisionBoxArray.length,LN=$r?$r.boxEndIndex:Et.collisionBoxArray.length,zN=ho?ho.boxStartIndex:Et.collisionBoxArray.length,UN=ho?ho.boxEndIndex:Et.collisionBoxArray.length,VN=Zs?Zs.boxStartIndex:Et.collisionBoxArray.length,jN=Zs?Zs.boxEndIndex:Et.collisionBoxArray.length;let Co=-1;const l_=(bn,Hr)=>bn&&bn.circleDiameter?Math.max(bn.circleDiameter,Hr):Hr;Co=l_(Yo,Co),Co=l_($r,Co),Co=l_(ho,Co),Co=l_(Zs,Co);const OA=Co>-1?1:0;OA&&(Co*=Wh/Cs),Et.glyphOffsetArray.length>=jh.MAX_GLYPHS&&ht("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Bi.sortKey!==void 0&&Et.addToSortKeyRanges(Et.symbolInstances.length,Bi.sortKey);const $N=TA(Ls,Bi,us),[HN,WN]=function(bn,Hr){const iu=bn.length,Po=Hr==null?void 0:Hr.values;if((Po==null?void 0:Po.length)>0)for(let su=0;su=0?$a.right:-1,$a.center>=0?$a.center:-1,$a.left>=0?$a.left:-1,$a.vertical||-1,zv,Uv,RA,FN,NN,BN,LN,zN,UN,VN,jN,Dn,PA,MA,ja,xp,OA,0,zs,Co,HN,WN)}(l,Ct,Ve,h,d,m,xt,l.layers[0],l.collisionBoxArray,o.index,o.sourceLayerIndex,l.index,oe,[Ae,Ae,Ae,Ae],pt,I,Me,Le,Ot,$,o,v,R,k,x)};if(ft==="line")for(const Ve of pA(o.geometry,0,0,Es,Es)){const Ct=CN(Ve,be,Ke,h.vertical||q,d,24,ue,l.overscaling,Es);for(const Et of Ct)q&&ON(l,q.text,ct,Et)||yt(Ve,Et)}else if(ft==="line-center"){for(const Ve of o.geometry)if(Ve.length>1){const Ct=IN(Ve,Ke,h.vertical||q,d,24,ue);Ct&&yt(Ve,Ct)}}else if(o.type==="Polygon")for(const Ve of ah(o.geometry,0)){const Ct=MN(Ve,16);yt(Ve[0],new zl(Ct.x,Ct.y,0))}else if(o.type==="LineString")for(const Ve of o.geometry)yt(Ve,new zl(Ve[0].x,Ve[0].y,0));else if(o.type==="Point")for(const Ve of o.geometry)for(const Ct of Ve)yt([Ct],new zl(Ct.x,Ct.y,0))}function SA(l,o,h,d,m,v,x,T,I,R,k,F,z,$,q){const Z=function(Me,be,Ae,Le,Ke,pt,Ot,ft){const ct=Le.layout.get("text-rotate").evaluate(pt,{})*Math.PI/180,At=[];for(const xt of be.positionedLines)for(const yt of xt.positionedGlyphs){if(!yt.rect)continue;const Ve=yt.rect||{};let Ct=UE+1,Et=!0,Ut=1,Ri=0;const Ai=(Ke||ft)&&yt.vertical,Bs=yt.metrics.advance*yt.scale/2;if(ft&&be.verticalizable&&(Ri=xt.lineOffset/2-(yt.imageName?-(Cs-yt.metrics.width*yt.scale)/2:(yt.scale-1)*Cs)),yt.imageName){const di=Ot[yt.imageName];Et=di.sdf,Ut=di.pixelRatio,Ct=Gn/Ut}const uo=Ke?[yt.x+Bs,yt.y]:[0,0];let on=Ke?[0,0]:[yt.x+Bs+Ae[0],yt.y+Ae[1]-Ri],Ls=[0,0];Ai&&(Ls=on,on=[0,0]);const On=yt.metrics.isDoubleResolution?2:1,Dn=(yt.metrics.left-Ct)*yt.scale-Bs+on[0],Fn=(-yt.metrics.top-Ct)*yt.scale+on[1],gs=Dn+Ve.w/On*yt.scale/Ut,zs=Fn+Ve.h/On*yt.scale/Ut,yn=new A(Dn,Fn),an=new A(gs,Fn),Nn=new A(Dn,zs),ln=new A(gs,zs);if(Ai){const di=new A(-Bs,Bs-pp),Bi=-Math.PI/2,$i=Cs/2-Bs,xr=new A(5-pp-$i,-(yt.imageName?$i:0)),us=new A(...Ls);yn._rotateAround(Bi,di)._add(xr)._add(us),an._rotateAround(Bi,di)._add(xr)._add(us),Nn._rotateAround(Bi,di)._add(xr)._add(us),ln._rotateAround(Bi,di)._add(xr)._add(us)}if(ct){const di=Math.sin(ct),Bi=Math.cos(ct),$i=[Bi,-di,di,Bi];yn._matMult($i),an._matMult($i),Nn._matMult($i),ln._matMult($i)}const jr=new A(0,0),Qn=new A(0,0);At.push({tl:yn,tr:an,bl:Nn,br:ln,tex:Ve,writingMode:be.writingMode,glyphOffset:uo,sectionIndex:yt.sectionIndex,isSDF:Et,pixelOffsetTL:jr,pixelOffsetBR:Qn,minFontScaleX:0,minFontScaleY:0})}return At}(0,h,T,m,v,x,d,l.allowVerticalPlacement),oe=l.textSizeData;let ue=null;oe.kind==="source"?(ue=[Xo*m.layout.get("text-size").evaluate(x,{})],ue[0]>Bl&&ht(`${l.layerIds[0]}: Value for "text-size" is >= ${mp}. Reduce your "text-size".`)):oe.kind==="composite"&&(ue=[Xo*$.compositeTextSizes[0].evaluate(x,{},q),Xo*$.compositeTextSizes[1].evaluate(x,{},q)],(ue[0]>Bl||ue[1]>Bl)&&ht(`${l.layerIds[0]}: Value for "text-size" is >= ${mp}. Reduce your "text-size".`)),l.addSymbols(l.text,Z,ue,T,v,x,R,o,I.lineStartIndex,I.lineLength,z,q);for(const Me of k)F[Me]=l.text.placedSymbolArray.length-1;return 4*Z.length}function EA(l){for(const o in l)return l[o];return null}function ON(l,o,h,d){const m=l.compareText;if(o in m){const v=m[o];for(let x=v.length-1;x>=0;x--)if(d.dist(v[x])>4;if(m!==1)throw new Error(`Got v${m} data when expected v1.`);const v=AA[15&d];if(!v)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(o,2,1),[T]=new Uint32Array(o,4,1);return new kv(T,x,v,o)}constructor(o,h=64,d=Float64Array,m){if(isNaN(o)||o<0)throw new Error(`Unpexpected numItems value: ${o}.`);this.numItems=+o,this.nodeSize=Math.min(Math.max(+h,2),65535),this.ArrayType=d,this.IndexArrayType=o<65536?Uint16Array:Uint32Array;const v=AA.indexOf(this.ArrayType),x=2*o*this.ArrayType.BYTES_PER_ELEMENT,T=o*this.IndexArrayType.BYTES_PER_ELEMENT,I=(8-T%8)%8;if(v<0)throw new Error(`Unexpected typed array class: ${d}.`);m&&m instanceof ArrayBuffer?(this.data=m,this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+T+I,2*o),this._pos=2*o,this._finished=!0):(this.data=new ArrayBuffer(8+x+T+I),this.ids=new this.IndexArrayType(this.data,8,o),this.coords=new this.ArrayType(this.data,8+T+I,2*o),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+v]),new Uint16Array(this.data,2,1)[0]=h,new Uint32Array(this.data,4,1)[0]=o)}add(o,h){const d=this._pos>>1;return this.ids[d]=d,this.coords[this._pos++]=o,this.coords[this._pos++]=h,d}finish(){const o=this._pos>>1;if(o!==this.numItems)throw new Error(`Added ${o} items when expected ${this.numItems}.`);return Ov(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(o,h,d,m){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:v,coords:x,nodeSize:T}=this,I=[0,v.length-1,0],R=[];for(;I.length;){const k=I.pop()||0,F=I.pop()||0,z=I.pop()||0;if(F-z<=T){for(let oe=z;oe<=F;oe++){const ue=x[2*oe],Me=x[2*oe+1];ue>=o&&ue<=d&&Me>=h&&Me<=m&&R.push(v[oe])}continue}const $=z+F>>1,q=x[2*$],Z=x[2*$+1];q>=o&&q<=d&&Z>=h&&Z<=m&&R.push(v[$]),(k===0?o<=q:h<=Z)&&(I.push(z),I.push($-1),I.push(1-k)),(k===0?d>=q:m>=Z)&&(I.push($+1),I.push(F),I.push(1-k))}return R}within(o,h,d){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:v,nodeSize:x}=this,T=[0,m.length-1,0],I=[],R=d*d;for(;T.length;){const k=T.pop()||0,F=T.pop()||0,z=T.pop()||0;if(F-z<=x){for(let oe=z;oe<=F;oe++)CA(v[2*oe],v[2*oe+1],o,h)<=R&&I.push(m[oe]);continue}const $=z+F>>1,q=v[2*$],Z=v[2*$+1];CA(q,Z,o,h)<=R&&I.push(m[$]),(k===0?o-d<=q:h-d<=Z)&&(T.push(z),T.push($-1),T.push(1-k)),(k===0?o+d>=q:h+d>=Z)&&(T.push($+1),T.push(F),T.push(1-k))}return I}}function Ov(l,o,h,d,m,v){if(m-d<=h)return;const x=d+m>>1;IA(l,o,x,d,m,v),Ov(l,o,h,d,x-1,1-v),Ov(l,o,h,x+1,m,1-v)}function IA(l,o,h,d,m,v){for(;m>d;){if(m-d>600){const R=m-d+1,k=h-d+1,F=Math.log(R),z=.5*Math.exp(2*F/3),$=.5*Math.sqrt(F*z*(R-z)/R)*(k-R/2<0?-1:1);IA(l,o,h,Math.max(d,Math.floor(h-k*z/R+$)),Math.min(m,Math.floor(h+(R-k)*z/R+$)),v)}const x=o[2*h+v];let T=d,I=m;for(bp(l,o,d,h),o[2*m+v]>x&&bp(l,o,d,m);Tx;)I--}o[2*d+v]===x?bp(l,o,d,I):(I++,bp(l,o,I,m)),I<=h&&(d=I+1),h<=I&&(m=I-1)}}function bp(l,o,h,d){Dv(l,h,d),Dv(o,2*h,2*d),Dv(o,2*h+1,2*d+1)}function Dv(l,o,h){const d=l[o];l[o]=l[h],l[h]=d}function CA(l,o,h,d){const m=l-h,v=o-d;return m*m+v*v}var Fv;u.bg=void 0,(Fv=u.bg||(u.bg={})).create="create",Fv.load="load",Fv.fullLoad="fullLoad";let a_=null,vp=[];const Nv=1e3/60,Bv="loadTime",Lv="fullLoadTime",DN={mark(l){performance.mark(l)},frame(l){const o=l;a_!=null&&vp.push(o-a_),a_=o},clearMetrics(){a_=null,vp=[],performance.clearMeasures(Bv),performance.clearMeasures(Lv);for(const l in u.bg)performance.clearMarks(u.bg[l])},getPerformanceMetrics(){performance.measure(Bv,u.bg.create,u.bg.load),performance.measure(Lv,u.bg.create,u.bg.fullLoad);const l=performance.getEntriesByName(Bv)[0].duration,o=performance.getEntriesByName(Lv)[0].duration,h=vp.length,d=1/(vp.reduce((v,x)=>v+x,0)/h/1e3),m=vp.filter(v=>v>Nv).reduce((v,x)=>v+(x-Nv)/Nv,0);return{loadTime:l,fullLoadTime:o,fps:d,percentDroppedFrames:m/(h+m)*100,totalFrames:h}}};u.$=class extends N{},u.A=Nh,u.B=qb,u.C=function(l){if(jt==null){const o=l.navigator?l.navigator.userAgent:null;jt=!!l.safari||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome")))}return jt},u.D=Tt,u.E=Ue,u.F=class{constructor(l,o){this.target=l,this.mapId=o,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new EN(()=>this.process()),this.subscription=function(h,d,m,v){return h.addEventListener(d,m,!1),{unsubscribe:()=>{h.removeEventListener(d,m,!1)}}}(this.target,"message",h=>this.receive(h)),this.globalScope=Dt(self)?l:window}registerMessageHandler(l,o){this.messageHandlers[l]=o}sendAsync(l,o){return new Promise((h,d)=>{const m=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[m]={resolve:h,reject:d},o&&o.signal.addEventListener("abort",()=>{delete this.resolveRejects[m];const T={id:m,type:"",origin:location.origin,targetMapId:l.targetMapId,sourceMapId:this.mapId};this.target.postMessage(T)},{once:!0});const v=[],x=Object.assign(Object.assign({},l),{id:m,sourceMapId:this.mapId,origin:location.origin,data:El(l.data,v)});this.target.postMessage(x,{transfer:v})})}receive(l){const o=l.data,h=o.id;if(!(o.origin!=="file://"&&location.origin!=="file://"&&o.origin!=="resource://android"&&location.origin!=="resource://android"&&o.origin!==location.origin||o.targetMapId&&this.mapId!==o.targetMapId)){if(o.type===""){delete this.tasks[h];const d=this.abortControllers[h];return delete this.abortControllers[h],void(d&&d.abort())}if(Dt(self)||o.mustQueue)return this.tasks[h]=o,this.taskQueue.push(h),void this.invoker.trigger();this.processTask(h,o)}}process(){if(this.taskQueue.length===0)return;const l=this.taskQueue.shift(),o=this.tasks[l];delete this.tasks[l],this.taskQueue.length>0&&this.invoker.trigger(),o&&this.processTask(l,o)}processTask(l,o){return c(this,void 0,void 0,function*(){if(o.type===""){const m=this.resolveRejects[l];return delete this.resolveRejects[l],m?void(o.error?m.reject(Al(o.error)):m.resolve(Al(o.data))):void 0}if(!this.messageHandlers[o.type])return void this.completeTask(l,new Error(`Could not find a registered handler for ${o.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const h=Al(o.data),d=new AbortController;this.abortControllers[l]=d;try{const m=yield this.messageHandlers[o.type](o.sourceMapId,h,d);this.completeTask(l,null,m)}catch(m){this.completeTask(l,m)}})}completeTask(l,o,h){const d=[];delete this.abortControllers[l];const m={id:l,type:"",sourceMapId:this.mapId,origin:location.origin,error:o?El(o):null,data:El(h,d)};this.target.postMessage(m,{transfer:d})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},u.G=Cn,u.H=function(){var l=new Nh(16);return Nh!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},u.I=bv,u.J=function(l,o,h){var d,m,v,x,T,I,R,k,F,z,$,q,Z=h[0],oe=h[1],ue=h[2];return o===l?(l[12]=o[0]*Z+o[4]*oe+o[8]*ue+o[12],l[13]=o[1]*Z+o[5]*oe+o[9]*ue+o[13],l[14]=o[2]*Z+o[6]*oe+o[10]*ue+o[14],l[15]=o[3]*Z+o[7]*oe+o[11]*ue+o[15]):(m=o[1],v=o[2],x=o[3],T=o[4],I=o[5],R=o[6],k=o[7],F=o[8],z=o[9],$=o[10],q=o[11],l[0]=d=o[0],l[1]=m,l[2]=v,l[3]=x,l[4]=T,l[5]=I,l[6]=R,l[7]=k,l[8]=F,l[9]=z,l[10]=$,l[11]=q,l[12]=d*Z+T*oe+F*ue+o[12],l[13]=m*Z+I*oe+z*ue+o[13],l[14]=v*Z+R*oe+$*ue+o[14],l[15]=x*Z+k*oe+q*ue+o[15]),l},u.K=function(l,o,h){var d=h[0],m=h[1],v=h[2];return l[0]=o[0]*d,l[1]=o[1]*d,l[2]=o[2]*d,l[3]=o[3]*d,l[4]=o[4]*m,l[5]=o[5]*m,l[6]=o[6]*m,l[7]=o[7]*m,l[8]=o[8]*v,l[9]=o[9]*v,l[10]=o[10]*v,l[11]=o[11]*v,l[12]=o[12],l[13]=o[13],l[14]=o[14],l[15]=o[15],l},u.L=lE,u.M=function(l,o){const h={};for(let d=0;d{const o=window.document.createElement("video");return o.muted=!0,new Promise(h=>{o.onloadstart=()=>{h(o)};for(const d of l){const m=window.document.createElement("source");Mi(d)||(o.crossOrigin="Anonymous"),m.src=d,o.appendChild(m)}})},u.a4=function(){return Ne++},u.a5=dt,u.a6=jh,u.a7=Bd,u.a8=eu,u.a9=uA,u.aA=function(l){if(l.type==="custom")return new SN(l);switch(l.type){case"background":return new xN(l);case"circle":return new lF(l);case"fill":return new EF(l);case"fill-extrusion":return new UF(l);case"heatmap":return new uF(l);case"hillshade":return new fF(l);case"line":return new ZF(l);case"raster":return new TN(l);case"symbol":return new i_(l)}},u.aB=Xe,u.aC=function(l,o){if(!l)return[{command:"setStyle",args:[o]}];let h=[];try{if(!Ze(l.version,o.version))return[{command:"setStyle",args:[o]}];Ze(l.center,o.center)||h.push({command:"setCenter",args:[o.center]}),Ze(l.zoom,o.zoom)||h.push({command:"setZoom",args:[o.zoom]}),Ze(l.bearing,o.bearing)||h.push({command:"setBearing",args:[o.bearing]}),Ze(l.pitch,o.pitch)||h.push({command:"setPitch",args:[o.pitch]}),Ze(l.sprite,o.sprite)||h.push({command:"setSprite",args:[o.sprite]}),Ze(l.glyphs,o.glyphs)||h.push({command:"setGlyphs",args:[o.glyphs]}),Ze(l.transition,o.transition)||h.push({command:"setTransition",args:[o.transition]}),Ze(l.light,o.light)||h.push({command:"setLight",args:[o.light]}),Ze(l.terrain,o.terrain)||h.push({command:"setTerrain",args:[o.terrain]}),Ze(l.sky,o.sky)||h.push({command:"setSky",args:[o.sky]}),Ze(l.projection,o.projection)||h.push({command:"setProjection",args:[o.projection]});const d={},m=[];(function(x,T,I,R){let k;for(k in T=T||{},x=x||{})Object.prototype.hasOwnProperty.call(x,k)&&(Object.prototype.hasOwnProperty.call(T,k)||Qe(k,I,R));for(k in T)Object.prototype.hasOwnProperty.call(T,k)&&(Object.prototype.hasOwnProperty.call(x,k)?Ze(x[k],T[k])||(x[k].type==="geojson"&&T[k].type==="geojson"&>(x,T,k)?Ye(I,{command:"setGeoJSONSourceData",args:[k,T[k].data]}):Mt(k,T,I,R)):it(k,T,I))})(l.sources,o.sources,m,d);const v=[];l.layers&&l.layers.forEach(x=>{"source"in x&&d[x.source]?h.push({command:"removeLayer",args:[x.id]}):v.push(x)}),h=h.concat(m),function(x,T,I){T=T||[];const R=(x=x||[]).map(Lt),k=T.map(Lt),F=x.reduce(Kt,{}),z=T.reduce(Kt,{}),$=R.slice(),q=Object.create(null);let Z,oe,ue,Me,be;for(let Ae=0,Le=0;Ae@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(h,d,m,v)=>{const x=m||v;return o[d]=!x||x.toLowerCase(),""}),o["max-age"]){const h=parseInt(o["max-age"],10);isNaN(h)?delete o["max-age"]:o["max-age"]=h}return o},u.ab=function(l,o){const h=[];for(const d in l)d in o||h.push(d);return h},u.ac=Se,u.ad=function(l,o,h){var d=Math.sin(h),m=Math.cos(h),v=o[0],x=o[1],T=o[2],I=o[3],R=o[4],k=o[5],F=o[6],z=o[7];return o!==l&&(l[8]=o[8],l[9]=o[9],l[10]=o[10],l[11]=o[11],l[12]=o[12],l[13]=o[13],l[14]=o[14],l[15]=o[15]),l[0]=v*m+R*d,l[1]=x*m+k*d,l[2]=T*m+F*d,l[3]=I*m+z*d,l[4]=R*m-v*d,l[5]=k*m-x*d,l[6]=F*m-T*d,l[7]=z*m-I*d,l},u.ae=function(l){var o=new Nh(16);return o[0]=l[0],o[1]=l[1],o[2]=l[2],o[3]=l[3],o[4]=l[4],o[5]=l[5],o[6]=l[6],o[7]=l[7],o[8]=l[8],o[9]=l[9],o[10]=l[10],o[11]=l[11],o[12]=l[12],o[13]=l[13],o[14]=l[14],o[15]=l[15],o},u.af=Xm,u.ag=function(l,o){let h=0,d=0;if(l.kind==="constant")d=l.layoutSize;else if(l.kind!=="source"){const{interpolationType:m,minZoom:v,maxZoom:x}=l,T=m?Se(Mn.interpolationFactor(m,o,v,x),0,1):0;l.kind==="camera"?d=Pn.number(l.minSize,l.maxSize,T):h=T}return{uSizeT:h,uSize:d}},u.ai=function(l,{uSize:o,uSizeT:h},{lowerSize:d,upperSize:m}){return l.kind==="source"?d/Xo:l.kind==="composite"?Pn.number(d/Xo,m/Xo,h):o},u.aj=Tv,u.ak=function(l,o,h,d){const m=o.y-l.y,v=o.x-l.x,x=d.y-h.y,T=d.x-h.x,I=x*v-T*m;if(I===0)return null;const R=(T*(l.y-h.y)-x*(l.x-h.x))/I;return new A(l.x+R*v,l.y+R*m)},u.al=pA,u.am=iE,u.an=nv,u.ao=function(l){let o=1/0,h=1/0,d=-1/0,m=-1/0;for(const v of l)o=Math.min(o,v.x),h=Math.min(h,v.y),d=Math.max(d,v.x),m=Math.max(m,v.y);return[o,h,d,m]},u.ap=Cs,u.ar=wv,u.as=function(l,o){var h=o[0],d=o[1],m=o[2],v=o[3],x=o[4],T=o[5],I=o[6],R=o[7],k=o[8],F=o[9],z=o[10],$=o[11],q=o[12],Z=o[13],oe=o[14],ue=o[15],Me=h*T-d*x,be=h*I-m*x,Ae=h*R-v*x,Le=d*I-m*T,Ke=d*R-v*T,pt=m*R-v*I,Ot=k*Z-F*q,ft=k*oe-z*q,ct=k*ue-$*q,At=F*oe-z*Z,xt=F*ue-$*Z,yt=z*ue-$*oe,Ve=Me*yt-be*xt+Ae*At+Le*ct-Ke*ft+pt*Ot;return Ve?(l[0]=(T*yt-I*xt+R*At)*(Ve=1/Ve),l[1]=(m*xt-d*yt-v*At)*Ve,l[2]=(Z*pt-oe*Ke+ue*Le)*Ve,l[3]=(z*Ke-F*pt-$*Le)*Ve,l[4]=(I*ct-x*yt-R*ft)*Ve,l[5]=(h*yt-m*ct+v*ft)*Ve,l[6]=(oe*Ae-q*pt-ue*be)*Ve,l[7]=(k*pt-z*Ae+$*be)*Ve,l[8]=(x*xt-T*ct+R*Ot)*Ve,l[9]=(d*ct-h*xt-v*Ot)*Ve,l[10]=(q*Ke-Z*Ae+ue*Me)*Ve,l[11]=(F*Ae-k*Ke-$*Me)*Ve,l[12]=(T*ft-x*At-I*Ot)*Ve,l[13]=(h*At-d*ft+m*Ot)*Ve,l[14]=(Z*be-q*Le-oe*Me)*Ve,l[15]=(k*Le-F*be+z*Me)*Ve,l):null},u.at=Rv,u.au=xv,u.av=kv,u.aw=function(){const l={},o=ce.$version;for(const h in ce.$root){const d=ce.$root[h];if(d.required){let m=null;m=h==="version"?o:d.type==="array"?[]:{},m!=null&&(l[h]=m)}}return l},u.ax=Jd,u.ay=ns,u.az=function(l){l=l.slice();const o=Object.create(null);for(let h=0;h25||d<0||d>=1||h<0||h>=1)},u.bc=function(l,o){return l[0]=o[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=o[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=o[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},u.bd=class extends O{},u.be=Iv,u.bf=DN,u.bh=hi,u.bi=function(l,o){An.REGISTERED_PROTOCOLS[l]=o},u.bj=function(l){delete An.REGISTERED_PROTOCOLS[l]},u.bk=function(l,o){const h={};for(let m=0;myt*Cs)}let ft=x?"center":h.get("text-justify").evaluate(R,{},l.canonical);const ct=h.get("symbol-placement")==="point"?h.get("text-max-width").evaluate(R,{},l.canonical)*Cs:1/0,At=()=>{l.bucket.allowVerticalPlacement&&Gd(Ae)&&(q.vertical=Qm(Z,l.glyphMap,l.glyphPositions,l.imagePositions,k,ct,v,pt,"left",Ke,ue,u.ah.vertical,!0,z,F))};if(!x&&Ot){const xt=new Set;if(ft==="auto")for(let Ve=0;Vec(void 0,void 0,void 0,function*(){if(l.byteLength===0)return createImageBitmap(new ImageData(1,1));const o=new Blob([new Uint8Array(l)],{type:"image/png"});try{return createImageBitmap(o)}catch(h){throw new Error(`Could not load image because of ${h.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),u.e=Fe,u.f=l=>new Promise((o,h)=>{const d=new Image;d.onload=()=>{o(d),URL.revokeObjectURL(d.src),d.onload=null,window.requestAnimationFrame(()=>{d.src=Xt})},d.onerror=()=>h(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."));const m=new Blob([new Uint8Array(l)],{type:"image/png"});d.src=l.byteLength?URL.createObjectURL(m):Xt}),u.g=In,u.h=(l,o)=>bi(Fe(l,{type:"json"}),o),u.i=Dt,u.j=ve,u.k=ge,u.l=(l,o)=>bi(Fe(l,{type:"arrayBuffer"}),o),u.m=bi,u.n=function(l){return new _v(l).readFields(cN,[])},u.o=ap,u.p=VE,u.q=b,u.r=Wb,u.s=Mi,u.t=Yd,u.u=La,u.v=ce,u.w=ht,u.x=function([l,o,h]){return o+=90,o*=Math.PI/180,h*=Math.PI/180,{x:l*Math.cos(o)*Math.sin(h),y:l*Math.sin(o)*Math.sin(h),z:l*Math.cos(h)}},u.y=Pn,u.z=zi}),n("worker",["./shared"],function(u){class c{constructor(j){this.keyCache={},j&&this.replace(j)}replace(j){this._layerConfigs={},this._layers={},this.update(j,[])}update(j,V){for(const ne of j){this._layerConfigs[ne.id]=ne;const ye=this._layers[ne.id]=u.aA(ne);ye._featureFilter=u.a7(ye.filter),this.keyCache[ne.id]&&delete this.keyCache[ne.id]}for(const ne of V)delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne];this.familiesBySource={};const Y=u.bk(Object.values(this._layerConfigs),this.keyCache);for(const ne of Y){const ye=ne.map(De=>this._layers[De.id]),we=ye[0];if(we.visibility==="none")continue;const Pe=we.source||"";let pe=this.familiesBySource[Pe];pe||(pe=this.familiesBySource[Pe]={});const ze=we.sourceLayer||"_geojsonTileLayer";let He=pe[ze];He||(He=pe[ze]=[]),He.push(ye)}}}class _{constructor(j){const V={},Y=[];for(const Pe in j){const pe=j[Pe],ze=V[Pe]={};for(const He in pe){const De=pe[+He];if(!De||De.bitmap.width===0||De.bitmap.height===0)continue;const nt={x:0,y:0,w:De.bitmap.width+2,h:De.bitmap.height+2};Y.push(nt),ze[He]={rect:nt,metrics:De.metrics}}}const{w:ne,h:ye}=u.p(Y),we=new u.o({width:ne||1,height:ye||1});for(const Pe in j){const pe=j[Pe];for(const ze in pe){const He=pe[+ze];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;const De=V[Pe][ze].rect;u.o.copy(He.bitmap,we,{x:0,y:0},{x:De.x+1,y:De.y+1},He.bitmap)}}this.image=we,this.positions=V}}u.bl("GlyphAtlas",_);class w{constructor(j){this.tileID=new u.S(j.tileID.overscaledZ,j.tileID.wrap,j.tileID.canonical.z,j.tileID.canonical.x,j.tileID.canonical.y),this.uid=j.uid,this.zoom=j.zoom,this.pixelRatio=j.pixelRatio,this.tileSize=j.tileSize,this.source=j.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=j.showCollisionBoxes,this.collectResourceTiming=!!j.collectResourceTiming,this.returnDependencies=!!j.returnDependencies,this.promoteId=j.promoteId,this.inFlightDependencies=[]}parse(j,V,Y,ne){return u._(this,void 0,void 0,function*(){this.status="parsing",this.data=j,this.collisionBoxArray=new u.a5;const ye=new u.bm(Object.keys(j.layers).sort()),we=new u.bn(this.tileID,this.promoteId);we.bucketLayerIDs=[];const Pe={},pe={featureIndex:we,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Y},ze=V.familiesBySource[this.source];for(const qt in ze){const li=j.layers[qt];if(!li)continue;li.version===1&&u.w(`Vector tile source "${this.source}" layer "${qt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const vi=ye.encode(qt),os=[];for(let ys=0;ys=Hs.maxzoom||Hs.visibility!=="none"&&(S(ys,this.zoom,Y),(Pe[Hs.id]=Hs.createBucket({index:we.bucketLayerIDs.length,layers:ys,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:vi,sourceID:this.source})).populate(os,pe,this.tileID.canonical),we.bucketLayerIDs.push(ys.map(jo=>jo.id)))}}const He=u.aF(pe.glyphDependencies,qt=>Object.keys(qt).map(Number));this.inFlightDependencies.forEach(qt=>qt==null?void 0:qt.abort()),this.inFlightDependencies=[];let De=Promise.resolve({});if(Object.keys(He).length){const qt=new AbortController;this.inFlightDependencies.push(qt),De=ne.sendAsync({type:"GG",data:{stacks:He,source:this.source,tileID:this.tileID,type:"glyphs"}},qt)}const nt=Object.keys(pe.iconDependencies);let It=Promise.resolve({});if(nt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),It=ne.sendAsync({type:"GI",data:{icons:nt,source:this.source,tileID:this.tileID,type:"icons"}},qt)}const Pt=Object.keys(pe.patternDependencies);let ai=Promise.resolve({});if(Pt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),ai=ne.sendAsync({type:"GI",data:{icons:Pt,source:this.source,tileID:this.tileID,type:"patterns"}},qt)}const[Wt,ni,Qt]=yield Promise.all([De,It,ai]),rs=new _(Wt),Fi=new u.bo(ni,Qt);for(const qt in Pe){const li=Pe[qt];li instanceof u.a6?(S(li.layers,this.zoom,Y),u.bp({bucket:li,glyphMap:Wt,glyphPositions:rs.positions,imageMap:ni,imagePositions:Fi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):li.hasPattern&&(li instanceof u.bq||li instanceof u.br||li instanceof u.bs)&&(S(li.layers,this.zoom,Y),li.addFeatures(pe,this.tileID.canonical,Fi.patternPositions))}return this.status="done",{buckets:Object.values(Pe).filter(qt=>!qt.isEmpty()),featureIndex:we,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:rs.image,imageAtlas:Fi,glyphMap:this.returnDependencies?Wt:null,iconMap:this.returnDependencies?ni:null,glyphPositions:this.returnDependencies?rs.positions:null}})}}function S(le,j,V){const Y=new u.z(j);for(const ne of le)ne.recalculate(Y,V)}class A{constructor(j,V,Y){this.actor=j,this.layerIndex=V,this.availableImages=Y,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(j,V){return u._(this,void 0,void 0,function*(){const Y=yield u.l(j.request,V);try{return{vectorTile:new u.bt.VectorTile(new u.bu(Y.data)),rawData:Y.data,cacheControl:Y.cacheControl,expires:Y.expires}}catch(ne){const ye=new Uint8Array(Y.data);let we=`Unable to parse the tile at ${j.request.url}, `;throw we+=ye[0]===31&&ye[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ne.message}`,new Error(we)}})}loadTile(j){return u._(this,void 0,void 0,function*(){const V=j.uid,Y=!!(j&&j.request&&j.request.collectResourceTiming)&&new u.bv(j.request),ne=new w(j);this.loading[V]=ne;const ye=new AbortController;ne.abort=ye;try{const we=yield this.loadVectorTile(j,ye);if(delete this.loading[V],!we)return null;const Pe=we.rawData,pe={};we.expires&&(pe.expires=we.expires),we.cacheControl&&(pe.cacheControl=we.cacheControl);const ze={};if(Y){const De=Y.finish();De&&(ze.resourceTiming=JSON.parse(JSON.stringify(De)))}ne.vectorTile=we.vectorTile;const He=ne.parse(we.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[V]=ne,this.fetching[V]={rawTileData:Pe,cacheControl:pe,resourceTiming:ze};try{const De=yield He;return u.e({rawTileData:Pe.slice(0)},De,pe,ze)}finally{delete this.fetching[V]}}catch(we){throw delete this.loading[V],ne.status="done",this.loaded[V]=ne,we}})}reloadTile(j){return u._(this,void 0,void 0,function*(){const V=j.uid;if(!this.loaded||!this.loaded[V])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Y=this.loaded[V];if(Y.showCollisionBoxes=j.showCollisionBoxes,Y.status==="parsing"){const ne=yield Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor);let ye;if(this.fetching[V]){const{rawTileData:we,cacheControl:Pe,resourceTiming:pe}=this.fetching[V];delete this.fetching[V],ye=u.e({rawTileData:we.slice(0)},ne,Pe,pe)}else ye=ne;return ye}if(Y.status==="done"&&Y.vectorTile)return Y.parse(Y.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(j){return u._(this,void 0,void 0,function*(){const V=this.loading,Y=j.uid;V&&V[Y]&&V[Y].abort&&(V[Y].abort.abort(),delete V[Y])})}removeTile(j){return u._(this,void 0,void 0,function*(){this.loaded&&this.loaded[j.uid]&&delete this.loaded[j.uid]})}}class P{constructor(){this.loaded={}}loadTile(j){return u._(this,void 0,void 0,function*(){const{uid:V,encoding:Y,rawImageData:ne,redFactor:ye,greenFactor:we,blueFactor:Pe,baseShift:pe}=j,ze=ne.width+2,He=ne.height+2,De=u.b(ne)?new u.R({width:ze,height:He},yield u.bw(ne,-1,-1,ze,He)):ne,nt=new u.bx(V,De,Y,ye,we,Pe,pe);return this.loaded=this.loaded||{},this.loaded[V]=nt,nt})}removeTile(j){const V=this.loaded,Y=j.uid;V&&V[Y]&&delete V[Y]}}function D(le,j){if(le.length!==0){U(le[0],j);for(var V=1;V=Math.abs(Pe)?V-pe+Pe:Pe-pe+V,V=pe}V+Y>=0!=!!j&&le.reverse()}var L=u.by(function le(j,V){var Y,ne=j&&j.type;if(ne==="FeatureCollection")for(Y=0;Y>31}function Dt(le,j){for(var V=le.loadGeometry(),Y=le.type,ne=0,ye=0,we=V.length,Pe=0;Pele},xi=Math.fround||(Zt=new Float32Array(1),le=>(Zt[0]=+le,Zt[0]));var Zt;const pi=3,gi=5,$s=6;class An{constructor(j){this.options=Object.assign(Object.create(Xt),j),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(j){const{log:V,minZoom:Y,maxZoom:ne}=this.options;V&&console.time("total time");const ye=`prepare ${j.length} points`;V&&console.time(ye),this.points=j;const we=[];for(let pe=0;pe=Y;pe--){const ze=+Date.now();Pe=this.trees[pe]=this._createTree(this._cluster(Pe,pe)),V&&console.log("z%d: %d clusters in %dms",pe,Pe.numItems,+Date.now()-ze)}return V&&console.timeEnd("total time"),this}getClusters(j,V){let Y=((j[0]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,j[1]));let ye=j[2]===180?180:((j[2]+180)%360+360)%360-180;const we=Math.max(-90,Math.min(90,j[3]));if(j[2]-j[0]>=360)Y=-180,ye=180;else if(Y>ye){const De=this.getClusters([Y,ne,180,we],V),nt=this.getClusters([-180,ne,ye,we],V);return De.concat(nt)}const Pe=this.trees[this._limitZoom(V)],pe=Pe.range(hi(Y),ns(we),hi(ye),ns(ne)),ze=Pe.data,He=[];for(const De of pe){const nt=this.stride*De;He.push(ze[nt+gi]>1?In(ze,nt,this.clusterProps):this.points[ze[nt+pi]])}return He}getChildren(j){const V=this._getOriginId(j),Y=this._getOriginZoom(j),ne="No cluster with the specified id.",ye=this.trees[Y];if(!ye)throw new Error(ne);const we=ye.data;if(V*this.stride>=we.length)throw new Error(ne);const Pe=this.options.radius/(this.options.extent*Math.pow(2,Y-1)),pe=ye.within(we[V*this.stride],we[V*this.stride+1],Pe),ze=[];for(const He of pe){const De=He*this.stride;we[De+4]===j&&ze.push(we[De+gi]>1?In(we,De,this.clusterProps):this.points[we[De+pi]])}if(ze.length===0)throw new Error(ne);return ze}getLeaves(j,V,Y){const ne=[];return this._appendLeaves(ne,j,V=V||10,Y=Y||0,0),ne}getTile(j,V,Y){const ne=this.trees[this._limitZoom(j)],ye=Math.pow(2,j),{extent:we,radius:Pe}=this.options,pe=Pe/we,ze=(Y-pe)/ye,He=(Y+1+pe)/ye,De={features:[]};return this._addTileFeatures(ne.range((V-pe)/ye,ze,(V+1+pe)/ye,He),ne.data,V,Y,ye,De),V===0&&this._addTileFeatures(ne.range(1-pe/ye,ze,1,He),ne.data,ye,Y,ye,De),V===ye-1&&this._addTileFeatures(ne.range(0,ze,pe/ye,He),ne.data,-1,Y,ye,De),De.features.length?De:null}getClusterExpansionZoom(j){let V=this._getOriginZoom(j)-1;for(;V<=this.options.maxZoom;){const Y=this.getChildren(j);if(V++,Y.length!==1)break;j=Y[0].properties.cluster_id}return V}_appendLeaves(j,V,Y,ne,ye){const we=this.getChildren(V);for(const Pe of we){const pe=Pe.properties;if(pe&&pe.cluster?ye+pe.point_count<=ne?ye+=pe.point_count:ye=this._appendLeaves(j,pe.cluster_id,Y,ne,ye):ye1;let He,De,nt;if(ze)He=Cn(V,pe,this.clusterProps),De=V[pe],nt=V[pe+1];else{const ai=this.points[V[pe+pi]];He=ai.properties;const[Wt,ni]=ai.geometry.coordinates;De=hi(Wt),nt=ns(ni)}const It={type:1,geometry:[[Math.round(this.options.extent*(De*ye-Y)),Math.round(this.options.extent*(nt*ye-ne))]],tags:He};let Pt;Pt=ze||this.options.generateId?V[pe+pi]:this.points[V[pe+pi]].id,Pt!==void 0&&(It.id=Pt),we.features.push(It)}}_limitZoom(j){return Math.max(this.options.minZoom,Math.min(Math.floor(+j),this.options.maxZoom+1))}_cluster(j,V){const{radius:Y,extent:ne,reduce:ye,minPoints:we}=this.options,Pe=Y/(ne*Math.pow(2,V)),pe=j.data,ze=[],He=this.stride;for(let De=0;DeV&&(Wt+=pe[Qt+gi])}if(Wt>ai&&Wt>=we){let ni,Qt=nt*ai,rs=It*ai,Fi=-1;const qt=((De/He|0)<<5)+(V+1)+this.points.length;for(const li of Pt){const vi=li*He;if(pe[vi+2]<=V)continue;pe[vi+2]=V;const os=pe[vi+gi];Qt+=pe[vi]*os,rs+=pe[vi+1]*os,pe[vi+4]=qt,ye&&(ni||(ni=this._map(pe,De,!0),Fi=this.clusterProps.length,this.clusterProps.push(ni)),ye(ni,this._map(pe,vi)))}pe[De+4]=qt,ze.push(Qt/Wt,rs/Wt,1/0,qt,-1,Wt),ye&&ze.push(Fi)}else{for(let ni=0;ni1)for(const ni of Pt){const Qt=ni*He;if(!(pe[Qt+2]<=V)){pe[Qt+2]=V;for(let rs=0;rs>5}_getOriginZoom(j){return(j-this.points.length)%32}_map(j,V,Y){if(j[V+gi]>1){const we=this.clusterProps[j[V+$s]];return Y?Object.assign({},we):we}const ne=this.points[j[V+pi]].properties,ye=this.options.map(ne);return Y&&ye===ne?Object.assign({},ye):ye}}function In(le,j,V){return{type:"Feature",id:le[j+pi],properties:Cn(le,j,V),geometry:{type:"Point",coordinates:[(Y=le[j],360*(Y-.5)),bi(le[j+1])]}};var Y}function Cn(le,j,V){const Y=le[j+gi],ne=Y>=1e4?`${Math.round(Y/1e3)}k`:Y>=1e3?Math.round(Y/100)/10+"k":Y,ye=le[j+$s],we=ye===-1?{}:Object.assign({},V[ye]);return Object.assign(we,{cluster:!0,cluster_id:le[j+pi],point_count:Y,point_count_abbreviated:ne})}function hi(le){return le/360+.5}function ns(le){const j=Math.sin(le*Math.PI/180),V=.5-.25*Math.log((1+j)/(1-j))/Math.PI;return V<0?0:V>1?1:V}function bi(le){const j=(180-360*le)*Math.PI/180;return 360*Math.atan(Math.exp(j))/Math.PI-90}function Mi(le,j,V,Y){let ne=Y;const ye=j+(V-j>>1);let we,Pe=V-j;const pe=le[j],ze=le[j+1],He=le[V],De=le[V+1];for(let nt=j+3;ntne)we=nt,ne=It;else if(It===ne){const Pt=Math.abs(nt-ye);PtY&&(we-j>3&&Mi(le,j,we,Y),le[we+2]=ne,V-we>3&&Mi(le,we,V,Y))}function Xn(le,j,V,Y,ne,ye){let we=ne-V,Pe=ye-Y;if(we!==0||Pe!==0){const pe=((le-V)*we+(j-Y)*Pe)/(we*we+Pe*Pe);pe>1?(V=ne,Y=ye):pe>0&&(V+=we*pe,Y+=Pe*pe)}return we=le-V,Pe=j-Y,we*we+Pe*Pe}function Fs(le,j,V,Y){const ne={id:le??null,type:j,geometry:V,tags:Y,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(j==="Point"||j==="MultiPoint"||j==="LineString")ge(ne,V);else if(j==="Polygon")ge(ne,V[0]);else if(j==="MultiLineString")for(const ye of V)ge(ne,ye);else if(j==="MultiPolygon")for(const ye of V)ge(ne,ye[0]);return ne}function ge(le,j){for(let V=0;V0&&(we+=Y?(ne*He-ze*ye)/2:Math.sqrt(Math.pow(ze-ne,2)+Math.pow(He-ye,2))),ne=ze,ye=He}const Pe=j.length-3;j[2]=1,Mi(j,0,Pe,V),j[Pe+2]=1,j.size=Math.abs(we),j.start=0,j.end=j.size}function We(le,j,V,Y){for(let ne=0;ne1?1:V}function Ye(le,j,V,Y,ne,ye,we,Pe){if(Y/=j,ye>=(V/=j)&&we=Y)return null;const pe=[];for(const ze of le){const He=ze.geometry;let De=ze.type;const nt=ne===0?ze.minX:ze.minY,It=ne===0?ze.maxX:ze.maxY;if(nt>=V&&It=Y)continue;let Pt=[];if(De==="Point"||De==="MultiPoint")it(He,Pt,V,Y,ne);else if(De==="LineString")Qe(He,Pt,V,Y,ne,!1,Pe.lineMetrics);else if(De==="MultiLineString")gt(He,Pt,V,Y,ne,!1);else if(De==="Polygon")gt(He,Pt,V,Y,ne,!0);else if(De==="MultiPolygon")for(const ai of He){const Wt=[];gt(ai,Wt,V,Y,ne,!0),Wt.length&&Pt.push(Wt)}if(Pt.length){if(Pe.lineMetrics&&De==="LineString"){for(const ai of Pt)pe.push(Fs(ze.id,De,ai,ze.tags));continue}De!=="LineString"&&De!=="MultiLineString"||(Pt.length===1?(De="LineString",Pt=Pt[0]):De="MultiLineString"),De!=="Point"&&De!=="MultiPoint"||(De=Pt.length===3?"Point":"MultiPoint"),pe.push(Fs(ze.id,De,Pt,ze.tags))}}return pe.length?pe:null}function it(le,j,V,Y,ne){for(let ye=0;ye=V&&we<=Y&&wt(j,le[ye],le[ye+1],le[ye+2])}}function Qe(le,j,V,Y,ne,ye,we){let Pe=Mt(le);const pe=ne===0?Lt:Kt;let ze,He,De=le.start;for(let Wt=0;WtV&&(He=pe(Pe,ni,Qt,Fi,qt,V),we&&(Pe.start=De+ze*He)):li>Y?vi=V&&(He=pe(Pe,ni,Qt,Fi,qt,V),os=!0),vi>Y&&li<=Y&&(He=pe(Pe,ni,Qt,Fi,qt,Y),os=!0),!ye&&os&&(we&&(Pe.end=De+ze*He),j.push(Pe),Pe=Mt(le)),we&&(De+=ze)}let nt=le.length-3;const It=le[nt],Pt=le[nt+1],ai=ne===0?It:Pt;ai>=V&&ai<=Y&&wt(Pe,It,Pt,le[nt+2]),nt=Pe.length-3,ye&&nt>=3&&(Pe[nt]!==Pe[0]||Pe[nt+1]!==Pe[1])&&wt(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&j.push(Pe)}function Mt(le){const j=[];return j.size=le.size,j.start=le.start,j.end=le.end,j}function gt(le,j,V,Y,ne,ye){for(const we of le)Qe(we,j,V,Y,ne,ye,!1)}function wt(le,j,V,Y){le.push(j,V,Y)}function Lt(le,j,V,Y,ne,ye){const we=(ye-j)/(Y-j);return wt(le,ye,V+(ne-V)*we,1),we}function Kt(le,j,V,Y,ne,ye){const we=(ye-V)/(ne-V);return wt(le,j+(Y-j)*we,ye,1),we}function je(le,j){const V=[];for(let Y=0;Y0&&j.size<(ne?we:Y))return void(V.numPoints+=j.length/3);const Pe=[];for(let pe=0;pewe)&&(V.numSimplified++,Pe.push(j[pe],j[pe+1])),V.numPoints++;ne&&function(pe,ze){let He=0;for(let De=0,nt=pe.length,It=nt-2;De0===ze)for(let De=0,nt=pe.length;De24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");let ne=function(ye,we){const Pe=[];if(ye.type==="FeatureCollection")for(let pe=0;pe1&&console.time("creation"),It=this.tiles[nt]=Gi(j,V,Y,ne,ze),this.tileCoords.push({z:V,x:Y,y:ne}),He)){He>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,Y,ne,It.numFeatures,It.numPoints,It.numSimplified),console.timeEnd("creation"));const os=`z${V}`;this.stats[os]=(this.stats[os]||0)+1,this.total++}if(It.source=j,ye==null){if(V===ze.indexMaxZoom||It.numPoints<=ze.indexMaxPoints)continue}else{if(V===ze.maxZoom||V===ye)continue;if(ye!=null){const os=ye-V;if(Y!==we>>os||ne!==Pe>>os)continue}}if(It.source=null,j.length===0)continue;He>1&&console.time("clipping");const Pt=.5*ze.buffer/ze.extent,ai=.5-Pt,Wt=.5+Pt,ni=1+Pt;let Qt=null,rs=null,Fi=null,qt=null,li=Ye(j,De,Y-Pt,Y+Wt,0,It.minX,It.maxX,ze),vi=Ye(j,De,Y+ai,Y+ni,0,It.minX,It.maxX,ze);j=null,li&&(Qt=Ye(li,De,ne-Pt,ne+Wt,1,It.minY,It.maxY,ze),rs=Ye(li,De,ne+ai,ne+ni,1,It.minY,It.maxY,ze),li=null),vi&&(Fi=Ye(vi,De,ne-Pt,ne+Wt,1,It.minY,It.maxY,ze),qt=Ye(vi,De,ne+ai,ne+ni,1,It.minY,It.maxY,ze),vi=null),He>1&&console.timeEnd("clipping"),pe.push(Qt||[],V+1,2*Y,2*ne),pe.push(rs||[],V+1,2*Y,2*ne+1),pe.push(Fi||[],V+1,2*Y+1,2*ne),pe.push(qt||[],V+1,2*Y+1,2*ne+1)}}getTile(j,V,Y){j=+j,V=+V,Y=+Y;const ne=this.options,{extent:ye,debug:we}=ne;if(j<0||j>24)return null;const Pe=1<1&&console.log("drilling down to z%d-%d-%d",j,V,Y);let ze,He=j,De=V,nt=Y;for(;!ze&&He>0;)He--,De>>=1,nt>>=1,ze=this.tiles[Qi(He,De,nt)];return ze&&ze.source?(we>1&&(console.log("found parent tile z%d-%d-%d",He,De,nt),console.time("drilling down")),this.splitTile(ze.source,He,De,nt,j,V,Y),we>1&&console.timeEnd("drilling down"),this.tiles[pe]?mi(this.tiles[pe],ye):null):null}}function Qi(le,j,V){return 32*((1<{De.properties=It;const Pt={};for(const ai of nt)Pt[ai]=pe[ai].evaluate(He,De);return Pt},we.reduce=(It,Pt)=>{De.properties=Pt;for(const ai of nt)He.accumulated=It[ai],It[ai]=ze[ai].evaluate(He,De)},we}(j)).load((yield this._pendingData).features):(ne=yield this._pendingData,new wi(ne,j.geojsonVtOptions)),this.loaded={};const ye={};if(Y){const we=Y.finish();we&&(ye.resourceTiming={},ye.resourceTiming[j.source]=JSON.parse(JSON.stringify(we)))}return ye}catch(ye){if(delete this._pendingRequest,u.bB(ye))return{abandoned:!0};throw ye}var ne})}getData(){return u._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(j){const V=this.loaded;return V&&V[j.uid]?super.reloadTile(j):this.loadTile(j)}loadAndProcessGeoJSON(j,V){return u._(this,void 0,void 0,function*(){let Y=yield this.loadGeoJSON(j,V);if(delete this._pendingRequest,typeof Y!="object")throw new Error(`Input data given to '${j.source}' is not a valid GeoJSON object.`);if(L(Y,!0),j.filter){const ne=u.bC(j.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ne.result==="error")throw new Error(ne.value.map(we=>`${we.key}: ${we.message}`).join(", "));Y={type:"FeatureCollection",features:Y.features.filter(we=>ne.value.evaluate({zoom:0},we))}}return Y})}loadGeoJSON(j,V){return u._(this,void 0,void 0,function*(){const{promoteId:Y}=j;if(j.request){const ne=yield u.h(j.request,V);return this._dataUpdateable=dr(ne.data,Y)?Dr(ne.data,Y):void 0,ne.data}if(typeof j.data=="string")try{const ne=JSON.parse(j.data);return this._dataUpdateable=dr(ne,Y)?Dr(ne,Y):void 0,ne}catch{throw new Error(`Input data given to '${j.source}' is not a valid GeoJSON object.`)}if(!j.dataDiff)throw new Error(`Input data given to '${j.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${j.source}`);return function(ne,ye,we){var Pe,pe,ze,He;if(ye.removeAll&&ne.clear(),ye.remove)for(const De of ye.remove)ne.delete(De);if(ye.add)for(const De of ye.add){const nt=Nt(De,we);nt!=null&&ne.set(nt,De)}if(ye.update)for(const De of ye.update){let nt=ne.get(De.id);if(nt==null)continue;const It=!De.removeAllProperties&&(((Pe=De.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((pe=De.addOrUpdateProperties)===null||pe===void 0?void 0:pe.length)>0);if((De.newGeometry||De.removeAllProperties||It)&&(nt=Object.assign({},nt),ne.set(De.id,nt),It&&(nt.properties=Object.assign({},nt.properties))),De.newGeometry&&(nt.geometry=De.newGeometry),De.removeAllProperties)nt.properties={};else if(((ze=De.removeProperties)===null||ze===void 0?void 0:ze.length)>0)for(const Pt of De.removeProperties)Object.prototype.hasOwnProperty.call(nt.properties,Pt)&&delete nt.properties[Pt];if(((He=De.addOrUpdateProperties)===null||He===void 0?void 0:He.length)>0)for(const{key:Pt,value:ai}of De.addOrUpdateProperties)nt.properties[Pt]=ai}}(this._dataUpdateable,j.dataDiff,Y),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(j){return u._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(j){return this._geoJSONIndex.getClusterExpansionZoom(j.clusterId)}getClusterChildren(j){return this._geoJSONIndex.getChildren(j.clusterId)}getClusterLeaves(j){return this._geoJSONIndex.getLeaves(j.clusterId,j.limit,j.offset)}}class Zn{constructor(j){this.self=j,this.actor=new u.F(j),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(V,Y)=>{if(this.externalWorkerSourceTypes[V])throw new Error(`Worker source with name "${V}" already registered.`);this.externalWorkerSourceTypes[V]=Y},this.self.addProtocol=u.bi,this.self.removeProtocol=u.bj,this.self.registerRTLTextPlugin=V=>{if(u.bD.isParsed())throw new Error("RTL text plugin already registered.");u.bD.setMethods(V)},this.actor.registerMessageHandler("LDT",(V,Y)=>this._getDEMWorkerSource(V,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RDT",(V,Y)=>u._(this,void 0,void 0,function*(){this._getDEMWorkerSource(V,Y.source).removeTile(Y)})),this.actor.registerMessageHandler("GCEZ",(V,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(V,Y.type,Y.source).getClusterExpansionZoom(Y)})),this.actor.registerMessageHandler("GCC",(V,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(V,Y.type,Y.source).getClusterChildren(Y)})),this.actor.registerMessageHandler("GCL",(V,Y)=>u._(this,void 0,void 0,function*(){return this._getWorkerSource(V,Y.type,Y.source).getClusterLeaves(Y)})),this.actor.registerMessageHandler("LD",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).loadData(Y)),this.actor.registerMessageHandler("GD",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).getData()),this.actor.registerMessageHandler("LT",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).loadTile(Y)),this.actor.registerMessageHandler("RT",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).reloadTile(Y)),this.actor.registerMessageHandler("AT",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).abortTile(Y)),this.actor.registerMessageHandler("RMT",(V,Y)=>this._getWorkerSource(V,Y.type,Y.source).removeTile(Y)),this.actor.registerMessageHandler("RS",(V,Y)=>u._(this,void 0,void 0,function*(){if(!this.workerSources[V]||!this.workerSources[V][Y.type]||!this.workerSources[V][Y.type][Y.source])return;const ne=this.workerSources[V][Y.type][Y.source];delete this.workerSources[V][Y.type][Y.source],ne.removeSource!==void 0&&ne.removeSource(Y)})),this.actor.registerMessageHandler("RM",V=>u._(this,void 0,void 0,function*(){delete this.layerIndexes[V],delete this.availableImages[V],delete this.workerSources[V],delete this.demWorkerSources[V]})),this.actor.registerMessageHandler("SR",(V,Y)=>u._(this,void 0,void 0,function*(){this.referrer=Y})),this.actor.registerMessageHandler("SRPS",(V,Y)=>this._syncRTLPluginState(V,Y)),this.actor.registerMessageHandler("IS",(V,Y)=>u._(this,void 0,void 0,function*(){this.self.importScripts(Y)})),this.actor.registerMessageHandler("SI",(V,Y)=>this._setImages(V,Y)),this.actor.registerMessageHandler("UL",(V,Y)=>u._(this,void 0,void 0,function*(){this._getLayerIndex(V).update(Y.layers,Y.removedIds)})),this.actor.registerMessageHandler("SL",(V,Y)=>u._(this,void 0,void 0,function*(){this._getLayerIndex(V).replace(Y)}))}_setImages(j,V){return u._(this,void 0,void 0,function*(){this.availableImages[j]=V;for(const Y in this.workerSources[j]){const ne=this.workerSources[j][Y];for(const ye in ne)ne[ye].availableImages=V}})}_syncRTLPluginState(j,V){return u._(this,void 0,void 0,function*(){if(u.bD.isParsed())return u.bD.getState();if(V.pluginStatus!=="loading")return u.bD.setState(V),V;const Y=V.pluginURL;if(this.self.importScripts(Y),u.bD.isParsed()){const ne={pluginStatus:"loaded",pluginURL:Y};return u.bD.setState(ne),ne}throw u.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Y}`)})}_getAvailableImages(j){let V=this.availableImages[j];return V||(V=[]),V}_getLayerIndex(j){let V=this.layerIndexes[j];return V||(V=this.layerIndexes[j]=new c),V}_getWorkerSource(j,V,Y){if(this.workerSources[j]||(this.workerSources[j]={}),this.workerSources[j][V]||(this.workerSources[j][V]={}),!this.workerSources[j][V][Y]){const ne={sendAsync:(ye,we)=>(ye.targetMapId=j,this.actor.sendAsync(ye,we))};switch(V){case"vector":this.workerSources[j][V][Y]=new A(ne,this._getLayerIndex(j),this._getAvailableImages(j));break;case"geojson":this.workerSources[j][V][Y]=new Fr(ne,this._getLayerIndex(j),this._getAvailableImages(j));break;default:this.workerSources[j][V][Y]=new this.externalWorkerSourceTypes[V](ne,this._getLayerIndex(j),this._getAvailableImages(j))}}return this.workerSources[j][V][Y]}_getDEMWorkerSource(j,V){return this.demWorkerSources[j]||(this.demWorkerSources[j]={}),this.demWorkerSources[j][V]||(this.demWorkerSources[j][V]=new P),this.demWorkerSources[j][V]}}return u.i(self)&&(self.worker=new Zn(self)),Zn}),n("index",["exports","./shared"],function(u,c){var _="4.7.1";let w,S;const A={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:b=>new Promise((r,f)=>{const p=requestAnimationFrame(r);b.signal.addEventListener("abort",()=>{cancelAnimationFrame(p),f(c.c())})}),getImageData(b,r=0){return this.getImageCanvasContext(b).getImageData(-r,-r,b.width+2*r,b.height+2*r)},getImageCanvasContext(b){const r=window.document.createElement("canvas"),f=r.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return r.width=b.width,r.height=b.height,f.drawImage(b,0,0,b.width,b.height),f},resolveURL:b=>(w||(w=document.createElement("a")),w.href=b,w.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(S==null&&(S=matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}};class P{static testProp(r){if(!P.docStyle)return r[0];for(let f=0;f{window.removeEventListener("click",P.suppressClickInternal,!0)},0)}static getScale(r){const f=r.getBoundingClientRect();return{x:f.width/r.offsetWidth||1,y:f.height/r.offsetHeight||1,boundingClientRect:f}}static getPoint(r,f,p){const g=f.boundingClientRect;return new c.P((p.clientX-g.left)/f.x-r.clientLeft,(p.clientY-g.top)/f.y-r.clientTop)}static mousePos(r,f){const p=P.getScale(r);return P.getPoint(r,p,f)}static touchPos(r,f){const p=[],g=P.getScale(r);for(let y=0;y{U&&G(U),U=null,ee=!0},L.onerror=()=>{W=!0,U=null},L.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(b){let r,f,p,g;b.resetRequestQueue=()=>{r=[],f=0,p=0,g={}},b.addThrottleControl=M=>{const O=p++;return g[O]=M,O},b.removeThrottleControl=M=>{delete g[M],E()},b.getImage=(M,O,N=!0)=>new Promise((B,H)=>{D.supported&&(M.headers||(M.headers={}),M.headers.accept="image/webp,*/*"),c.e(M,{type:"image"}),r.push({abortController:O,requestParameters:M,supportImageRefresh:N,state:"queued",onError:J=>{H(J)},onSuccess:J=>{B(J)}}),E()});const y=M=>c._(this,void 0,void 0,function*(){M.state="running";const{requestParameters:O,supportImageRefresh:N,onError:B,onSuccess:H,abortController:J}=M,te=N===!1&&!c.i(self)&&!c.g(O.url)&&(!O.headers||Object.keys(O.headers).reduce((de,_e)=>de&&_e==="accept",!0));f++;const ae=te?C(O,J):c.m(O,J);try{const de=yield ae;delete M.abortController,M.state="completed",de.data instanceof HTMLImageElement||c.b(de.data)?H(de):de.data&&H({data:yield(he=de.data,typeof createImageBitmap=="function"?c.d(he):c.f(he)),cacheControl:de.cacheControl,expires:de.expires})}catch(de){delete M.abortController,B(de)}finally{f--,E()}var he}),E=()=>{const M=(()=>{for(const O of Object.keys(g))if(g[O]())return!0;return!1})()?c.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let O=f;O0;O++){const N=r.shift();N.abortController.signal.aborted?O--:y(N)}},C=(M,O)=>new Promise((N,B)=>{const H=new Image,J=M.url,te=M.credentials;te&&te==="include"?H.crossOrigin="use-credentials":(te&&te==="same-origin"||!c.s(J))&&(H.crossOrigin="anonymous"),O.signal.addEventListener("abort",()=>{H.src="",B(c.c())}),H.fetchPriority="high",H.onload=()=>{H.onerror=H.onload=null,N({data:H})},H.onerror=()=>{H.onerror=H.onload=null,O.signal.aborted||B(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."))},H.src=J})}(se||(se={})),se.resetRequestQueue();class fe{constructor(r){this._transformRequestFn=r}transformRequest(r,f){return this._transformRequestFn&&this._transformRequestFn(r,f)||{url:r}}setTransformRequest(r){this._transformRequestFn=r}}function Se(b){var r=new c.A(3);return r[0]=b[0],r[1]=b[1],r[2]=b[2],r}var Te,Fe=function(b,r,f){return b[0]=r[0]-f[0],b[1]=r[1]-f[1],b[2]=r[2]-f[2],b};Te=new c.A(3),c.A!=Float32Array&&(Te[0]=0,Te[1]=0,Te[2]=0);var Ne=function(b){var r=b[0],f=b[1];return r*r+f*f};function Oe(b){const r=[];if(typeof b=="string")r.push({id:"default",url:b});else if(b&&b.length>0){const f=[];for(const{id:p,url:g}of b){const y=`${p}${g}`;f.indexOf(y)===-1&&(f.push(y),r.push({id:p,url:g}))}}return r}function Je(b,r,f){const p=b.split("?");return p[0]+=`${r}${f}`,p.join("?")}(function(){var b=new c.A(2);c.A!=Float32Array&&(b[0]=0,b[1]=0)})();class Xe{constructor(r,f,p,g){this.context=r,this.format=p,this.texture=r.gl.createTexture(),this.update(f,g)}update(r,f,p){const{width:g,height:y}=r,E=!(this.size&&this.size[0]===g&&this.size[1]===y||p),{context:C}=this,{gl:M}=C;if(this.useMipmap=!!(f&&f.useMipmap),M.bindTexture(M.TEXTURE_2D,this.texture),C.pixelStoreUnpackFlipY.set(!1),C.pixelStoreUnpack.set(1),C.pixelStoreUnpackPremultiplyAlpha.set(this.format===M.RGBA&&(!f||f.premultiply!==!1)),E)this.size=[g,y],r instanceof HTMLImageElement||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageData||c.b(r)?M.texImage2D(M.TEXTURE_2D,0,this.format,this.format,M.UNSIGNED_BYTE,r):M.texImage2D(M.TEXTURE_2D,0,this.format,g,y,0,this.format,M.UNSIGNED_BYTE,r.data);else{const{x:O,y:N}=p||{x:0,y:0};r instanceof HTMLImageElement||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageData||c.b(r)?M.texSubImage2D(M.TEXTURE_2D,0,O,N,M.RGBA,M.UNSIGNED_BYTE,r):M.texSubImage2D(M.TEXTURE_2D,0,O,N,g,y,M.RGBA,M.UNSIGNED_BYTE,r.data)}this.useMipmap&&this.isSizePowerOfTwo()&&M.generateMipmap(M.TEXTURE_2D)}bind(r,f,p){const{context:g}=this,{gl:y}=g;y.bindTexture(y.TEXTURE_2D,this.texture),p!==y.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=y.LINEAR),r!==this.filter&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,r),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,p||r),this.filter=r),f!==this.wrap&&(y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,f),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,f),this.wrap=f)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:r}=this.context;r.deleteTexture(this.texture),this.texture=null}}function qe(b){const{userImage:r}=b;return!!(r&&r.render&&r.render())&&(b.data.replace(new Uint8Array(r.data.buffer)),!0)}class ht extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(r){if(this.loaded!==r&&(this.loaded=r,r)){for(const{ids:f,promiseResolve:p}of this.requestors)p(this._getImagesForIds(f));this.requestors=[]}}getImage(r){const f=this.images[r];if(f&&!f.data&&f.spriteData){const p=f.spriteData;f.data=new c.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),f.spriteData=null}return f}addImage(r,f){if(this.images[r])throw new Error(`Image id ${r} already exist, use updateImage instead`);this._validate(r,f)&&(this.images[r]=f)}_validate(r,f){let p=!0;const g=f.data||f.spriteData;return this._validateStretch(f.stretchX,g&&g.width)||(this.fire(new c.j(new Error(`Image "${r}" has invalid "stretchX" value`))),p=!1),this._validateStretch(f.stretchY,g&&g.height)||(this.fire(new c.j(new Error(`Image "${r}" has invalid "stretchY" value`))),p=!1),this._validateContent(f.content,f)||(this.fire(new c.j(new Error(`Image "${r}" has invalid "content" value`))),p=!1),p}_validateStretch(r,f){if(!r)return!0;let p=0;for(const g of r){if(g[0]{let g=!0;if(!this.isLoaded())for(const y of r)this.images[y]||(g=!1);this.isLoaded()||g?f(this._getImagesForIds(r)):this.requestors.push({ids:r,promiseResolve:f})})}_getImagesForIds(r){const f={};for(const p of r){let g=this.getImage(p);g||(this.fire(new c.k("styleimagemissing",{id:p})),g=this.getImage(p)),g?f[p]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,textFitWidth:g.textFitWidth,textFitHeight:g.textFitHeight,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:c.w(`Image "${p}" 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.`)}return f}getPixelSize(){const{width:r,height:f}=this.atlasImage;return{width:r,height:f}}getPattern(r){const f=this.patterns[r],p=this.getImage(r);if(!p)return null;if(f&&f.position.version===p.version)return f.position;if(f)f.position.version=p.version;else{const g={w:p.data.width+2,h:p.data.height+2,x:0,y:0},y=new c.I(g,p);this.patterns[r]={bin:g,position:y}}return this._updatePatternAtlas(),this.patterns[r].position}bind(r){const f=r.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Xe(r,this.atlasImage,f.RGBA),this.atlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE)}_updatePatternAtlas(){const r=[];for(const y in this.patterns)r.push(this.patterns[y].bin);const{w:f,h:p}=c.p(r),g=this.atlasImage;g.resize({width:f||1,height:p||1});for(const y in this.patterns){const{bin:E}=this.patterns[y],C=E.x+1,M=E.y+1,O=this.getImage(y).data,N=O.width,B=O.height;c.R.copy(O,g,{x:0,y:0},{x:C,y:M},{width:N,height:B}),c.R.copy(O,g,{x:0,y:B-1},{x:C,y:M-1},{width:N,height:1}),c.R.copy(O,g,{x:0,y:0},{x:C,y:M+B},{width:N,height:1}),c.R.copy(O,g,{x:N-1,y:0},{x:C-1,y:M},{width:1,height:B}),c.R.copy(O,g,{x:0,y:0},{x:C+N,y:M},{width:1,height:B})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(r){for(const f of r){if(this.callbackDispatchedThisFrame[f])continue;this.callbackDispatchedThisFrame[f]=!0;const p=this.getImage(f);p||c.w(`Image with ID: "${f}" was not found`),qe(p)&&this.updateImage(f,p)}}}const _t=1e20;function Dt(b,r,f,p,g,y,E,C,M){for(let O=r;O-1);M++,y[M]=C,E[M]=O,E[M+1]=_t}for(let C=0,M=0;C65535)throw new Error("glyphs > 65535 not supported");if(p.ranges[y])return{stack:r,id:f,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!p.requests[y]){const C=Rt.loadGlyphRange(r,y,this.url,this.requestManager);p.requests[y]=C}const E=yield p.requests[y];for(const C in E)this._doesCharSupportLocalGlyph(+C)||(p.glyphs[+C]=E[+C]);return p.ranges[y]=!0,{stack:r,id:f,glyph:E[f]||null}})}_doesCharSupportLocalGlyph(r){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(r))}_tinySDF(r,f,p){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(p))return;let y=r.tinySDF;if(!y){let C="400";/bold/i.test(f)?C="900":/medium/i.test(f)?C="500":/light/i.test(f)&&(C="200"),y=r.tinySDF=new Rt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:g,fontWeight:C})}const E=y.draw(String.fromCharCode(p));return{id:p,bitmap:new c.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}Rt.loadGlyphRange=function(b,r,f,p){return c._(this,void 0,void 0,function*(){const g=256*r,y=g+255,E=p.transformRequest(f.replace("{fontstack}",b).replace("{range}",`${g}-${y}`),"Glyphs"),C=yield c.l(E,new AbortController);if(!C||!C.data)throw new Error(`Could not load glyph range. range: ${r}, ${g}-${y}`);const M={};for(const O of c.n(C.data))M[O.id]=O;return M})},Rt.TinySDF=class{constructor({fontSize:b=24,buffer:r=3,radius:f=8,cutoff:p=.25,fontFamily:g="sans-serif",fontWeight:y="normal",fontStyle:E="normal"}={}){this.buffer=r,this.cutoff=p,this.radius=f;const C=this.size=b+4*r,M=this._createCanvas(C),O=this.ctx=M.getContext("2d",{willReadFrequently:!0});O.font=`${E} ${y} ${b}px ${g}`,O.textBaseline="alphabetic",O.textAlign="left",O.fillStyle="black",this.gridOuter=new Float64Array(C*C),this.gridInner=new Float64Array(C*C),this.f=new Float64Array(C),this.z=new Float64Array(C+1),this.v=new Uint16Array(C)}_createCanvas(b){const r=document.createElement("canvas");return r.width=r.height=b,r}draw(b){const{width:r,actualBoundingBoxAscent:f,actualBoundingBoxDescent:p,actualBoundingBoxLeft:g,actualBoundingBoxRight:y}=this.ctx.measureText(b),E=Math.ceil(f),C=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(y-g))),M=Math.min(this.size-this.buffer,E+Math.ceil(p)),O=C+2*this.buffer,N=M+2*this.buffer,B=Math.max(O*N,0),H=new Uint8ClampedArray(B),J={data:H,width:O,height:N,glyphWidth:C,glyphHeight:M,glyphTop:E,glyphLeft:0,glyphAdvance:r};if(C===0||M===0)return J;const{ctx:te,buffer:ae,gridInner:he,gridOuter:de}=this;te.clearRect(ae,ae,C,M),te.fillText(b,ae,ae+E);const _e=te.getImageData(ae,ae,C,M);de.fill(_t,0,B),he.fill(0,0,B);for(let re=0;re0?$e*$e:0,he[Re]=$e<0?$e*$e:0}}Dt(de,0,0,O,N,O,this.f,this.v,this.z),Dt(he,ae,ae,C,M,O,this.f,this.v,this.z);for(let re=0;re1&&(M=r[++C]);const N=Math.abs(O-M.left),B=Math.abs(O-M.right),H=Math.min(N,B);let J;const te=y/p*(g+1);if(M.isDash){const ae=g-Math.abs(te);J=Math.sqrt(H*H+ae*ae)}else J=g-Math.sqrt(H*H+te*te);this.data[E+O]=Math.max(0,Math.min(255,J+128))}}}addRegularDash(r){for(let C=r.length-1;C>=0;--C){const M=r[C],O=r[C+1];M.zeroLength?r.splice(C,1):O&&O.isDash===M.isDash&&(O.left=M.left,r.splice(C,1))}const f=r[0],p=r[r.length-1];f.isDash===p.isDash&&(f.left=p.left-this.width,p.right=f.right+this.width);const g=this.width*this.nextRow;let y=0,E=r[y];for(let C=0;C1&&(E=r[++y]);const M=Math.abs(C-E.left),O=Math.abs(C-E.right),N=Math.min(M,O);this.data[g+C]=Math.max(0,Math.min(255,(E.isDash?N:-N)+128))}}addDash(r,f){const p=f?7:0,g=2*p+1;if(this.nextRow+g>this.height)return c.w("LineAtlas out of space"),null;let y=0;for(let C=0;C{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[An]}numActive(){return Object.keys(this.active).length}}const Cn=Math.floor(A.hardwareConcurrency/2);let hi,ns;function bi(){return hi||(hi=new In),hi}In.workerCount=c.C(globalThis)?Math.max(Math.min(Cn,3),1):1;class Mi{constructor(r,f){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=f;const p=this.workerPool.acquire(f);for(let g=0;g{f.remove()}),this.actors=[],r&&this.workerPool.release(this.id)}registerMessageHandler(r,f){for(const p of this.actors)p.registerMessageHandler(r,f)}}function Xn(){return ns||(ns=new Mi(bi(),c.G),ns.registerMessageHandler("GR",(b,r,f)=>c.m(r,f))),ns}function Fs(b,r){const f=c.H();return c.J(f,f,[1,1,0]),c.K(f,f,[.5*b.width,.5*b.height,1]),c.L(f,f,b.calculatePosMatrix(r.toUnwrapped()))}function ge(b,r,f,p,g,y){const E=function(B,H,J){if(B)for(const te of B){const ae=H[te];if(ae&&ae.source===J&&ae.type==="fill-extrusion")return!0}else for(const te in H){const ae=H[te];if(ae.source===J&&ae.type==="fill-extrusion")return!0}return!1}(g&&g.layers,r,b.id),C=y.maxPitchScaleFactor(),M=b.tilesIn(p,C,E);M.sort(ve);const O=[];for(const B of M)O.push({wrappedTileID:B.tileID.wrapped().key,queryResults:B.tile.queryRenderedFeatures(r,f,b._state,B.queryGeometry,B.cameraQueryGeometry,B.scale,g,y,C,Fs(b.transform,B.tileID))});const N=function(B){const H={},J={};for(const te of B){const ae=te.queryResults,he=te.wrappedTileID,de=J[he]=J[he]||{};for(const _e in ae){const re=ae[_e],xe=de[_e]=de[_e]||{},Ee=H[_e]=H[_e]||[];for(const Re of re)xe[Re.featureIndex]||(xe[Re.featureIndex]=!0,Ee.push(Re))}}return H}(O);for(const B in N)N[B].forEach(H=>{const J=H.feature,te=b.getFeatureState(J.layer["source-layer"],J.id);J.source=J.layer.source,J.layer["source-layer"]&&(J.sourceLayer=J.layer["source-layer"]),J.state=te});return N}function ve(b,r){const f=b.tileID,p=r.tileID;return f.overscaledZ-p.overscaledZ||f.canonical.y-p.canonical.y||f.wrap-p.wrap||f.canonical.x-p.canonical.x}function Ue(b,r,f){return c._(this,void 0,void 0,function*(){let p=b;if(b.url?p=(yield c.h(r.transformRequest(b.url,"Source"),f)).data:yield A.frameAsync(f),!p)return null;const g=c.M(c.e(p,b),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in p&&p.vector_layers&&(g.vectorLayerIds=p.vector_layers.map(y=>y.id)),g})}class ce{constructor(r,f){r&&(f?this.setSouthWest(r).setNorthEast(f):Array.isArray(r)&&(r.length===4?this.setSouthWest([r[0],r[1]]).setNorthEast([r[2],r[3]]):this.setSouthWest(r[0]).setNorthEast(r[1])))}setNorthEast(r){return this._ne=r instanceof c.N?new c.N(r.lng,r.lat):c.N.convert(r),this}setSouthWest(r){return this._sw=r instanceof c.N?new c.N(r.lng,r.lat):c.N.convert(r),this}extend(r){const f=this._sw,p=this._ne;let g,y;if(r instanceof c.N)g=r,y=r;else{if(!(r instanceof ce))return Array.isArray(r)?r.length===4||r.every(Array.isArray)?this.extend(ce.convert(r)):this.extend(c.N.convert(r)):r&&("lng"in r||"lon"in r)&&"lat"in r?this.extend(c.N.convert(r)):this;if(g=r._sw,y=r._ne,!g||!y)return this}return f||p?(f.lng=Math.min(g.lng,f.lng),f.lat=Math.min(g.lat,f.lat),p.lng=Math.max(y.lng,p.lng),p.lat=Math.max(y.lat,p.lat)):(this._sw=new c.N(g.lng,g.lat),this._ne=new c.N(y.lng,y.lat)),this}getCenter(){return new c.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.N(this.getWest(),this.getNorth())}getSouthEast(){return new c.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(r){const{lng:f,lat:p}=c.N.convert(r);let g=this._sw.lng<=f&&f<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=f&&f>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&g}static convert(r){return r instanceof ce?r:r&&new ce(r)}static fromLngLat(r,f=0){const p=360*f/40075017,g=p/Math.cos(Math.PI/180*r.lat);return new ce(new c.N(r.lng-g,r.lat-p),new c.N(r.lng+g,r.lat+p))}adjustAntiMeridian(){const r=new c.N(this._sw.lng,this._sw.lat),f=new c.N(this._ne.lng,this._ne.lat);return new ce(r,r.lng>f.lng?new c.N(f.lng+360,f.lat):f)}}class We{constructor(r,f,p){this.bounds=ce.convert(this.validateBounds(r)),this.minzoom=f||0,this.maxzoom=p||24}validateBounds(r){return Array.isArray(r)&&r.length===4?[Math.max(-180,r[0]),Math.max(-90,r[1]),Math.min(180,r[2]),Math.min(90,r[3])]:[-180,-90,180,90]}contains(r){const f=Math.pow(2,r.z),p=Math.floor(c.O(this.bounds.getWest())*f),g=Math.floor(c.Q(this.bounds.getNorth())*f),y=Math.ceil(c.O(this.bounds.getEast())*f),E=Math.ceil(c.Q(this.bounds.getSouth())*f);return r.x>=p&&r.x=g&&r.y{this._options.tiles=r}),this}setUrl(r){return this.setSourceProperty(()=>{this.url=r,this._options.url=r}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(r){return c._(this,void 0,void 0,function*(){const f=r.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:this.map._requestManager.transformRequest(f,"Tile"),uid:r.uid,tileID:r.tileID,zoom:r.tileID.overscaledZ,tileSize:this.tileSize*r.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};p.request.collectResourceTiming=this._collectResourceTiming;let g="RT";if(r.actor&&r.state!=="expired"){if(r.state==="loading")return new Promise((y,E)=>{r.reloadPromise={resolve:y,reject:E}})}else r.actor=this.dispatcher.getActor(),g="LT";r.abortController=new AbortController;try{const y=yield r.actor.sendAsync({type:g,data:p},r.abortController);if(delete r.abortController,r.aborted)return;this._afterTileLoadWorkerResponse(r,y)}catch(y){if(delete r.abortController,r.aborted)return;if(y&&y.status!==404)throw y;this._afterTileLoadWorkerResponse(r,null)}})}_afterTileLoadWorkerResponse(r,f){if(f&&f.resourceTiming&&(r.resourceTiming=f.resourceTiming),f&&this.map._refreshExpiredTiles&&r.setExpiryData(f),r.loadVectorData(f,this.map.painter),r.reloadPromise){const p=r.reloadPromise;r.reloadPromise=null,this.loadTile(r).then(p.resolve).catch(p.reject)}}abortTile(r){return c._(this,void 0,void 0,function*(){r.abortController&&(r.abortController.abort(),delete r.abortController),r.actor&&(yield r.actor.sendAsync({type:"AT",data:{uid:r.uid,type:this.type,source:this.id}}))})}unloadTile(r){return c._(this,void 0,void 0,function*(){r.unloadVectorData(),r.actor&&(yield r.actor.sendAsync({type:"RMT",data:{uid:r.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ze extends c.E{constructor(r,f,p,g){super(),this.id=r,this.dispatcher=p,this.setEventedParent(g),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},f),c.e(this,c.M(f,["url","scheme","tileSize"]))}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const r=yield Ue(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,r&&(c.e(this,r),r.bounds&&(this.tileBounds=new We(r.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))}catch(r){this._tileJSONRequest=null,this.fire(new c.j(r))}})}loaded(){return this._loaded}onAdd(r){this.map=r,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(r){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),r(),this.load()}setTiles(r){return this.setSourceProperty(()=>{this._options.tiles=r}),this}setUrl(r){return this.setSourceProperty(()=>{this.url=r,this._options.url=r}),this}serialize(){return c.e({},this._options)}hasTile(r){return!this.tileBounds||this.tileBounds.contains(r.canonical)}loadTile(r){return c._(this,void 0,void 0,function*(){const f=r.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);r.abortController=new AbortController;try{const p=yield se.getImage(this.map._requestManager.transformRequest(f,"Tile"),r.abortController,this.map._refreshExpiredTiles);if(delete r.abortController,r.aborted)return void(r.state="unloaded");if(p&&p.data){this.map._refreshExpiredTiles&&p.cacheControl&&p.expires&&r.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});const g=this.map.painter.context,y=g.gl,E=p.data;r.texture=this.map.painter.getTileTexture(E.width),r.texture?r.texture.update(E,{useMipmap:!0}):(r.texture=new Xe(g,E,y.RGBA,{useMipmap:!0}),r.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST)),r.state="loaded"}}catch(p){if(delete r.abortController,r.aborted)r.state="unloaded";else if(p)throw r.state="errored",p}})}abortTile(r){return c._(this,void 0,void 0,function*(){r.abortController&&(r.abortController.abort(),delete r.abortController)})}unloadTile(r){return c._(this,void 0,void 0,function*(){r.texture&&this.map.painter.saveTileTexture(r.texture)})}hasTransition(){return!1}}class Ye extends Ze{constructor(r,f,p,g){super(r,f,p,g),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},f),this.encoding=f.encoding||"mapbox",this.redFactor=f.redFactor,this.greenFactor=f.greenFactor,this.blueFactor=f.blueFactor,this.baseShift=f.baseShift}loadTile(r){return c._(this,void 0,void 0,function*(){const f=r.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=this.map._requestManager.transformRequest(f,"Tile");r.neighboringTiles=this._getNeighboringTiles(r.tileID),r.abortController=new AbortController;try{const g=yield se.getImage(p,r.abortController,this.map._refreshExpiredTiles);if(delete r.abortController,r.aborted)return void(r.state="unloaded");if(g&&g.data){const y=g.data;this.map._refreshExpiredTiles&&g.cacheControl&&g.expires&&r.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const E=c.b(y)&&c.U()?y:yield this.readImageNow(y),C={type:this.type,uid:r.uid,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!r.actor||r.state==="expired"){r.actor=this.dispatcher.getActor();const M=yield r.actor.sendAsync({type:"LDT",data:C});r.dem=M,r.needsHillshadePrepare=!0,r.needsTerrainPrepare=!0,r.state="loaded"}}}catch(g){if(delete r.abortController,r.aborted)r.state="unloaded";else if(g)throw r.state="errored",g}})}readImageNow(r){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.V()){const f=r.width+2,p=r.height+2;try{return new c.R({width:f,height:p},yield c.W(r,-1,-1,f,p))}catch{}}return A.getImageData(r,1)})}_getNeighboringTiles(r){const f=r.canonical,p=Math.pow(2,f.z),g=(f.x-1+p)%p,y=f.x===0?r.wrap-1:r.wrap,E=(f.x+1+p)%p,C=f.x+1===p?r.wrap+1:r.wrap,M={};return M[new c.S(r.overscaledZ,y,f.z,g,f.y).key]={backfilled:!1},M[new c.S(r.overscaledZ,C,f.z,E,f.y).key]={backfilled:!1},f.y>0&&(M[new c.S(r.overscaledZ,y,f.z,g,f.y-1).key]={backfilled:!1},M[new c.S(r.overscaledZ,r.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},M[new c.S(r.overscaledZ,C,f.z,E,f.y-1).key]={backfilled:!1}),f.y+10&&c.e(y,{resourceTiming:g}),this.fire(new c.k("data",Object.assign(Object.assign({},y),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},y),{sourceDataType:"content"})))}catch(p){if(this._pendingLoads--,this._removed)return void this.fire(new c.k("dataabort",{dataType:"source"}));this.fire(new c.j(p))}})}loaded(){return this._pendingLoads===0}loadTile(r){return c._(this,void 0,void 0,function*(){const f=r.actor?"RT":"LT";r.actor=this.actor;const p={type:this.type,uid:r.uid,tileID:r.tileID,zoom:r.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.abortController=new AbortController;const g=yield this.actor.sendAsync({type:f,data:p},r.abortController);delete r.abortController,r.unloadVectorData(),r.aborted||r.loadVectorData(g,this.map.painter,f==="RT")})}abortTile(r){return c._(this,void 0,void 0,function*(){r.abortController&&(r.abortController.abort(),delete r.abortController),r.aborted=!0})}unloadTile(r){return c._(this,void 0,void 0,function*(){r.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:r.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Qe=c.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Mt extends c.E{constructor(r,f,p,g){super(),this.id=r,this.dispatcher=p,this.coordinates=f.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=f}load(r){return c._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const f=yield se.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,f&&f.data&&(this.image=f.data,r&&(this.coordinates=r),this._finishLoading())}catch(f){this._request=null,this._loaded=!0,this.fire(new c.j(f))}})}loaded(){return this._loaded}updateImage(r){return r.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=r.url,this.load(r.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(r){this.coordinates=r;const f=r.map(c.Z.fromLngLat);this.tileID=function(g){let y=1/0,E=1/0,C=-1/0,M=-1/0;for(const H of g)y=Math.min(y,H.x),E=Math.min(E,H.y),C=Math.max(C,H.x),M=Math.max(M,H.y);const O=Math.max(C-y,M-E),N=Math.max(0,Math.floor(-Math.log(O)/Math.LN2)),B=Math.pow(2,N);return new c.a1(N,Math.floor((y+C)/2*B),Math.floor((E+M)/2*B))}(f),this.minzoom=this.maxzoom=this.tileID.z;const p=f.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new c.$,this._boundsArray.emplaceBack(p[0].x,p[0].y,0,0),this._boundsArray.emplaceBack(p[1].x,p[1].y,c.X,0),this._boundsArray.emplaceBack(p[3].x,p[3].y,0,c.X),this._boundsArray.emplaceBack(p[2].x,p[2].y,c.X,c.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const r=this.map.painter.context,f=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Qe.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Xe(r,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const y=this.tiles[g];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(r){return c._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={}):r.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class gt extends Mt{constructor(r,f,p,g){super(r,f,p,g),this.roundZoom=!0,this.type="video",this.options=f}load(){return c._(this,void 0,void 0,function*(){this._loaded=!1;const r=this.options;this.urls=[];for(const f of r.urls)this.urls.push(this.map._requestManager.transformRequest(f,"Source").url);try{const f=yield c.a3(this.urls);if(this._loaded=!0,!f)return;this.video=f,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(f){this.fire(new c.j(f))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(r){if(this.video){const f=this.video.seekable;rf.end(0)?this.fire(new c.j(new c.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=r}}getVideo(){return this.video}onAdd(r){this.map||(this.map=r,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const r=this.map.painter.context,f=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Qe.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new Xe(r,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let p=!1;for(const g in this.tiles){const y=this.tiles[g];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,p=!0)}p&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class wt extends Mt{constructor(r,f,p,g){super(r,f,p,g),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(E=>typeof E!="number"))||this.fire(new c.j(new c.a2(`sources.${r}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.a2(`sources.${r}`,null,'missing required property "coordinates"'))),f.animate&&typeof f.animate!="boolean"&&this.fire(new c.j(new c.a2(`sources.${r}`,null,'optional "animate" property must be a boolean value'))),f.canvas?typeof f.canvas=="string"||f.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.a2(`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 c.j(new c.a2(`sources.${r}`,null,'missing required property "canvas"'))),this.options=f,this.animate=f.animate===void 0||f.animate}load(){return c._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(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())})}getCanvas(){return this.canvas}onAdd(r){this.map=r,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let r=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,r=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,r=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const f=this.map.painter.context,p=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,Qe.members)),this.boundsSegments||(this.boundsSegments=c.a0.simpleSegment(0,0,4,2)),this.texture?(r||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Xe(f,this.canvas,p.RGBA,{premultiply:!0});let g=!1;for(const y in this.tiles){const E=this.tiles[y];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const r of[this.canvas.width,this.canvas.height])if(isNaN(r)||r<=0)return!0;return!1}}const Lt={},Kt=b=>{switch(b){case"geojson":return it;case"image":return Mt;case"raster":return Ze;case"raster-dem":return Ye;case"vector":return Ge;case"video":return gt;case"canvas":return wt}return Lt[b]},je="RTLPluginLoaded";class Jt extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Xn()}_syncState(r){return this.status=r,this.dispatcher.broadcast("SRPS",{pluginStatus:r,pluginURL:this.url}).catch(f=>{throw this.status="error",f})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(r){return c._(this,arguments,void 0,function*(f,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=A.resolveURL(f),!this.url)throw new Error(`requested url ${f} is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return c._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.k(je))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let mi=null;function _i(){return mi||(mi=new Jt),mi}class Gi{constructor(r,f){this.timeAdded=0,this.fadeEndTime=0,this.tileID=r,this.uid=c.a4(),this.uses=0,this.tileSize=f,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(r){const f=r+this.timeAdded;fy.getLayer(O)).filter(Boolean);if(M.length!==0){C.layers=M,C.stateDependentLayerIds&&(C.stateDependentLayers=C.stateDependentLayerIds.map(O=>M.filter(N=>N.id===O)[0]));for(const O of M)E[O.id]=C}}return E}(r.buckets,f.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const y=this.buckets[g];if(y instanceof c.a6){if(this.hasSymbolBuckets=!0,!p)break;y.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const y=this.buckets[g];if(y instanceof c.a6&&y.hasRTLText){this.hasRTLText=!0,_i().lazyLoad();break}}this.queryPadding=0;for(const g in this.buckets){const y=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(g).queryRadius(y))}r.imageAtlas&&(this.imageAtlas=r.imageAtlas),r.glyphAtlasImage&&(this.glyphAtlasImage=r.glyphAtlasImage)}else this.collisionBoxArray=new c.a5}unloadVectorData(){for(const r in this.buckets)this.buckets[r].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(r){return this.buckets[r.id]}upload(r){for(const p in this.buckets){const g=this.buckets[p];g.uploadPending()&&g.upload(r)}const f=r.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Xe(r,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Xe(r,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(r){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(r,this.imageAtlasTexture)}queryRenderedFeatures(r,f,p,g,y,E,C,M,O,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:y,scale:E,tileSize:this.tileSize,pixelPosMatrix:N,transform:M,params:C,queryPadding:this.queryPadding*O},r,f,p):{}}querySourceFeatures(r,f){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const g=p.loadVTLayers(),y=f&&f.sourceLayer?f.sourceLayer:"",E=g._geojsonTileLayer||g[y];if(!E)return;const C=c.a7(f&&f.filter),{z:M,x:O,y:N}=this.tileID.canonical,B={z:M,x:O,y:N};for(let H=0;Hp)g=!1;else if(f)if(this.expirationTime{this.remove(r,y)},p)),this.data[g].push(y),this.order.push(g),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}has(r){return r.wrapped().key in this.data}getAndRemove(r){return this.has(r)?this._getAndRemoveByKey(r.wrapped().key):null}_getAndRemoveByKey(r){const f=this.data[r].shift();return f.timeout&&clearTimeout(f.timeout),this.data[r].length===0&&delete this.data[r],this.order.splice(this.order.indexOf(r),1),f.value}getByKey(r){const f=this.data[r];return f?f[0].value:null}get(r){return this.has(r)?this.data[r.wrapped().key][0].value:null}remove(r,f){if(!this.has(r))return this;const p=r.wrapped().key,g=f===void 0?0:this.data[p].indexOf(f),y=this.data[p][g];return this.data[p].splice(g,1),y.timeout&&clearTimeout(y.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(y.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(r){for(this.max=r;this.order.length>this.max;){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}filter(r){const f=[];for(const p in this.data)for(const g of this.data[p])r(g.value)||f.push(g);for(const p of f)this.remove(p.value.tileID,p)}}class $t{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(r,f,p){const g=String(f);if(this.stateChanges[r]=this.stateChanges[r]||{},this.stateChanges[r][g]=this.stateChanges[r][g]||{},c.e(this.stateChanges[r][g],p),this.deletedStates[r]===null){this.deletedStates[r]={};for(const y in this.state[r])y!==g&&(this.deletedStates[r][y]=null)}else if(this.deletedStates[r]&&this.deletedStates[r][g]===null){this.deletedStates[r][g]={};for(const y in this.state[r][g])p[y]||(this.deletedStates[r][g][y]=null)}else for(const y in p)this.deletedStates[r]&&this.deletedStates[r][g]&&this.deletedStates[r][g][y]===null&&delete this.deletedStates[r][g][y]}removeFeatureState(r,f,p){if(this.deletedStates[r]===null)return;const g=String(f);if(this.deletedStates[r]=this.deletedStates[r]||{},p&&f!==void 0)this.deletedStates[r][g]!==null&&(this.deletedStates[r][g]=this.deletedStates[r][g]||{},this.deletedStates[r][g][p]=null);else if(f!==void 0)if(this.stateChanges[r]&&this.stateChanges[r][g])for(p in this.deletedStates[r][g]={},this.stateChanges[r][g])this.deletedStates[r][g][p]=null;else this.deletedStates[r][g]=null;else this.deletedStates[r]=null}getState(r,f){const p=String(f),g=c.e({},(this.state[r]||{})[p],(this.stateChanges[r]||{})[p]);if(this.deletedStates[r]===null)return{};if(this.deletedStates[r]){const y=this.deletedStates[r][f];if(y===null)return{};for(const E in y)delete g[E]}return g}initializeTileState(r,f){r.setFeatureState(this.state,f)}coalesceChanges(r,f){const p={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const y={};for(const E in this.stateChanges[g])this.state[g][E]||(this.state[g][E]={}),c.e(this.state[g][E],this.stateChanges[g][E]),y[E]=this.state[g][E];p[g]=y}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const y={};if(this.deletedStates[g]===null)for(const E in this.state[g])y[E]={},this.state[g][E]={};else for(const E in this.deletedStates[g]){if(this.deletedStates[g][E]===null)this.state[g][E]={};else for(const C of Object.keys(this.deletedStates[g][E]))delete this.state[g][E][C];y[E]=this.state[g][E]}p[g]=p[g]||{},c.e(p[g],y)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const g in r)r[g].setFeatureState(p,f)}}class kt extends c.E{constructor(r,f,p){super(),this.id=r,this.dispatcher=p,this.on("data",g=>this._dataHandler(g)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((g,y,E,C)=>{const M=new(Kt(y.type))(g,y,E,C);if(M.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${M.id}`);return M})(r,f,p,this),this._tiles={},this._cache=new et(0,g=>this._unloadTile(g)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new $t,this._didEmitContent=!1,this._updated=!1}onAdd(r){this.map=r,this._maxTileCacheSize=r?r._maxTileCacheSize:null,this._maxTileCacheZoomLevels=r?r._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(r)}onRemove(r){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(r)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const r in this._tiles){const f=this._tiles[r];if(f.state!=="loaded"&&f.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const r=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,r&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(r,f,p){return c._(this,void 0,void 0,function*(){try{yield this._source.loadTile(r),this._tileLoaded(r,f,p)}catch(g){r.state="errored",g.status!==404?this._source.fire(new c.j(g,{tile:r})):this.update(this.transform,this.terrain)}})}_unloadTile(r){this._source.unloadTile&&this._source.unloadTile(r)}_abortTile(r){this._source.abortTile&&this._source.abortTile(r),this._source.fire(new c.k("dataabort",{tile:r,coord:r.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(r){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const f in this._tiles){const p=this._tiles[f];p.upload(r),p.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(r=>r.tileID).sort(wi).map(r=>r.key)}getRenderableIds(r){const f=[];for(const p in this._tiles)this._isIdRenderable(p,r)&&f.push(this._tiles[p]);return r?f.sort((p,g)=>{const y=p.tileID,E=g.tileID,C=new c.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle),M=new c.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return y.overscaledZ-E.overscaledZ||M.y-C.y||M.x-C.x}).map(p=>p.tileID.key):f.map(p=>p.tileID).sort(wi).map(p=>p.key)}hasRenderableParent(r){const f=this.findLoadedParent(r,0);return!!f&&this._isIdRenderable(f.tileID.key)}_isIdRenderable(r,f){return this._tiles[r]&&this._tiles[r].hasData()&&!this._coveredTiles[r]&&(f||!this._tiles[r].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const r in this._tiles)this._tiles[r].state!=="errored"&&this._reloadTile(r,"reloading")}}_reloadTile(r,f){return c._(this,void 0,void 0,function*(){const p=this._tiles[r];p&&(p.state!=="loading"&&(p.state=f),yield this._loadTile(p,r,f))})}_tileLoaded(r,f,p){r.timeAdded=A.now(),p==="expired"&&(r.refreshedUponExpiration=!0),this._setTileReloadTimer(f,r),this.getSource().type==="raster-dem"&&r.dem&&this._backfillDEM(r),this._state.initializeTileState(r,this.map?this.map.painter:null),r.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:r,coord:r.tileID}))}_backfillDEM(r){const f=this.getRenderableIds();for(let g=0;g1||(Math.abs(E)>1&&(Math.abs(E+M)===1?E+=M:Math.abs(E-M)===1&&(E-=M)),y.dem&&g.dem&&(g.dem.backfillBorder(y.dem,E,C),g.neighboringTiles&&g.neighboringTiles[O]&&(g.neighboringTiles[O].backfilled=!0)))}}getTile(r){return this.getTileByID(r.key)}getTileByID(r){return this._tiles[r]}_retainLoadedChildren(r,f,p,g){for(const y in this._tiles){let E=this._tiles[y];if(g[y]||!E.hasData()||E.tileID.overscaledZ<=f||E.tileID.overscaledZ>p)continue;let C=E.tileID;for(;E&&E.tileID.overscaledZ>f+1;){const O=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[O.key],E&&E.hasData()&&(C=O)}let M=C;for(;M.overscaledZ>f;)if(M=M.scaledTo(M.overscaledZ-1),r[M.key]){g[C.key]=C;break}}}findLoadedParent(r,f){if(r.key in this._loadedParentTiles){const p=this._loadedParentTiles[r.key];return p&&p.tileID.overscaledZ>=f?p:null}for(let p=r.overscaledZ-1;p>=f;p--){const g=r.scaledTo(p),y=this._getLoadedTile(g);if(y)return y}}findLoadedSibling(r){return this._getLoadedTile(r)}_getLoadedTile(r){const f=this._tiles[r.key];return f&&f.hasData()?f:this._cache.getByKey(r.wrapped().key)}updateCacheSize(r){const f=Math.ceil(r.width/this._source.tileSize)+1,p=Math.ceil(r.height/this._source.tileSize)+1,g=Math.floor(f*p*(this._maxTileCacheZoomLevels===null?c.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(y)}handleWrapJump(r){const f=Math.round((r-(this._prevLng===void 0?r:this._prevLng))/360);if(this._prevLng=r,f){const p={};for(const g in this._tiles){const y=this._tiles[g];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+f),p[y.tileID.key]=y}this._tiles=p;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}_updateCoveredAndRetainedTiles(r,f,p,g,y,E){const C={},M={},O=Object.keys(r),N=A.now();for(const B of O){const H=r[B],J=this._tiles[B];if(!J||J.fadeEndTime!==0&&J.fadeEndTime<=N)continue;const te=this.findLoadedParent(H,f),ae=this.findLoadedSibling(H),he=te||ae||null;he&&(this._addTile(he.tileID),C[he.tileID.key]=he.tileID),M[B]=H}this._retainLoadedChildren(M,g,p,r);for(const B in C)r[B]||(this._coveredTiles[B]=!0,r[B]=C[B]);if(E){const B={},H={};for(const J of y)this._tiles[J.key].hasData()?B[J.key]=J:H[J.key]=J;for(const J in H){const te=H[J].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(B[te[0].key]=r[te[0].key]=te[0],B[te[1].key]=r[te[1].key]=te[1],B[te[2].key]=r[te[2].key]=te[2],B[te[3].key]=r[te[3].key]=te[3],delete H[J])}for(const J in H){const te=H[J],ae=this.findLoadedParent(te,this._source.minzoom),he=this.findLoadedSibling(te),de=ae||he||null;if(de){B[de.tileID.key]=r[de.tileID.key]=de.tileID;for(const _e in B)B[_e].isChildOf(de.tileID)&&delete B[_e]}}for(const J in this._tiles)B[J]||(this._coveredTiles[J]=!0)}}update(r,f){if(!this._sourceLoaded||this._paused)return;let p;this.transform=r,this.terrain=f,this.updateCacheSize(r),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=r.getVisibleUnwrappedCoordinates(this._source.tileID).map(N=>new c.S(N.canonical.z,N.wrap,N.canonical.z,N.canonical.x,N.canonical.y)):(p=r.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:f}),this._source.hasTile&&(p=p.filter(N=>this._source.hasTile(N)))):p=[];const g=r.coveringZoomLevel(this._source),y=Math.max(g-kt.maxOverzooming,this._source.minzoom),E=Math.max(g+kt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const N={};for(const B of p)if(B.canonical.z>this._source.minzoom){const H=B.scaledTo(B.canonical.z-1);N[H.key]=H;const J=B.scaledTo(Math.max(this._source.minzoom,Math.min(B.canonical.z,5)));N[J.key]=J}p=p.concat(Object.values(N))}const C=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,C&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const M=this._updateRetainedTiles(p,g);Qi(this._source.type)&&this._updateCoveredAndRetainedTiles(M,y,E,g,p,f);for(const N in M)this._tiles[N].clearFadeHold();const O=c.ab(this._tiles,M);for(const N of O){const B=this._tiles[N];B.hasSymbolBuckets&&!B.holdingForFade()?B.setHoldDuration(this.map._fadeDuration):B.hasSymbolBuckets&&!B.symbolFadeFinished()||this._removeTile(N)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const r in this._tiles)this._tiles[r].holdingForFade()&&this._removeTile(r)}_updateRetainedTiles(r,f){var p;const g={},y={},E=Math.max(f-kt.maxOverzooming,this._source.minzoom),C=Math.max(f+kt.maxUnderzooming,this._source.minzoom),M={};for(const O of r){const N=this._addTile(O);g[O.key]=O,N.hasData()||fthis._source.maxzoom){const H=O.children(this._source.maxzoom)[0],J=this.getTile(H);if(J&&J.hasData()){g[H.key]=H;continue}}else{const H=O.children(this._source.maxzoom);if(g[H[0].key]&&g[H[1].key]&&g[H[2].key]&&g[H[3].key])continue}let B=N.wasRequested();for(let H=O.overscaledZ-1;H>=E;--H){const J=O.scaledTo(H);if(y[J.key])break;if(y[J.key]=!0,N=this.getTile(J),!N&&B&&(N=this._addTile(J)),N){const te=N.hasData();if((te||!(!((p=this.map)===null||p===void 0)&&p.cancelPendingTileRequestsWhileZooming)||B)&&(g[J.key]=J),B=N.wasRequested(),te)break}}}return g}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const r in this._tiles){const f=[];let p,g=this._tiles[r].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){p=this._loadedParentTiles[g.key];break}f.push(g.key);const y=g.scaledTo(g.overscaledZ-1);if(p=this._getLoadedTile(y),p)break;g=y}for(const y of f)this._loadedParentTiles[y]=p}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const r in this._tiles){const f=this._tiles[r].tileID,p=this._getLoadedTile(f);this._loadedSiblingTiles[f.key]=p}}_addTile(r){let f=this._tiles[r.key];if(f)return f;f=this._cache.getAndRemove(r),f&&(this._setTileReloadTimer(r.key,f),f.tileID=r,this._state.initializeTileState(f,this.map?this.map.painter:null),this._cacheTimers[r.key]&&(clearTimeout(this._cacheTimers[r.key]),delete this._cacheTimers[r.key],this._setTileReloadTimer(r.key,f)));const p=f;return f||(f=new Gi(r,this._source.tileSize*r.overscaleFactor()),this._loadTile(f,r.key,f.state)),f.uses++,this._tiles[r.key]=f,p||this._source.fire(new c.k("dataloading",{tile:f,coord:f.tileID,dataType:"source"})),f}_setTileReloadTimer(r,f){r in this._timers&&(clearTimeout(this._timers[r]),delete this._timers[r]);const p=f.getExpiryTimeout();p&&(this._timers[r]=setTimeout(()=>{this._reloadTile(r,"expired"),delete this._timers[r]},p))}_removeTile(r){const f=this._tiles[r];f&&(f.uses--,delete this._tiles[r],this._timers[r]&&(clearTimeout(this._timers[r]),delete this._timers[r]),f.uses>0||(f.hasData()&&f.state!=="reloading"?this._cache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}_dataHandler(r){const f=r.sourceDataType;r.dataType==="source"&&f==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&r.dataType==="source"&&f==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const r in this._tiles)this._removeTile(r);this._cache.reset()}tilesIn(r,f,p){const g=[],y=this.transform;if(!y)return g;const E=p?y.getCameraQueryGeometry(r):r,C=r.map(te=>y.pointCoordinate(te,this.terrain)),M=E.map(te=>y.pointCoordinate(te,this.terrain)),O=this.getIds();let N=1/0,B=1/0,H=-1/0,J=-1/0;for(const te of M)N=Math.min(N,te.x),B=Math.min(B,te.y),H=Math.max(H,te.x),J=Math.max(J,te.y);for(let te=0;te=0&&re[1].y+_e>=0){const xe=C.map(Re=>he.getTilePoint(Re)),Ee=M.map(Re=>he.getTilePoint(Re));g.push({tile:ae,tileID:he,queryGeometry:xe,cameraQueryGeometry:Ee,scale:de})}}return g}getVisibleCoordinates(r){const f=this.getRenderableIds(r).map(p=>this._tiles[p].tileID);for(const p of f)p.posMatrix=this.transform.calculatePosMatrix(p.toUnwrapped());return f}hasTransition(){if(this._source.hasTransition())return!0;if(Qi(this._source.type)){const r=A.now();for(const f in this._tiles)if(this._tiles[f].fadeEndTime>=r)return!0}return!1}setFeatureState(r,f,p){this._state.updateState(r=r||"_geojsonTileLayer",f,p)}removeFeatureState(r,f,p){this._state.removeFeatureState(r=r||"_geojsonTileLayer",f,p)}getFeatureState(r,f){return this._state.getState(r=r||"_geojsonTileLayer",f)}setDependencies(r,f,p){const g=this._tiles[r];g&&g.setDependencies(f,p)}reloadTilesForDependencies(r,f){for(const p in this._tiles)this._tiles[p].hasDependency(r,f)&&this._reloadTile(p,"reloading");this._cache.filter(p=>!p.hasDependency(r,f))}}function wi(b,r){const f=Math.abs(2*b.wrap)-+(b.wrap<0),p=Math.abs(2*r.wrap)-+(r.wrap<0);return b.overscaledZ-r.overscaledZ||p-f||r.canonical.y-b.canonical.y||r.canonical.x-b.canonical.x}function Qi(b){return b==="raster"||b==="image"||b==="video"}kt.maxOverzooming=10,kt.maxUnderzooming=3;class Nt{constructor(r,f){this.reset(r,f)}reset(r,f){this.points=r||[],this._distances=[0];for(let p=1;p0?(g-E)/C:0;return this.points[y].mult(1-M).add(this.points[f].mult(M))}}function dr(b,r){let f=!0;return b==="always"||b!=="never"&&r!=="never"||(f=!1),f}class Dr{constructor(r,f,p){const g=this.boxCells=[],y=this.circleCells=[];this.xCellCount=Math.ceil(r/p),this.yCellCount=Math.ceil(f/p);for(let E=0;Ethis.width||g<0||f>this.height)return[];const M=[];if(r<=0&&f<=0&&this.width<=p&&this.height<=g){if(y)return[{key:null,x1:r,y1:f,x2:p,y2:g}];for(let O=0;O0}hitTestCircle(r,f,p,g,y){const E=r-p,C=r+p,M=f-p,O=f+p;if(C<0||E>this.width||O<0||M>this.height)return!1;const N=[];return this._forEachCell(E,M,C,O,this._queryCellCircle,N,{hitTest:!0,overlapMode:g,circle:{x:r,y:f,radius:p},seenUids:{box:{},circle:{}}},y),N.length>0}_queryCell(r,f,p,g,y,E,C,M){const{seenUids:O,hitTest:N,overlapMode:B}=C,H=this.boxCells[y];if(H!==null){const te=this.bboxes;for(const ae of H)if(!O.box[ae]){O.box[ae]=!0;const he=4*ae,de=this.boxKeys[ae];if(r<=te[he+2]&&f<=te[he+3]&&p>=te[he+0]&&g>=te[he+1]&&(!M||M(de))&&(!N||!dr(B,de.overlapMode))&&(E.push({key:de,x1:te[he],y1:te[he+1],x2:te[he+2],y2:te[he+3]}),N))return!0}}const J=this.circleCells[y];if(J!==null){const te=this.circles;for(const ae of J)if(!O.circle[ae]){O.circle[ae]=!0;const he=3*ae,de=this.circleKeys[ae];if(this._circleAndRectCollide(te[he],te[he+1],te[he+2],r,f,p,g)&&(!M||M(de))&&(!N||!dr(B,de.overlapMode))){const _e=te[he],re=te[he+1],xe=te[he+2];if(E.push({key:de,x1:_e-xe,y1:re-xe,x2:_e+xe,y2:re+xe}),N)return!0}}}return!1}_queryCellCircle(r,f,p,g,y,E,C,M){const{circle:O,seenUids:N,overlapMode:B}=C,H=this.boxCells[y];if(H!==null){const te=this.bboxes;for(const ae of H)if(!N.box[ae]){N.box[ae]=!0;const he=4*ae,de=this.boxKeys[ae];if(this._circleAndRectCollide(O.x,O.y,O.radius,te[he+0],te[he+1],te[he+2],te[he+3])&&(!M||M(de))&&!dr(B,de.overlapMode))return E.push(!0),!0}}const J=this.circleCells[y];if(J!==null){const te=this.circles;for(const ae of J)if(!N.circle[ae]){N.circle[ae]=!0;const he=3*ae,de=this.circleKeys[ae];if(this._circlesCollide(te[he],te[he+1],te[he+2],O.x,O.y,O.radius)&&(!M||M(de))&&!dr(B,de.overlapMode))return E.push(!0),!0}}}_forEachCell(r,f,p,g,y,E,C,M){const O=this._convertToXCellCoord(r),N=this._convertToYCellCoord(f),B=this._convertToXCellCoord(p),H=this._convertToYCellCoord(g);for(let J=O;J<=B;J++)for(let te=N;te<=H;te++)if(y.call(this,r,f,p,g,this.xCellCount*te+J,E,C,M))return}_convertToXCellCoord(r){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(r*this.xScale)))}_convertToYCellCoord(r){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(r*this.yScale)))}_circlesCollide(r,f,p,g,y,E){const C=g-r,M=y-f,O=p+E;return O*O>C*C+M*M}_circleAndRectCollide(r,f,p,g,y,E,C){const M=(E-g)/2,O=Math.abs(r-(g+M));if(O>M+p)return!1;const N=(C-y)/2,B=Math.abs(f-(y+N));if(B>N+p)return!1;if(O<=M||B<=N)return!0;const H=O-M,J=B-N;return H*H+J*J<=p*p}}function Fr(b,r,f,p,g){const y=c.H();return r?(c.K(y,y,[1/g,1/g,1]),f||c.ad(y,y,p.angle)):c.L(y,p.labelPlaneMatrix,b),y}function Zn(b,r,f,p,g){if(r){const y=c.ae(b);return c.K(y,y,[g,g,1]),f||c.ad(y,y,-p.angle),y}return p.glCoordMatrix}function le(b,r,f,p){let g;p?(g=[b,r,p(b,r),1],c.af(g,g,f)):(g=[b,r,0,1],ai(g,g,f));const y=g[3];return{point:new c.P(g[0]/y,g[1]/y),signedDistanceFromCamera:y,isOccluded:!1}}function j(b,r){return .5+b/r*.5}function V(b,r){return b.x>=-r[0]&&b.x<=r[0]&&b.y>=-r[1]&&b.y<=r[1]}function Y(b,r,f,p,g,y,E,C,M,O,N,B,H,J,te){const ae=p?b.textSizeData:b.iconSizeData,he=c.ag(ae,f.transform.zoom),de=[256/f.width*2+1,256/f.height*2+1],_e=p?b.text.dynamicLayoutVertexArray:b.icon.dynamicLayoutVertexArray;_e.clear();const re=b.lineVertexArray,xe=p?b.text.placedSymbolArray:b.icon.placedSymbolArray,Ee=f.transform.width/f.transform.height;let Re=!1;for(let $e=0;$eMath.abs(f.x-r.x)*p?{useVertical:!0}:(b===c.ah.vertical?r.yf.x)?{needsFlipping:!0}:null}function we(b,r,f,p,g,y,E,C,M,O,N){const B=f/24,H=r.lineOffsetX*B,J=r.lineOffsetY*B;let te;if(r.numGlyphs>1){const ae=r.glyphStartIndex+r.numGlyphs,he=r.lineStartIndex,de=r.lineStartIndex+r.lineLength,_e=ne(B,C,H,J,p,r,N,b);if(!_e)return{notEnoughRoom:!0};const re=le(_e.first.point.x,_e.first.point.y,E,b.getElevation).point,xe=le(_e.last.point.x,_e.last.point.y,E,b.getElevation).point;if(g&&!p){const Ee=ye(r.writingMode,re,xe,O);if(Ee)return Ee}te=[_e.first];for(let Ee=r.glyphStartIndex+1;Ee0?re.point:function(Re,$e,st,ut,mt,ot){return Pe(Re,$e,st,1,mt,ot)}(b.tileAnchorPoint,_e,he,0,y,b),Ee=ye(r.writingMode,he,xe,O);if(Ee)return Ee}const ae=nt(B*C.getoffsetX(r.glyphStartIndex),H,J,p,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,b,N);if(!ae||b.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};te=[ae]}for(const ae of te)c.aj(M,ae.point,ae.angle);return{}}function Pe(b,r,f,p,g,y){const E=b.add(b.sub(r)._unit()),C=g!==void 0?le(E.x,E.y,g,y.getElevation).point:ze(E.x,E.y,y).point,M=f.sub(C);return f.add(M._mult(p/M.mag()))}function pe(b,r,f){const p=r.projectionCache;if(p.projections[b])return p.projections[b];const g=new c.P(r.lineVertexArray.getx(b),r.lineVertexArray.gety(b)),y=ze(g.x,g.y,r);if(y.signedDistanceFromCamera>0)return p.projections[b]=y.point,p.anyProjectionOccluded=p.anyProjectionOccluded||y.isOccluded,y.point;const E=b-f.direction;return function(C,M,O,N,B){return Pe(C,M,O,N,void 0,B)}(f.distanceFromAnchor===0?r.tileAnchorPoint:new c.P(r.lineVertexArray.getx(E),r.lineVertexArray.gety(E)),g,f.previousVertex,f.absOffsetX-f.distanceFromAnchor+1,r)}function ze(b,r,f){const p=b+f.translation[0],g=r+f.translation[1];let y;return!f.pitchWithMap&&f.projection.useSpecialProjectionForSymbols?(y=f.projection.projectTileCoordinates(p,g,f.unwrappedTileID,f.getElevation),y.point.x=(.5*y.point.x+.5)*f.width,y.point.y=(.5*-y.point.y+.5)*f.height):(y=le(p,g,f.labelPlaneMatrix,f.getElevation),y.isOccluded=!1),y}function He(b,r,f){return b._unit()._perp()._mult(r*f)}function De(b,r,f,p,g,y,E,C,M){if(C.projectionCache.offsets[b])return C.projectionCache.offsets[b];const O=f.add(r);if(b+M.direction=g)return C.projectionCache.offsets[b]=O,O;const N=pe(b+M.direction,C,M),B=He(N.sub(f),E,M.direction),H=f.add(B),J=N.add(B);return C.projectionCache.offsets[b]=c.ak(y,O,H,J)||O,C.projectionCache.offsets[b]}function nt(b,r,f,p,g,y,E,C,M){const O=p?b-r:b+r;let N=O>0?1:-1,B=0;p&&(N*=-1,B=Math.PI),N<0&&(B+=Math.PI);let H,J=N>0?y+g:y+g+1;C.projectionCache.cachedAnchorPoint?H=C.projectionCache.cachedAnchorPoint:(H=ze(C.tileAnchorPoint.x,C.tileAnchorPoint.y,C).point,C.projectionCache.cachedAnchorPoint=H);let te,ae,he=H,de=H,_e=0,re=0;const xe=Math.abs(O),Ee=[];let Re;for(;_e+re<=xe;){if(J+=N,J=E)return null;_e+=re,de=he,ae=te;const ut={absOffsetX:xe,direction:N,distanceFromAnchor:_e,previousVertex:de};if(he=pe(J,C,ut),f===0)Ee.push(de),Re=he.sub(de);else{let mt;const ot=he.sub(de);mt=ot.mag()===0?He(pe(J+N,C,ut).sub(he),f,N):He(ot,f,N),ae||(ae=de.add(mt)),te=De(J,mt,he,y,E,ae,f,C,ut),Ee.push(ae),Re=te.sub(ae)}re=Re.mag()}const $e=Re._mult((xe-_e)/re)._add(ae||de),st=B+Math.atan2(he.y-de.y,he.x-de.x);return Ee.push($e),{point:$e,angle:M?st:0,path:Ee}}const It=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Pt(b,r){for(let f=0;f=1;Yt--)dt.push(Ht.path[Yt]);for(let Yt=1;Ytsi.signedDistanceFromCamera<=0)?[]:Yt.map(si=>si.point)}let Ui=[];if(dt.length>0){const Yt=dt[0].clone(),si=dt[0].clone();for(let Vi=1;Vi=ot.x&&si.x<=rt.x&&Yt.y>=ot.y&&si.y<=rt.y?[dt]:si.xrt.x||si.yrt.y?[]:c.al([dt],ot.x,ot.y,rt.x,rt.y)}for(const Yt of Ui){St.reset(Yt,.25*mt);let si=0;si=St.length<=.5*mt?1:Math.ceil(St.paddedLength/zt)+1;for(let Vi=0;Vile(g.x,g.y,p,f.getElevation))}queryRenderedSymbols(r){if(r.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const f=[];let p=1/0,g=1/0,y=-1/0,E=-1/0;for(const N of r){const B=new c.P(N.x+Wt,N.y+Wt);p=Math.min(p,B.x),g=Math.min(g,B.y),y=Math.max(y,B.x),E=Math.max(E,B.y),f.push(B)}const C=this.grid.query(p,g,y,E).concat(this.ignoredGrid.query(p,g,y,E)),M={},O={};for(const N of C){const B=N.key;if(M[B.bucketInstanceId]===void 0&&(M[B.bucketInstanceId]={}),M[B.bucketInstanceId][B.featureIndex])continue;const H=[new c.P(N.x1,N.y1),new c.P(N.x2,N.y1),new c.P(N.x2,N.y2),new c.P(N.x1,N.y2)];c.am(f,H)&&(M[B.bucketInstanceId][B.featureIndex]=!0,O[B.bucketInstanceId]===void 0&&(O[B.bucketInstanceId]=[]),O[B.bucketInstanceId].push(B.featureIndex))}return O}insertCollisionBox(r,f,p,g,y,E){(p?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:y,collisionGroupID:E,overlapMode:f},r[0],r[1],r[2],r[3])}insertCollisionCircles(r,f,p,g,y,E){const C=p?this.ignoredGrid:this.grid,M={bucketInstanceId:g,featureIndex:y,collisionGroupID:E,overlapMode:f};for(let O=0;O=this.screenRightBoundary||gthis.screenBottomBoundary}isInsideGrid(r,f,p,g){return p>=0&&r=0&&fthis.projectAndGetPerspectiveRatio(p,mt.x,mt.y,g,O));st=ut.some(mt=>!mt.isOccluded),$e=ut.map(mt=>mt.point)}else st=!0;return{box:c.ao($e),allPointsOccluded:!st}}}function Qt(b,r,f){return r*(c.X/(b.tileSize*Math.pow(2,f-b.tileID.overscaledZ)))}class rs{constructor(r,f,p,g){this.opacity=r?Math.max(0,Math.min(1,r.opacity+(r.placed?f:-f))):g&&p?1:0,this.placed=p}isHidden(){return this.opacity===0&&!this.placed}}class Fi{constructor(r,f,p,g,y){this.text=new rs(r?r.text:null,f,p,y),this.icon=new rs(r?r.icon:null,f,g,y)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class qt{constructor(r,f,p){this.text=r,this.icon=f,this.skipFade=p}}class li{constructor(){this.invProjMatrix=c.H(),this.viewportMatrix=c.H(),this.circles=[]}}class vi{constructor(r,f,p,g,y){this.bucketInstanceId=r,this.featureIndex=f,this.sourceLayerIndex=p,this.bucketIndex=g,this.tileID=y}}class os{constructor(r){this.crossSourceCollisions=r,this.maxGroupID=0,this.collisionGroups={}}get(r){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[r]){const f=++this.maxGroupID;this.collisionGroups[r]={ID:f,predicate:p=>p.collisionGroupID===f}}return this.collisionGroups[r]}}function ys(b,r,f,p,g){const{horizontalAlign:y,verticalAlign:E}=c.au(b);return new c.P(-(y-.5)*r+p[0]*g,-(E-.5)*f+p[1]*g)}class Hs{constructor(r,f,p,g,y,E){this.transform=r.clone(),this.terrain=p,this.collisionIndex=new ni(this.transform,f),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=g,this.retainedQueryData={},this.collisionGroups=new os(y),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=E,E&&(E.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(r){const f=this.terrain;return f?(p,g)=>f.getElevation(r,p,g):null}getBucketParts(r,f,p,g){const y=p.getBucket(f),E=p.latestFeatureIndex;if(!y||!E||f.id!==y.layerIds[0])return;const C=p.collisionBoxArray,M=y.layers[0].layout,O=y.layers[0].paint,N=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),B=p.tileSize/c.X,H=p.tileID.toUnwrapped(),J=this.transform.calculatePosMatrix(H),te=M.get("text-pitch-alignment")==="map",ae=M.get("text-rotation-alignment")==="map",he=Qt(p,1,this.transform.zoom),de=this.collisionIndex.mapProjection.translatePosition(this.transform,p,O.get("text-translate"),O.get("text-translate-anchor")),_e=this.collisionIndex.mapProjection.translatePosition(this.transform,p,O.get("icon-translate"),O.get("icon-translate-anchor")),re=Fr(J,te,ae,this.transform,he);let xe=null;if(te){const Re=Zn(J,te,ae,this.transform,he);xe=c.L([],this.transform.labelPlaneMatrix,Re)}this.retainedQueryData[y.bucketInstanceId]=new vi(y.bucketInstanceId,E,y.sourceLayerIndex,y.index,p.tileID);const Ee={bucket:y,layout:M,translationText:de,translationIcon:_e,posMatrix:J,unwrappedTileID:H,textLabelPlaneMatrix:re,labelToScreenMatrix:xe,scale:N,textPixelRatio:B,holdingForFade:p.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:c.ag(y.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(y.sourceID)};if(g)for(const Re of y.sortKeyRanges){const{sortKey:$e,symbolInstanceStart:st,symbolInstanceEnd:ut}=Re;r.push({sortKey:$e,symbolInstanceStart:st,symbolInstanceEnd:ut,parameters:Ee})}else r.push({symbolInstanceStart:0,symbolInstanceEnd:y.symbolInstances.length,parameters:Ee})}attemptAnchorPlacement(r,f,p,g,y,E,C,M,O,N,B,H,J,te,ae,he,de,_e,re){const xe=c.aq[r.textAnchor],Ee=[r.textOffset0,r.textOffset1],Re=ys(xe,p,g,Ee,y),$e=this.collisionIndex.placeCollisionBox(f,H,M,O,N,C,E,he,B.predicate,re,Re);if((!_e||this.collisionIndex.placeCollisionBox(_e,H,M,O,N,C,E,de,B.predicate,re,Re).placeable)&&$e.placeable){let st;if(this.prevPlacement&&this.prevPlacement.variableOffsets[J.crossTileID]&&this.prevPlacement.placements[J.crossTileID]&&this.prevPlacement.placements[J.crossTileID].text&&(st=this.prevPlacement.variableOffsets[J.crossTileID].anchor),J.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[J.crossTileID]={textOffset:Ee,width:p,height:g,anchor:xe,textBoxScale:y,prevAnchor:st},this.markUsedJustification(te,xe,J,ae),te.allowVerticalPlacement&&(this.markUsedOrientation(te,ae,J),this.placedOrientations[J.crossTileID]=ae),{shift:Re,placedGlyphBoxes:$e}}}placeLayerBucketPart(r,f,p){const{bucket:g,layout:y,translationText:E,translationIcon:C,posMatrix:M,unwrappedTileID:O,textLabelPlaneMatrix:N,labelToScreenMatrix:B,textPixelRatio:H,holdingForFade:J,collisionBoxArray:te,partiallyEvaluatedTextSize:ae,collisionGroup:he}=r.parameters,de=y.get("text-optional"),_e=y.get("icon-optional"),re=c.ar(y,"text-overlap","text-allow-overlap"),xe=re==="always",Ee=c.ar(y,"icon-overlap","icon-allow-overlap"),Re=Ee==="always",$e=y.get("text-rotation-alignment")==="map",st=y.get("text-pitch-alignment")==="map",ut=y.get("icon-text-fit")!=="none",mt=y.get("symbol-z-order")==="viewport-y",ot=xe&&(Re||!g.hasIconData()||_e),rt=Re&&(xe||!g.hasTextData()||de);!g.collisionArrays&&te&&g.deserializeCollisionBoxes(te);const St=this._getTerrainElevationFunc(this.retainedQueryData[g.bucketInstanceId].tileID),Ht=(lt,dt,zt)=>{var Ui,Yt;if(f[lt.crossTileID])return;if(J)return void(this.placements[lt.crossTileID]=new qt(!1,!1,!1));let si=!1,Vi=!1,tn=!0,Lr=null,ji={box:null,placeable:!1,offscreen:null},Rn={box:null,placeable:!1,offscreen:null},mn=null,sn=null,_n=null,co=0,Pl=0,Ph=0;dt.textFeatureIndex?co=dt.textFeatureIndex:lt.useRuntimeCollisionCircles&&(co=lt.featureIndex),dt.verticalTextFeatureIndex&&(Pl=dt.verticalTextFeatureIndex);const Ml=dt.textBox;if(Ml){const br=Xs=>{let nn=c.ah.horizontal;if(g.allowVerticalPlacement&&!Xs&&this.prevPlacement){const Jn=this.prevPlacement.placedOrientations[lt.crossTileID];Jn&&(this.placedOrientations[lt.crossTileID]=Jn,nn=Jn,this.markUsedOrientation(g,nn,lt))}return nn},vr=(Xs,nn)=>{if(g.allowVerticalPlacement&<.numVerticalGlyphVertices>0&&dt.verticalTextBox){for(const Jn of g.writingModes)if(Jn===c.ah.vertical?(ji=nn(),Rn=ji):ji=Xs(),ji&&ji.placeable)break}else ji=Xs()},Wo=lt.textAnchorOffsetStartIndex,zr=lt.textAnchorOffsetEndIndex;if(zr===Wo){const Xs=(nn,Jn)=>{const oi=this.collisionIndex.placeCollisionBox(nn,re,H,M,O,st,$e,E,he.predicate,St);return oi&&oi.placeable&&(this.markUsedOrientation(g,Jn,lt),this.placedOrientations[lt.crossTileID]=Jn),oi};vr(()=>Xs(Ml,c.ah.horizontal),()=>{const nn=dt.verticalTextBox;return g.allowVerticalPlacement&<.numVerticalGlyphVertices>0&&nn?Xs(nn,c.ah.vertical):{box:null,offscreen:null}}),br(ji&&ji.placeable)}else{let Xs=c.aq[(Yt=(Ui=this.prevPlacement)===null||Ui===void 0?void 0:Ui.variableOffsets[lt.crossTileID])===null||Yt===void 0?void 0:Yt.anchor];const nn=(oi,za,Rl)=>{const kl=oi.x2-oi.x1,Um=oi.y2-oi.y1,Gb=lt.textBoxScale,Vm=ut&&Ee==="never"?za:null;let qo=null,jm=re==="never"?1:2,Rh="never";Xs&&jm++;for(let Kc=0;Kcnn(Ml,dt.iconBox,c.ah.horizontal),()=>{const oi=dt.verticalTextBox;return g.allowVerticalPlacement&&(!ji||!ji.placeable)&<.numVerticalGlyphVertices>0&&oi?nn(oi,dt.verticalIconBox,c.ah.vertical):{box:null,occluded:!0,offscreen:null}}),ji&&(si=ji.placeable,tn=ji.offscreen);const Jn=br(ji&&ji.placeable);if(!si&&this.prevPlacement){const oi=this.prevPlacement.variableOffsets[lt.crossTileID];oi&&(this.variableOffsets[lt.crossTileID]=oi,this.markUsedJustification(g,oi.anchor,lt,Jn))}}}if(mn=ji,si=mn&&mn.placeable,tn=mn&&mn.offscreen,lt.useRuntimeCollisionCircles){const br=g.text.placedSymbolArray.get(lt.centerJustifiedTextSymbolIndex),vr=c.ai(g.textSizeData,ae,br),Wo=y.get("text-padding");sn=this.collisionIndex.placeCollisionCircles(re,br,g.lineVertexArray,g.glyphOffsetArray,vr,M,O,N,B,p,st,he.predicate,lt.collisionCircleDiameter,Wo,E,St),sn.circles.length&&sn.collisionDetected&&!p&&c.w("Collisions detected, but collision boxes are not shown"),si=xe||sn.circles.length>0&&!sn.collisionDetected,tn=tn&&sn.offscreen}if(dt.iconFeatureIndex&&(Ph=dt.iconFeatureIndex),dt.iconBox){const br=vr=>this.collisionIndex.placeCollisionBox(vr,Ee,H,M,O,st,$e,C,he.predicate,St,ut&&Lr?Lr:void 0);Rn&&Rn.placeable&&dt.verticalIconBox?(_n=br(dt.verticalIconBox),Vi=_n.placeable):(_n=br(dt.iconBox),Vi=_n.placeable),tn=tn&&_n.offscreen}const yr=de||lt.numHorizontalGlyphVertices===0&<.numVerticalGlyphVertices===0,Mh=_e||lt.numIconVertices===0;yr||Mh?Mh?yr||(Vi=Vi&&si):si=Vi&&si:Vi=si=Vi&&si;const sp=Vi&&_n.placeable;if(si&&mn.placeable&&this.collisionIndex.insertCollisionBox(mn.box,re,y.get("text-ignore-placement"),g.bucketInstanceId,Rn&&Rn.placeable&&Pl?Pl:co,he.ID),sp&&this.collisionIndex.insertCollisionBox(_n.box,Ee,y.get("icon-ignore-placement"),g.bucketInstanceId,Ph,he.ID),sn&&si&&this.collisionIndex.insertCollisionCircles(sn.circles,re,y.get("text-ignore-placement"),g.bucketInstanceId,co,he.ID),p&&this.storeCollisionData(g.bucketInstanceId,zt,dt,mn,_n,sn),lt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(g.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[lt.crossTileID]=new qt(si||ot,Vi||rt,tn||g.justReloaded),f[lt.crossTileID]=!0};if(mt){if(r.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const lt=g.getSortedSymbolIndexes(this.transform.angle);for(let dt=lt.length-1;dt>=0;--dt){const zt=lt[dt];Ht(g.symbolInstances.get(zt),g.collisionArrays[zt],zt)}}else for(let lt=r.symbolInstanceStart;lt=0&&(r.text.placedSymbolArray.get(C).crossTileID=y>=0&&C!==y?0:p.crossTileID)}markUsedOrientation(r,f,p){const g=f===c.ah.horizontal||f===c.ah.horizontalOnly?f:0,y=f===c.ah.vertical?f:0,E=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(const C of E)r.text.placedSymbolArray.get(C).placedOrientation=g;p.verticalPlacedTextSymbolIndex&&(r.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=y)}commit(r){this.commitTime=r,this.zoomAtLastRecencyCheck=this.transform.zoom;const f=this.prevPlacement;let p=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;const g=f?f.symbolFadeChange(r):1,y=f?f.opacities:{},E=f?f.variableOffsets:{},C=f?f.placedOrientations:{};for(const M in this.placements){const O=this.placements[M],N=y[M];N?(this.opacities[M]=new Fi(N,g,O.text,O.icon),p=p||O.text!==N.text.placed||O.icon!==N.icon.placed):(this.opacities[M]=new Fi(null,g,O.text,O.icon,O.skipFade),p=p||O.text||O.icon)}for(const M in y){const O=y[M];if(!this.opacities[M]){const N=new Fi(O,g,!1,!1);N.isHidden()||(this.opacities[M]=N,p=p||O.text.placed||O.icon.placed)}}for(const M in E)this.variableOffsets[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.variableOffsets[M]=E[M]);for(const M in C)this.placedOrientations[M]||!this.opacities[M]||this.opacities[M].isHidden()||(this.placedOrientations[M]=C[M]);if(f&&f.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=r:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:r)}updateLayerOpacities(r,f){const p={};for(const g of f){const y=g.getBucket(r);y&&g.latestFeatureIndex&&r.id===y.layerIds[0]&&this.updateBucketOpacities(y,g.tileID,p,g.collisionBoxArray)}}updateBucketOpacities(r,f,p,g){r.hasTextData()&&(r.text.opacityVertexArray.clear(),r.text.hasVisibleVertices=!1),r.hasIconData()&&(r.icon.opacityVertexArray.clear(),r.icon.hasVisibleVertices=!1),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexArray.clear(),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexArray.clear();const y=r.layers[0],E=y.layout,C=new Fi(null,0,!1,!1,!0),M=E.get("text-allow-overlap"),O=E.get("icon-allow-overlap"),N=y._unevaluatedLayout.hasValue("text-variable-anchor")||y._unevaluatedLayout.hasValue("text-variable-anchor-offset"),B=E.get("text-rotation-alignment")==="map",H=E.get("text-pitch-alignment")==="map",J=E.get("icon-text-fit")!=="none",te=new Fi(null,0,M&&(O||!r.hasIconData()||E.get("icon-optional")),O&&(M||!r.hasTextData()||E.get("text-optional")),!0);!r.collisionArrays&&g&&(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData())&&r.deserializeCollisionBoxes(g);const ae=(de,_e,re)=>{for(let xe=0;xe<_e/4;xe++)de.opacityVertexArray.emplaceBack(re);de.hasVisibleVertices=de.hasVisibleVertices||re!==So},he=this.collisionBoxArrays.get(r.bucketInstanceId);for(let de=0;de0,st=this.placedOrientations[_e.crossTileID],ut=st===c.ah.vertical,mt=st===c.ah.horizontal||st===c.ah.horizontalOnly;if(re>0||xe>0){const rt=cs(Re.text);ae(r.text,re,ut?So:rt),ae(r.text,xe,mt?So:rt);const St=Re.text.isHidden();[_e.rightJustifiedTextSymbolIndex,_e.centerJustifiedTextSymbolIndex,_e.leftJustifiedTextSymbolIndex].forEach(dt=>{dt>=0&&(r.text.placedSymbolArray.get(dt).hidden=St||ut?1:0)}),_e.verticalPlacedTextSymbolIndex>=0&&(r.text.placedSymbolArray.get(_e.verticalPlacedTextSymbolIndex).hidden=St||mt?1:0);const Ht=this.variableOffsets[_e.crossTileID];Ht&&this.markUsedJustification(r,Ht.anchor,_e,st);const lt=this.placedOrientations[_e.crossTileID];lt&&(this.markUsedJustification(r,"left",_e,lt),this.markUsedOrientation(r,lt,_e))}if($e){const rt=cs(Re.icon),St=!(J&&_e.verticalPlacedIconSymbolIndex&&ut);_e.placedIconSymbolIndex>=0&&(ae(r.icon,_e.numIconVertices,St?rt:So),r.icon.placedSymbolArray.get(_e.placedIconSymbolIndex).hidden=Re.icon.isHidden()),_e.verticalPlacedIconSymbolIndex>=0&&(ae(r.icon,_e.numVerticalIconVertices,St?So:rt),r.icon.placedSymbolArray.get(_e.verticalPlacedIconSymbolIndex).hidden=Re.icon.isHidden())}const ot=he&&he.has(de)?he.get(de):{text:null,icon:null};if(r.hasIconCollisionBoxData()||r.hasTextCollisionBoxData()){const rt=r.collisionArrays[de];if(rt){let St=new c.P(0,0);if(rt.textBox||rt.verticalTextBox){let Ht=!0;if(N){const lt=this.variableOffsets[Ee];lt?(St=ys(lt.anchor,lt.width,lt.height,lt.textOffset,lt.textBoxScale),B&&St._rotate(H?this.transform.angle:-this.transform.angle)):Ht=!1}if(rt.textBox||rt.verticalTextBox){let lt;rt.textBox&&(lt=ut),rt.verticalTextBox&&(lt=mt),jo(r.textCollisionBox.collisionVertexArray,Re.text.placed,!Ht||lt,ot.text,St.x,St.y)}}if(rt.iconBox||rt.verticalIconBox){const Ht=!!(!mt&&rt.verticalIconBox);let lt;rt.iconBox&&(lt=Ht),rt.verticalIconBox&&(lt=!Ht),jo(r.iconCollisionBox.collisionVertexArray,Re.icon.placed,lt,ot.icon,J?St.x:0,J?St.y:0)}}}}if(r.sortFeatures(this.transform.angle),this.retainedQueryData[r.bucketInstanceId]&&(this.retainedQueryData[r.bucketInstanceId].featureSortOrder=r.featureSortOrder),r.hasTextData()&&r.text.opacityVertexBuffer&&r.text.opacityVertexBuffer.updateData(r.text.opacityVertexArray),r.hasIconData()&&r.icon.opacityVertexBuffer&&r.icon.opacityVertexBuffer.updateData(r.icon.opacityVertexArray),r.hasIconCollisionBoxData()&&r.iconCollisionBox.collisionVertexBuffer&&r.iconCollisionBox.collisionVertexBuffer.updateData(r.iconCollisionBox.collisionVertexArray),r.hasTextCollisionBoxData()&&r.textCollisionBox.collisionVertexBuffer&&r.textCollisionBox.collisionVertexBuffer.updateData(r.textCollisionBox.collisionVertexArray),r.text.opacityVertexArray.length!==r.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${r.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${r.text.layoutVertexArray.length}) / 4`);if(r.icon.opacityVertexArray.length!==r.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${r.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${r.icon.layoutVertexArray.length}) / 4`);if(r.bucketInstanceId in this.collisionCircleArrays){const de=this.collisionCircleArrays[r.bucketInstanceId];r.placementInvProjMatrix=de.invProjMatrix,r.placementViewportMatrix=de.viewportMatrix,r.collisionCircleArray=de.circles,delete this.collisionCircleArrays[r.bucketInstanceId]}}symbolFadeChange(r){return this.fadeDuration===0?1:(r-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(r){return Math.max(0,(this.transform.zoom-r)/1.5)}hasTransitions(r){return this.stale||r-this.lastPlacementChangeTimer}setStale(){this.stale=!0}}function jo(b,r,f,p,g,y){p&&p.length!==0||(p=[0,0,0,0]);const E=p[0]-Wt,C=p[1]-Wt,M=p[2]-Wt,O=p[3]-Wt;b.emplaceBack(r?1:0,f?1:0,g||0,y||0,E,C),b.emplaceBack(r?1:0,f?1:0,g||0,y||0,M,C),b.emplaceBack(r?1:0,f?1:0,g||0,y||0,M,O),b.emplaceBack(r?1:0,f?1:0,g||0,y||0,E,O)}const ui=Math.pow(2,25),Js=Math.pow(2,24),io=Math.pow(2,17),fs=Math.pow(2,16),as=Math.pow(2,9),Ca=Math.pow(2,8),ls=Math.pow(2,1);function cs(b){if(b.opacity===0&&!b.placed)return 0;if(b.opacity===1&&b.placed)return 4294967295;const r=b.placed?1:0,f=Math.floor(127*b.opacity);return f*ui+r*Js+f*io+r*fs+f*as+r*Ca+f*ls+r}const So=0;function so(){return{isOccluded:(b,r,f)=>!1,getPitchedTextCorrection:(b,r,f)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(b,r,f,p){throw new Error("Not implemented.")},translatePosition:(b,r,f,p)=>function(g,y,E,C,M=!1){if(!E[0]&&!E[1])return[0,0];const O=M?C==="map"?g.angle:0:C==="viewport"?-g.angle:0;if(O){const N=Math.sin(O),B=Math.cos(O);E=[E[0]*B-E[1]*N,E[0]*N+E[1]*B]}return[M?E[0]:Qt(y,E[0],g.zoom),M?E[1]:Qt(y,E[1],g.zoom)]}(b,r,f,p),getCircleRadiusCorrection:b=>1}}class Zi{constructor(r){this._sortAcrossTiles=r.layout.get("symbol-z-order")!=="viewport-y"&&!r.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(r,f,p,g,y){const E=this._bucketParts;for(;this._currentTileIndexC.sortKey-M.sortKey));this._currentPartIndex!this._forceFullPlacement&&A.now()-g>2;for(;this._currentPlacementIndex>=0;){const E=f[r[this._currentPlacementIndex]],C=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=C)&&(!E.maxzoom||E.maxzoom>C)){if(this._inProgressLayer||(this._inProgressLayer=new Zi(E)),this._inProgressLayer.continuePlacement(p[E.source],this.placement,this._showCollisionBoxes,E,y))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(r){return this.placement.commit(r),this.placement}}const Gs=512/c.X/2;class Yi{constructor(r,f,p){this.tileID=r,this.bucketInstanceId=p,this._symbolsByKey={};const g=new Map;for(let y=0;y({x:Math.floor(M.anchorX*Gs),y:Math.floor(M.anchorY*Gs)})),crossTileIDs:E.map(M=>M.crossTileID)};if(C.positions.length>128){const M=new c.av(C.positions.length,16,Uint16Array);for(const{x:O,y:N}of C.positions)M.add(O,N);M.finish(),delete C.positions,C.index=M}this._symbolsByKey[y]=C}}getScaledCoordinates(r,f){const{x:p,y:g,z:y}=this.tileID.canonical,{x:E,y:C,z:M}=f.canonical,O=Gs/Math.pow(2,M-y),N=(C*c.X+r.anchorY)*O,B=g*c.X*Gs;return{x:Math.floor((E*c.X+r.anchorX)*O-p*c.X*Gs),y:Math.floor(N-B)}}findMatches(r,f,p){const g=this.tileID.canonical.zr)}}class $o{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class gn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(r){const f=Math.round((r-this.lng)/360);if(f!==0)for(const p in this.indexes){const g=this.indexes[p],y={};for(const E in g){const C=g[E];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+f),y[C.tileID.key]=C}this.indexes[p]=y}this.lng=r}addBucket(r,f,p){if(this.indexes[r.overscaledZ]&&this.indexes[r.overscaledZ][r.key]){if(this.indexes[r.overscaledZ][r.key].bucketInstanceId===f.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(r.overscaledZ,this.indexes[r.overscaledZ][r.key])}for(let y=0;yr.overscaledZ)for(const C in E){const M=E[C];M.tileID.isChildOf(r)&&M.findMatches(f.symbolInstances,r,g)}else{const C=E[r.scaledTo(Number(y)).key];C&&C.findMatches(f.symbolInstances,r,g)}}for(let y=0;y{f[p]=!0});for(const p in this.layerIndexes)f[p]||delete this.layerIndexes[p]}}const Qs=(b,r)=>c.t(b,r&&r.filter(f=>f.identifier!=="source.canvas")),no=c.aw();class ul extends c.E{constructor(r,f={}){super(),this._rtlPluginLoaded=()=>{for(const p in this.sourceCaches){const g=this.sourceCaches[p].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[p].reload()}},this.map=r,this.dispatcher=new Mi(bi(),r._getMapId()),this.dispatcher.registerMessageHandler("GG",(p,g)=>this.getGlyphs(p,g)),this.dispatcher.registerMessageHandler("GI",(p,g)=>this.getImages(p,g)),this.imageManager=new ht,this.imageManager.setEventedParent(this),this.glyphManager=new Rt(r._requestManager,f.localIdeographFontFamily),this.lineAtlas=new $s(256,512),this.crossTileSymbolIndex=new Pa,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",c.ay()),_i().on(je,this._rtlPluginLoaded),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const g=this.sourceCaches[p.sourceId];if(!g)return;const y=g.getSource();if(y&&y.vectorLayerIds)for(const E in this._layers){const C=this._layers[E];C.source===y.id&&this._validateLayer(C)}})}loadURL(r,f={},p){this.fire(new c.k("dataloading",{dataType:"style"})),f.validate=typeof f.validate!="boolean"||f.validate;const g=this.map._requestManager.transformRequest(r,"Style");this._loadStyleRequest=new AbortController;const y=this._loadStyleRequest;c.h(g,this._loadStyleRequest).then(E=>{this._loadStyleRequest=null,this._load(E.data,f,p)}).catch(E=>{this._loadStyleRequest=null,E&&!y.signal.aborted&&this.fire(new c.j(E))})}loadJSON(r,f={},p){this.fire(new c.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,A.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,f.validate=f.validate!==!1,this._load(r,f,p)}).catch(()=>{})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(no,{validate:!1})}_load(r,f,p){var g;const y=f.transformStyle?f.transformStyle(p,r):r;if(!f.validate||!Qs(this,c.u(y))){this._loaded=!0,this.stylesheet=y;for(const E in y.sources)this.addSource(E,y.sources[E],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs),this._createLayers(),this.light=new Zt(this.stylesheet.light),this.sky=new gi(this.stylesheet.sky),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const r=c.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",r),this._order=r.map(f=>f.id),this._layers={},this._serializedLayers=null;for(const f of r){const p=c.aA(f);p.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=p}}_loadSprite(r,f=!1,p=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(y,E,C,M){return c._(this,void 0,void 0,function*(){const O=Oe(y),N=C>1?"@2x":"",B={},H={};for(const{id:J,url:te}of O){const ae=E.transformRequest(Je(te,N,".json"),"SpriteJSON");B[J]=c.h(ae,M);const he=E.transformRequest(Je(te,N,".png"),"SpriteImage");H[J]=se.getImage(he,M)}return yield Promise.all([...Object.values(B),...Object.values(H)]),function(J,te){return c._(this,void 0,void 0,function*(){const ae={};for(const he in J){ae[he]={};const de=A.getImageCanvasContext((yield te[he]).data),_e=(yield J[he]).data;for(const re in _e){const{width:xe,height:Ee,x:Re,y:$e,sdf:st,pixelRatio:ut,stretchX:mt,stretchY:ot,content:rt,textFitWidth:St,textFitHeight:Ht}=_e[re];ae[he][re]={data:null,pixelRatio:ut,sdf:st,stretchX:mt,stretchY:ot,content:rt,textFitWidth:St,textFitHeight:Ht,spriteData:{width:xe,height:Ee,x:Re,y:$e,context:de}}}}return ae})}(B,H)})}(r,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(y=>{if(this._spriteRequest=null,y)for(const E in y){this._spritesImagesIds[E]=[];const C=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(M=>!(M in y)):[];for(const M of C)this.imageManager.removeImage(M),this._changedImages[M]=!0;for(const M in y[E]){const O=E==="default"?M:`${E}:${M}`;this._spritesImagesIds[E].push(O),O in this.imageManager.images?this.imageManager.updateImage(O,y[E][M],!1):this.imageManager.addImage(O,y[E][M]),f&&(this._changedImages[O]=!0)}}}).catch(y=>{this._spriteRequest=null,g=y,this.fire(new c.j(g))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),f&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),p&&p(g)})}_unloadSprite(){for(const r of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(r),this._changedImages[r]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(r){const f=this.sourceCaches[r.source];if(!f)return;const p=r.sourceLayer;if(!p)return;const g=f.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(p)===-1)&&this.fire(new c.j(new Error(`Source layer "${p}" does not exist on source "${g.id}" as specified by style layer "${r.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const r in this.sourceCaches)if(!this.sourceCaches[r].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(r,f=!1){const p=this._serializedAllLayers();if(!r||r.length===0)return Object.values(f?c.aB(p):p);const g=[];for(const y of r)if(p[y]){const E=f?c.aB(p[y]):p[y];g.push(E)}return g}_serializedAllLayers(){let r=this._serializedLayers;if(r)return r;r=this._serializedLayers={};const f=Object.keys(this._layers);for(const p of f){const g=this._layers[p];g.type!=="custom"&&(r[p]=g.serialize())}return r}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const r in this.sourceCaches)if(this.sourceCaches[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(r){if(!this._loaded)return;const f=this._changed;if(f){const g=Object.keys(this._updatedLayers),y=Object.keys(this._removedLayers);(g.length||y.length)&&this._updateWorkerLayers(g,y);for(const E in this._updatedSources){const C=this._updatedSources[E];if(C==="reload")this._reloadSource(E);else{if(C!=="clear")throw new Error(`Invalid action ${C}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(r);this.light.updateTransitions(r),this.sky.updateTransitions(r),this._resetUpdates()}const p={};for(const g in this.sourceCaches){const y=this.sourceCaches[g];p[g]=y.used,y.used=!1}for(const g of this._order){const y=this._layers[g];y.recalculate(r,this._availableImages),!y.isHidden(r.zoom)&&y.source&&(this.sourceCaches[y.source].used=!0)}for(const g in p){const y=this.sourceCaches[g];!!p[g]!=!!y.used&&y.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(r),this.sky.recalculate(r),this.z=r.zoom,f&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const r=Object.keys(this._changedImages);if(r.length){for(const f in this.sourceCaches)this.sourceCaches[f].reloadTilesForDependencies(["icons","patterns"],r);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const r in this.sourceCaches)this.sourceCaches[r].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(r,f){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(r,!1),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(r,f={}){var p;this._checkLoaded();const g=this.serialize();if(r=f.transformStyle?f.transformStyle(g,r):r,((p=f.validate)===null||p===void 0||p)&&Qs(this,c.u(r)))return!1;(r=c.aB(r)).layers=c.az(r.layers);const y=c.aC(g,r),E=this._getOperationsToPerform(y);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const C of E.operations)C();return this.stylesheet=r,this._serializedLayers=null,!0}_getOperationsToPerform(r){const f=[],p=[];for(const g of r)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":f.push(()=>this.addLayer.apply(this,g.args));break;case"removeLayer":f.push(()=>this.removeLayer.apply(this,g.args));break;case"setPaintProperty":f.push(()=>this.setPaintProperty.apply(this,g.args));break;case"setLayoutProperty":f.push(()=>this.setLayoutProperty.apply(this,g.args));break;case"setFilter":f.push(()=>this.setFilter.apply(this,g.args));break;case"addSource":f.push(()=>this.addSource.apply(this,g.args));break;case"removeSource":f.push(()=>this.removeSource.apply(this,g.args));break;case"setLayerZoomRange":f.push(()=>this.setLayerZoomRange.apply(this,g.args));break;case"setLight":f.push(()=>this.setLight.apply(this,g.args));break;case"setGeoJSONSourceData":f.push(()=>this.setGeoJSONSourceData.apply(this,g.args));break;case"setGlyphs":f.push(()=>this.setGlyphs.apply(this,g.args));break;case"setSprite":f.push(()=>this.setSprite.apply(this,g.args));break;case"setSky":f.push(()=>this.setSky.apply(this,g.args));break;case"setTerrain":f.push(()=>this.map.setTerrain.apply(this,g.args));break;case"setTransition":f.push(()=>{});break;default:p.push(g.command)}return{operations:f,unimplemented:p}}addImage(r,f){if(this.getImage(r))return this.fire(new c.j(new Error(`An image named "${r}" already exists.`)));this.imageManager.addImage(r,f),this._afterImageUpdated(r)}updateImage(r,f){this.imageManager.updateImage(r,f)}getImage(r){return this.imageManager.getImage(r)}removeImage(r){if(!this.getImage(r))return this.fire(new c.j(new Error(`An image named "${r}" does not exist.`)));this.imageManager.removeImage(r),this._afterImageUpdated(r)}_afterImageUpdated(r){this._availableImages=this.imageManager.listImages(),this._changedImages[r]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(r,f,p={}){if(this._checkLoaded(),this.sourceCaches[r]!==void 0)throw new Error(`Source "${r}" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(f.type)>=0&&this._validate(c.u.source,`sources.${r}`,f,null,p))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);const g=this.sourceCaches[r]=new kt(r,f,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:r})),g.onAdd(this.map),this._changed=!0}removeSource(r){if(this._checkLoaded(),this.sourceCaches[r]===void 0)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===r)return this.fire(new c.j(new Error(`Source "${r}" cannot be removed while layer "${p}" is using it.`)));const f=this.sourceCaches[r];delete this.sourceCaches[r],delete this._updatedSources[r],f.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:r})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(r,f){if(this._checkLoaded(),this.sourceCaches[r]===void 0)throw new Error(`There is no source with this ID=${r}`);const p=this.sourceCaches[r].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(f),this._changed=!0}getSource(r){return this.sourceCaches[r]&&this.sourceCaches[r].getSource()}addLayer(r,f,p={}){this._checkLoaded();const g=r.id;if(this.getLayer(g))return void this.fire(new c.j(new Error(`Layer "${g}" already exists on this map.`)));let y;if(r.type==="custom"){if(Qs(this,c.aD(r)))return;y=c.aA(r)}else{if("source"in r&&typeof r.source=="object"&&(this.addSource(g,r.source),r=c.aB(r),r=c.e(r,{source:g})),this._validate(c.u.layer,`layers.${g}`,r,{arrayIndex:-1},p))return;y=c.aA(r),this._validateLayer(y),y.setEventedParent(this,{layer:{id:g}})}const E=f?this._order.indexOf(f):this._order.length;if(f&&E===-1)this.fire(new c.j(new Error(`Cannot add layer "${g}" before non-existing layer "${f}".`)));else{if(this._order.splice(E,0,g),this._layerOrderChanged=!0,this._layers[g]=y,this._removedLayers[g]&&y.source&&y.type!=="custom"){const C=this._removedLayers[g];delete this._removedLayers[g],C.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.onAdd(this.map)}}moveLayer(r,f){if(this._checkLoaded(),this._changed=!0,!this._layers[r])return void this.fire(new c.j(new Error(`The layer '${r}' does not exist in the map's style and cannot be moved.`)));if(r===f)return;const p=this._order.indexOf(r);this._order.splice(p,1);const g=f?this._order.indexOf(f):this._order.length;f&&g===-1?this.fire(new c.j(new Error(`Cannot move layer "${r}" before non-existing layer "${f}".`))):(this._order.splice(g,0,r),this._layerOrderChanged=!0)}removeLayer(r){this._checkLoaded();const f=this._layers[r];if(!f)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${r}".`)));f.setEventedParent(null);const p=this._order.indexOf(r);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[r]=f,delete this._layers[r],this._serializedLayers&&delete this._serializedLayers[r],delete this._updatedLayers[r],delete this._updatedPaintProps[r],f.onRemove&&f.onRemove(this.map)}getLayer(r){return this._layers[r]}getLayersOrder(){return[...this._order]}hasLayer(r){return r in this._layers}setLayerZoomRange(r,f,p){this._checkLoaded();const g=this.getLayer(r);g?g.minzoom===f&&g.maxzoom===p||(f!=null&&(g.minzoom=f),p!=null&&(g.maxzoom=p),this._updateLayer(g)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${r}".`)))}setFilter(r,f,p={}){this._checkLoaded();const g=this.getLayer(r);if(g){if(!c.aE(g.filter,f))return f==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(c.u.filter,`layers.${g.id}.filter`,f,null,p)||(g.filter=c.aB(f),this._updateLayer(g)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${r}".`)))}getFilter(r){return c.aB(this.getLayer(r).filter)}setLayoutProperty(r,f,p,g={}){this._checkLoaded();const y=this.getLayer(r);y?c.aE(y.getLayoutProperty(f),p)||(y.setLayoutProperty(f,p,g),this._updateLayer(y)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${r}".`)))}getLayoutProperty(r,f){const p=this.getLayer(r);if(p)return p.getLayoutProperty(f);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${r}".`)))}setPaintProperty(r,f,p,g={}){this._checkLoaded();const y=this.getLayer(r);y?c.aE(y.getPaintProperty(f),p)||(y.setPaintProperty(f,p,g)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[r]=!0,this._serializedLayers=null):this.fire(new c.j(new Error(`Cannot style non-existing layer "${r}".`)))}getPaintProperty(r,f){return this.getLayer(r).getPaintProperty(f)}setFeatureState(r,f){this._checkLoaded();const p=r.source,g=r.sourceLayer,y=this.sourceCaches[p];if(y===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const E=y.getSource().type;E==="geojson"&&g?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||g?(r.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),y.setFeatureState(g,r.id,f)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(r,f){this._checkLoaded();const p=r.source,g=this.sourceCaches[p];if(g===void 0)return void this.fire(new c.j(new Error(`The source '${p}' does not exist in the map's style.`)));const y=g.getSource().type,E=y==="vector"?r.sourceLayer:void 0;y!=="vector"||E?f&&typeof r.id!="string"&&typeof r.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(E,r.id,f):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(r){this._checkLoaded();const f=r.source,p=r.sourceLayer,g=this.sourceCaches[f];if(g!==void 0)return g.getSource().type!=="vector"||p?(r.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),g.getFeatureState(p,r.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${f}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const r=c.aF(this.sourceCaches,y=>y.serialize()),f=this._serializeByIds(this._order,!0),p=this.map.getTerrain()||void 0,g=this.stylesheet;return c.aG({version:g.version,name:g.name,metadata:g.metadata,light:g.light,sky:g.sky,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,sources:r,layers:f,terrain:p},y=>y!==void 0)}_updateLayer(r){this._updatedLayers[r.id]=!0,r.source&&!this._updatedSources[r.source]&&this.sourceCaches[r.source].getSource().type!=="raster"&&(this._updatedSources[r.source]="reload",this.sourceCaches[r.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(r){const f=E=>this._layers[E].type==="fill-extrusion",p={},g=[];for(let E=this._order.length-1;E>=0;E--){const C=this._order[E];if(f(C)){p[C]=E;for(const M of r){const O=M[C];if(O)for(const N of O)g.push(N)}}}g.sort((E,C)=>C.intersectionZ-E.intersectionZ);const y=[];for(let E=this._order.length-1;E>=0;E--){const C=this._order[E];if(f(C))for(let M=g.length-1;M>=0;M--){const O=g[M].feature;if(p[O.layer.id]{const st=de.featureSortOrder;if(st){const ut=st.indexOf(Re.featureIndex);return st.indexOf($e.featureIndex)-ut}return $e.featureIndex-Re.featureIndex});for(const Re of Ee)xe.push(Re)}}for(const de in te)te[de].forEach(_e=>{const re=_e.feature,xe=O[C[de].source].getFeatureState(re.layer["source-layer"],re.id);re.source=re.layer.source,re.layer["source-layer"]&&(re.sourceLayer=re.layer["source-layer"]),re.state=xe});return te}(this._layers,E,this.sourceCaches,r,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(y)}querySourceFeatures(r,f){f&&f.filter&&this._validate(c.u.filter,"querySourceFeatures.filter",f.filter,null,f);const p=this.sourceCaches[r];return p?function(g,y){const E=g.getRenderableIds().map(O=>g.getTileByID(O)),C=[],M={};for(let O=0;OH.getTileByID(J)).sort((J,te)=>te.tileID.overscaledZ-J.tileID.overscaledZ||(J.tileID.isLessThan(te.tileID)?-1:1))}const B=this.crossTileSymbolIndex.addLayer(N,M[N.source],r.center.lng);E=E||B}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(A.now(),r.zoom))&&(this.pauseablePlacement=new Ws(r,this.map.terrain,this._order,y,f,p,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,M),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(A.now()),C=!0),E&&this.pauseablePlacement.placement.setStale()),C||E)for(const O of this._order){const N=this._layers[O];N.type==="symbol"&&this.placement.updateLayerOpacities(N,M[N.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(A.now())}_releaseSymbolFadeTiles(){for(const r in this.sourceCaches)this.sourceCaches[r].releaseSymbolFadeTiles()}getImages(r,f){return c._(this,void 0,void 0,function*(){const p=yield this.imageManager.getImages(f.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[f.source];return g&&g.setDependencies(f.tileID.key,f.type,f.icons),p})}getGlyphs(r,f){return c._(this,void 0,void 0,function*(){const p=yield this.glyphManager.getGlyphs(f.stacks),g=this.sourceCaches[f.source];return g&&g.setDependencies(f.tileID.key,f.type,[""]),p})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(r,f={}){this._checkLoaded(),r&&this._validate(c.u.glyphs,"glyphs",r,null,f)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=r,this.glyphManager.entries={},this.glyphManager.setURL(r))}addSprite(r,f,p={},g){this._checkLoaded();const y=[{id:r,url:f}],E=[...Oe(this.stylesheet.sprite),...y];this._validate(c.u.sprite,"sprite",E,null,p)||(this.stylesheet.sprite=E,this._loadSprite(y,!0,g))}removeSprite(r){this._checkLoaded();const f=Oe(this.stylesheet.sprite);if(f.find(p=>p.id===r)){if(this._spritesImagesIds[r])for(const p of this._spritesImagesIds[r])this.imageManager.removeImage(p),this._changedImages[p]=!0;f.splice(f.findIndex(p=>p.id===r),1),this.stylesheet.sprite=f.length>0?f:void 0,delete this._spritesImagesIds[r],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${r}" doesn't exists on this map.`)))}getSprite(){return Oe(this.stylesheet.sprite)}setSprite(r,f={},p){this._checkLoaded(),r&&this._validate(c.u.sprite,"sprite",r,null,f)||(this.stylesheet.sprite=r,r?this._loadSprite(r,!0,p):(this._unloadSprite(),p&&p(null)))}}var ro=c.Y([{name:"a_pos",type:"Int16",components:2}]);const pr={prelude:ci(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -1311,15 +1311,15 @@ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=frac #else return 0.0; #endif -}`),background:ai(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +}`),background:ci(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ai(`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; +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ci(`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; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"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);}"),circle:ai(`varying vec3 v_data;varying float v_visibility; +}`,"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);}"),circle:ci(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur @@ -1335,7 +1335,7 @@ void main() { #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity -vec2 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=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -1355,7 +1355,7 @@ void main(void) { #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));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,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,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);}`),clippingMask:ai("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);}"),heatmap:ai(`uniform highp float u_intensity;varying vec2 v_extrude; +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));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,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,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;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:ci("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);}"),heatmap:ci(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { @@ -1372,11 +1372,11 @@ const highp float ZERO=1.0/255.0/16.0; void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius -vec2 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;}`),heatmapTexture:ai(`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; +vec2 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,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:ci(`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; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif -}`,"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;}"),collisionBox:ai("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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ai("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);}"),debug:ai("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,get_elevation(a_pos),1);}"),fill:ai(`#pragma mapbox: define highp vec4 color +}`,"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;}"),collisionBox:ci("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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ci("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);}"),debug:ci("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,get_elevation(a_pos),1);}"),fill:ci(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color @@ -1391,7 +1391,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ai(`varying vec2 v_pos; +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ci(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { @@ -1407,7 +1407,7 @@ gl_FragColor=vec4(1.0); void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ai(`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; +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ci(`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; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to @@ -1431,7 +1431,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 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;}`),fillPattern:ai(`#ifdef GL_ES +vec2 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;}`),fillPattern:ci(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; @@ -1458,7 +1458,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -vec2 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);}`),fillExtrusion:ai(`varying vec4 v_color;void main() {gl_FragColor=v_color; +vec2 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);}`),fillExtrusion:ci(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -1480,7 +1480,7 @@ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_off #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:ai(`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; +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:ci(`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; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -1524,20 +1524,20 @@ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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 ? a_pos -: 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;}`),hillshadePrepare:ai(`#ifdef GL_ES +: 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;}`),hillshadePrepare:ci(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;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 exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,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); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"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;}"),hillshade:ai(`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; +}`,"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;}"),hillshade:ci(`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; #define PI 3.141592653589793 void 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; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"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;}"),line:ai(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,"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;}"),line:ci(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -1571,7 +1571,7 @@ v_gamma_scale=1.0; #else 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; #endif -v_width2=vec2(outset,inset);}`),lineGradient:ai(`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 vec2 v_uv; +v_width2=vec2(outset,inset);}`),lineGradient:ci(`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 vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -1601,7 +1601,7 @@ v_gamma_scale=1.0; #else 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; #endif -v_width2=vec2(outset,inset);}`),linePattern:ai(`#ifdef GL_ES +v_width2=vec2(outset,inset);}`),linePattern:ci(`#ifdef GL_ES precision highp float; #endif 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; @@ -1653,7 +1653,7 @@ v_gamma_scale=1.0; #else 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; #endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ai(`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; +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ci(`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; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -1694,11 +1694,11 @@ v_gamma_scale=1.0; #else 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; #endif -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);}`),raster:ai(`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); +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);}`),raster:ci(`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); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,"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;}"),symbolIcon:ai(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,"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;}"),symbolIcon:ci(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -1712,7 +1712,7 @@ void main() { #pragma mapbox: initialize lowp float opacity vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ai(`#define SDF_PX 8.0 +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ci(`#define SDF_PX 8.0 uniform 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; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -1743,7 +1743,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ai(`#define SDF_PX 8.0 +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ci(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform 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; @@ -1780,55 +1780,55 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:ai("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ai("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ai("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ai("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ai(b,o){const d=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,p=o.match(/attribute ([\w]+) ([\w]+)/g),m=b.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),E=y?y.concat(m):m,I={};return{fragmentSource:b=b.replace(d,(M,k,N,B,W)=>(I[W]=!0,k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -varying ${N} ${B} ${W}; +u_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:ci("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ci("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ci("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ci("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ci(b,r){const f=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,p=r.match(/attribute ([\w]+) ([\w]+)/g),g=b.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=r.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),E=y?y.concat(g):g,C={};return{fragmentSource:b=b.replace(f,(M,O,N,B,H)=>(C[H]=!0,O==="define"?` +#ifndef HAS_UNIFORM_u_${H} +varying ${N} ${B} ${H}; #else -uniform ${N} ${B} u_${W}; +uniform ${N} ${B} u_${H}; #endif `:` -#ifdef HAS_UNIFORM_u_${W} - ${N} ${B} ${W} = u_${W}; -#endif -`)),vertexSource:o=o.replace(d,(M,k,N,B,W)=>{const Z=B==="float"?"vec2":"vec4",ee=W.match(/color/)?"color":Z;return I[W]?k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -uniform lowp float u_${W}_t; -attribute ${N} ${Z} a_${W}; -varying ${N} ${B} ${W}; +#ifdef HAS_UNIFORM_u_${H} + ${N} ${B} ${H} = u_${H}; +#endif +`)),vertexSource:r=r.replace(f,(M,O,N,B,H)=>{const J=B==="float"?"vec2":"vec4",te=H.match(/color/)?"color":J;return C[H]?O==="define"?` +#ifndef HAS_UNIFORM_u_${H} +uniform lowp float u_${H}_t; +attribute ${N} ${J} a_${H}; +varying ${N} ${B} ${H}; #else -uniform ${N} ${B} u_${W}; +uniform ${N} ${B} u_${H}; #endif -`:ee==="vec4"?` -#ifndef HAS_UNIFORM_u_${W} - ${W} = a_${W}; +`:te==="vec4"?` +#ifndef HAS_UNIFORM_u_${H} + ${H} = a_${H}; #else - ${N} ${B} ${W} = u_${W}; + ${N} ${B} ${H} = u_${H}; #endif `:` -#ifndef HAS_UNIFORM_u_${W} - ${W} = unpack_mix_${ee}(a_${W}, u_${W}_t); +#ifndef HAS_UNIFORM_u_${H} + ${H} = unpack_mix_${te}(a_${H}, u_${H}_t); #else - ${N} ${B} ${W} = u_${W}; + ${N} ${B} ${H} = u_${H}; #endif -`:k==="define"?` -#ifndef HAS_UNIFORM_u_${W} -uniform lowp float u_${W}_t; -attribute ${N} ${Z} a_${W}; +`:O==="define"?` +#ifndef HAS_UNIFORM_u_${H} +uniform lowp float u_${H}_t; +attribute ${N} ${J} a_${H}; #else -uniform ${N} ${B} u_${W}; +uniform ${N} ${B} u_${H}; #endif -`:ee==="vec4"?` -#ifndef HAS_UNIFORM_u_${W} - ${N} ${B} ${W} = a_${W}; +`:te==="vec4"?` +#ifndef HAS_UNIFORM_u_${H} + ${N} ${B} ${H} = a_${H}; #else - ${N} ${B} ${W} = u_${W}; + ${N} ${B} ${H} = u_${H}; #endif `:` -#ifndef HAS_UNIFORM_u_${W} - ${N} ${B} ${W} = unpack_mix_${ee}(a_${W}, u_${W}_t); +#ifndef HAS_UNIFORM_u_${H} + ${N} ${B} ${H} = unpack_mix_${te}(a_${H}, u_${H}_t); #else - ${N} ${B} ${W} = u_${W}; + ${N} ${B} ${H} = u_${H}; #endif -`}),staticAttributes:p,staticUniforms:E}}class Ea{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(o,d,p,m,y,E,I,M,k){this.context=o;let N=this.boundPaintVertexBuffers.length!==m.length;for(let B=0;!N&&B({u_matrix:b,u_texture:0,u_ele_delta:o,u_fog_matrix:d,u_fog_color:p?p.properties.get("fog-color"):c.aN.white,u_fog_ground_blend:p?p.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:p?p.calculateFogBlendOpacity(m):0,u_horizon_color:p?p.properties.get("horizon-color"):c.aN.white,u_horizon_fog_blend:p?p.properties.get("horizon-fog-blend"):1});function Aa(b){const o=[];for(let d=0;d({u_depth:new c.aI(ke,$e.u_depth),u_terrain:new c.aI(ke,$e.u_terrain),u_terrain_dim:new c.aJ(ke,$e.u_terrain_dim),u_terrain_matrix:new c.aK(ke,$e.u_terrain_matrix),u_terrain_unpack:new c.aL(ke,$e.u_terrain_unpack),u_terrain_exaggeration:new c.aJ(ke,$e.u_terrain_exaggeration)}))(o,Pe),this.binderUniforms=p?p.getUniforms(o,Pe):[]}draw(o,d,p,m,y,E,I,M,k,N,B,W,Z,ee,le,oe,ue,_e){const ne=o.gl;if(this.failedToCreate)return;if(o.program.set(this.program),o.setDepthMode(p),o.setStencilMode(m),o.setColorMode(y),o.setCullFace(E),M){o.activeTexture.set(ne.TEXTURE2),ne.bindTexture(ne.TEXTURE_2D,M.depthTexture),o.activeTexture.set(ne.TEXTURE3),ne.bindTexture(ne.TEXTURE_2D,M.texture);for(const Pe in this.terrainUniforms)this.terrainUniforms[Pe].set(M[Pe])}for(const Pe in this.fixedUniforms)this.fixedUniforms[Pe].set(I[Pe]);le&&le.setUniforms(o,this.binderUniforms,Z,{zoom:ee});let we=0;switch(d){case ne.LINES:we=2;break;case ne.TRIANGLES:we=3;break;case ne.LINE_STRIP:we=1}for(const Pe of W.get()){const ke=Pe.vaos||(Pe.vaos={});(ke[k]||(ke[k]=new Ea)).bind(o,this,N,le?le.getPaintVertexBuffers():[],B,Pe.vertexOffset,oe,ue,_e),ne.drawElements(d,Pe.primitiveLength*we,ne.UNSIGNED_SHORT,Pe.primitiveOffset*we*2)}}}function Q(b,o,d){const p=1/Ht(d,1,o.transform.tileZoom),m=Math.pow(2,d.tileID.overscaledZ),y=d.tileSize*Math.pow(2,o.transform.tileZoom)/m,E=y*(d.tileID.canonical.x+d.tileID.wrap*m),I=y*d.tileID.canonical.y;return{u_image:0,u_texsize:d.imageAtlasTexture.size,u_scale:[p,b.fromScale,b.toScale],u_fade:b.t,u_pixel_coord_upper:[E>>16,I>>16],u_pixel_coord_lower:[65535&E,65535&I]}}const me=(b,o,d,p)=>{const m=o.style.light,y=m.properties.get("position"),E=[y.x,y.y,y.z],I=function(){var k=new c.A(9);return c.A!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}();m.properties.get("anchor")==="viewport"&&function(k,N){var B=Math.sin(N),W=Math.cos(N);k[0]=W,k[1]=B,k[2]=0,k[3]=-B,k[4]=W,k[5]=0,k[6]=0,k[7]=0,k[8]=1}(I,-o.transform.angle),function(k,N,B){var W=N[0],Z=N[1],ee=N[2];k[0]=W*B[0]+Z*B[3]+ee*B[6],k[1]=W*B[1]+Z*B[4]+ee*B[7],k[2]=W*B[2]+Z*B[5]+ee*B[8]}(E,E,I);const M=m.properties.get("color");return{u_matrix:b,u_lightpos:E,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[M.r,M.g,M.b],u_vertical_gradient:+d,u_opacity:p}},Ne=(b,o,d,p,m,y,E)=>c.e(me(b,o,d,p),Q(y,o,E),{u_height_factor:-Math.pow(2,m.overscaledZ)/E.tileSize/8}),Ge=b=>({u_matrix:b}),xt=(b,o,d,p)=>c.e(Ge(b),Q(d,o,p)),ii=(b,o)=>({u_matrix:b,u_world:o}),xs=(b,o,d,p,m)=>c.e(xt(b,o,d,p),{u_world:m}),ws=(b,o,d,p)=>{const m=b.transform;let y,E;if(p.paint.get("circle-pitch-alignment")==="map"){const I=Ht(d,1,m.zoom);y=!0,E=[I,I]}else y=!1,E=m.pixelsToGLUnits;return{u_camera_to_center_distance:m.cameraToCenterDistance,u_scale_with_map:+(p.paint.get("circle-pitch-scale")==="map"),u_matrix:b.translatePosMatrix(o.posMatrix,d,p.paint.get("circle-translate"),p.paint.get("circle-translate-anchor")),u_pitch_with_map:+y,u_device_pixel_ratio:b.pixelRatio,u_extrude_scale:E}},qs=(b,o,d)=>({u_matrix:b,u_inv_matrix:o,u_camera_to_center_distance:d.cameraToCenterDistance,u_viewport_size:[d.width,d.height]}),Ps=(b,o,d=1)=>({u_matrix:b,u_color:o,u_overlay:0,u_overlay_scale:d}),Sc=b=>({u_matrix:b}),Xn=(b,o,d,p)=>({u_matrix:b,u_extrude_scale:Ht(o,1,d),u_intensity:p});function Zn(b,o){const d=Math.pow(2,o.canonical.z),p=o.canonical.y;return[new c.Z(0,p/d).toLngLat().lat,new c.Z(0,(p+1)/d).toLngLat().lat]}const Ec=(b,o,d,p)=>{const m=b.transform;return{u_matrix:eg(b,o,d,p),u_ratio:1/Ht(o,1,m.zoom),u_device_pixel_ratio:b.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Wu=(b,o,d,p,m)=>c.e(Ec(b,o,d,m),{u_image:0,u_image_height:p}),Gm=(b,o,d,p,m)=>{const y=b.transform,E=Ia(o,y);return{u_matrix:eg(b,o,d,m),u_texsize:o.imageAtlasTexture.size,u_ratio:1/Ht(o,1,y.zoom),u_device_pixel_ratio:b.pixelRatio,u_image:0,u_scale:[E,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Qm=(b,o,d,p,m,y)=>{const E=b.lineAtlas,I=Ia(o,b.transform),M=d.layout.get("line-cap")==="round",k=E.getDash(p.from,M),N=E.getDash(p.to,M),B=k.width*m.fromScale,W=N.width*m.toScale;return c.e(Ec(b,o,d,y),{u_patternscale_a:[I/B,-k.height/2],u_patternscale_b:[I/W,-N.height/2],u_sdfgamma:E.width/(256*Math.min(B,W)*b.pixelRatio)/2,u_image:0,u_tex_y_a:k.y,u_tex_y_b:N.y,u_mix:m.t})};function Ia(b,o){return 1/Ht(b,1,o.tileZoom)}function eg(b,o,d,p){return b.translatePosMatrix(p?p.posMatrix:o.tileID.posMatrix,o,d.paint.get("line-translate"),d.paint.get("line-translate-anchor"))}const Ob=(b,o,d,p,m)=>{return{u_matrix:b,u_tl_parent:o,u_scale_parent:d,u_buffer_scale:1,u_fade_t:p.mix,u_opacity:p.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:(E=m.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(y=m.paint.get("raster-contrast"),y>0?1/(1-y):1+y),u_spin_weights:Db(m.paint.get("raster-hue-rotate"))};var y,E};function Db(b){b*=Math.PI/180;const o=Math.sin(b),d=Math.cos(b);return[(2*d+1)/3,(-Math.sqrt(3)*o-d+1)/3,(Math.sqrt(3)*o-d+1)/3]}const tg=(b,o,d,p,m,y,E,I,M,k,N,B,W,Z)=>{const ee=E.transform;return{u_is_size_zoom_constant:+(b==="constant"||b==="source"),u_is_size_feature_constant:+(b==="constant"||b==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:ee.cameraToCenterDistance,u_pitch:ee.pitch/360*2*Math.PI,u_rotate_symbol:+d,u_aspect_ratio:ee.width/ee.height,u_fade_change:E.options.fadeDuration?E.symbolFadeChange:1,u_matrix:I,u_label_plane_matrix:M,u_coord_matrix:k,u_is_text:+B,u_pitch_with_map:+p,u_is_along_line:m,u_is_variable_anchor:y,u_texsize:W,u_texture:0,u_translation:N,u_pitched_scale:Z}},ig=(b,o,d,p,m,y,E,I,M,k,N,B,W,Z,ee)=>{const le=E.transform;return c.e(tg(b,o,d,p,m,y,E,I,M,k,N,B,W,ee),{u_gamma_scale:p?Math.cos(le._pitch)*le.cameraToCenterDistance:1,u_device_pixel_ratio:E.pixelRatio,u_is_halo:+Z})},Fb=(b,o,d,p,m,y,E,I,M,k,N,B,W,Z)=>c.e(ig(b,o,d,p,m,y,E,I,M,k,N,!0,B,!0,Z),{u_texsize_icon:W,u_texture_icon:1}),Hu=(b,o,d)=>({u_matrix:b,u_opacity:o,u_color:d}),sf=(b,o,d,p,m,y)=>c.e(function(E,I,M,k){const N=M.imageManager.getPattern(E.from.toString()),B=M.imageManager.getPattern(E.to.toString()),{width:W,height:Z}=M.imageManager.getPixelSize(),ee=Math.pow(2,k.tileID.overscaledZ),le=k.tileSize*Math.pow(2,M.transform.tileZoom)/ee,oe=le*(k.tileID.canonical.x+k.tileID.wrap*ee),ue=le*k.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:N.tl,u_pattern_br_a:N.br,u_pattern_tl_b:B.tl,u_pattern_br_b:B.br,u_texsize:[W,Z],u_mix:I.t,u_pattern_size_a:N.displaySize,u_pattern_size_b:B.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/Ht(k,1,M.transform.tileZoom),u_pixel_coord_upper:[oe>>16,ue>>16],u_pixel_coord_lower:[65535&oe,65535&ue]}}(p,y,d,m),{u_matrix:b,u_opacity:o}),qu={fillExtrusion:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_lightpos:new c.aO(b,o.u_lightpos),u_lightintensity:new c.aJ(b,o.u_lightintensity),u_lightcolor:new c.aO(b,o.u_lightcolor),u_vertical_gradient:new c.aJ(b,o.u_vertical_gradient),u_opacity:new c.aJ(b,o.u_opacity)}),fillExtrusionPattern:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_lightpos:new c.aO(b,o.u_lightpos),u_lightintensity:new c.aJ(b,o.u_lightintensity),u_lightcolor:new c.aO(b,o.u_lightcolor),u_vertical_gradient:new c.aJ(b,o.u_vertical_gradient),u_height_factor:new c.aJ(b,o.u_height_factor),u_image:new c.aI(b,o.u_image),u_texsize:new c.aP(b,o.u_texsize),u_pixel_coord_upper:new c.aP(b,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(b,o.u_pixel_coord_lower),u_scale:new c.aO(b,o.u_scale),u_fade:new c.aJ(b,o.u_fade),u_opacity:new c.aJ(b,o.u_opacity)}),fill:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix)}),fillPattern:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_image:new c.aI(b,o.u_image),u_texsize:new c.aP(b,o.u_texsize),u_pixel_coord_upper:new c.aP(b,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(b,o.u_pixel_coord_lower),u_scale:new c.aO(b,o.u_scale),u_fade:new c.aJ(b,o.u_fade)}),fillOutline:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_world:new c.aP(b,o.u_world)}),fillOutlinePattern:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_world:new c.aP(b,o.u_world),u_image:new c.aI(b,o.u_image),u_texsize:new c.aP(b,o.u_texsize),u_pixel_coord_upper:new c.aP(b,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(b,o.u_pixel_coord_lower),u_scale:new c.aO(b,o.u_scale),u_fade:new c.aJ(b,o.u_fade)}),circle:(b,o)=>({u_camera_to_center_distance:new c.aJ(b,o.u_camera_to_center_distance),u_scale_with_map:new c.aI(b,o.u_scale_with_map),u_pitch_with_map:new c.aI(b,o.u_pitch_with_map),u_extrude_scale:new c.aP(b,o.u_extrude_scale),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_matrix:new c.aK(b,o.u_matrix)}),collisionBox:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_pixel_extrude_scale:new c.aP(b,o.u_pixel_extrude_scale)}),collisionCircle:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_inv_matrix:new c.aK(b,o.u_inv_matrix),u_camera_to_center_distance:new c.aJ(b,o.u_camera_to_center_distance),u_viewport_size:new c.aP(b,o.u_viewport_size)}),debug:(b,o)=>({u_color:new c.aM(b,o.u_color),u_matrix:new c.aK(b,o.u_matrix),u_overlay:new c.aI(b,o.u_overlay),u_overlay_scale:new c.aJ(b,o.u_overlay_scale)}),clippingMask:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix)}),heatmap:(b,o)=>({u_extrude_scale:new c.aJ(b,o.u_extrude_scale),u_intensity:new c.aJ(b,o.u_intensity),u_matrix:new c.aK(b,o.u_matrix)}),heatmapTexture:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_world:new c.aP(b,o.u_world),u_image:new c.aI(b,o.u_image),u_color_ramp:new c.aI(b,o.u_color_ramp),u_opacity:new c.aJ(b,o.u_opacity)}),hillshade:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_image:new c.aI(b,o.u_image),u_latrange:new c.aP(b,o.u_latrange),u_light:new c.aP(b,o.u_light),u_shadow:new c.aM(b,o.u_shadow),u_highlight:new c.aM(b,o.u_highlight),u_accent:new c.aM(b,o.u_accent)}),hillshadePrepare:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_image:new c.aI(b,o.u_image),u_dimension:new c.aP(b,o.u_dimension),u_zoom:new c.aJ(b,o.u_zoom),u_unpack:new c.aL(b,o.u_unpack)}),line:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_ratio:new c.aJ(b,o.u_ratio),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_units_to_pixels:new c.aP(b,o.u_units_to_pixels)}),lineGradient:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_ratio:new c.aJ(b,o.u_ratio),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_units_to_pixels:new c.aP(b,o.u_units_to_pixels),u_image:new c.aI(b,o.u_image),u_image_height:new c.aJ(b,o.u_image_height)}),linePattern:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_texsize:new c.aP(b,o.u_texsize),u_ratio:new c.aJ(b,o.u_ratio),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_image:new c.aI(b,o.u_image),u_units_to_pixels:new c.aP(b,o.u_units_to_pixels),u_scale:new c.aO(b,o.u_scale),u_fade:new c.aJ(b,o.u_fade)}),lineSDF:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_ratio:new c.aJ(b,o.u_ratio),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_units_to_pixels:new c.aP(b,o.u_units_to_pixels),u_patternscale_a:new c.aP(b,o.u_patternscale_a),u_patternscale_b:new c.aP(b,o.u_patternscale_b),u_sdfgamma:new c.aJ(b,o.u_sdfgamma),u_image:new c.aI(b,o.u_image),u_tex_y_a:new c.aJ(b,o.u_tex_y_a),u_tex_y_b:new c.aJ(b,o.u_tex_y_b),u_mix:new c.aJ(b,o.u_mix)}),raster:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_tl_parent:new c.aP(b,o.u_tl_parent),u_scale_parent:new c.aJ(b,o.u_scale_parent),u_buffer_scale:new c.aJ(b,o.u_buffer_scale),u_fade_t:new c.aJ(b,o.u_fade_t),u_opacity:new c.aJ(b,o.u_opacity),u_image0:new c.aI(b,o.u_image0),u_image1:new c.aI(b,o.u_image1),u_brightness_low:new c.aJ(b,o.u_brightness_low),u_brightness_high:new c.aJ(b,o.u_brightness_high),u_saturation_factor:new c.aJ(b,o.u_saturation_factor),u_contrast_factor:new c.aJ(b,o.u_contrast_factor),u_spin_weights:new c.aO(b,o.u_spin_weights)}),symbolIcon:(b,o)=>({u_is_size_zoom_constant:new c.aI(b,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(b,o.u_is_size_feature_constant),u_size_t:new c.aJ(b,o.u_size_t),u_size:new c.aJ(b,o.u_size),u_camera_to_center_distance:new c.aJ(b,o.u_camera_to_center_distance),u_pitch:new c.aJ(b,o.u_pitch),u_rotate_symbol:new c.aI(b,o.u_rotate_symbol),u_aspect_ratio:new c.aJ(b,o.u_aspect_ratio),u_fade_change:new c.aJ(b,o.u_fade_change),u_matrix:new c.aK(b,o.u_matrix),u_label_plane_matrix:new c.aK(b,o.u_label_plane_matrix),u_coord_matrix:new c.aK(b,o.u_coord_matrix),u_is_text:new c.aI(b,o.u_is_text),u_pitch_with_map:new c.aI(b,o.u_pitch_with_map),u_is_along_line:new c.aI(b,o.u_is_along_line),u_is_variable_anchor:new c.aI(b,o.u_is_variable_anchor),u_texsize:new c.aP(b,o.u_texsize),u_texture:new c.aI(b,o.u_texture),u_translation:new c.aP(b,o.u_translation),u_pitched_scale:new c.aJ(b,o.u_pitched_scale)}),symbolSDF:(b,o)=>({u_is_size_zoom_constant:new c.aI(b,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(b,o.u_is_size_feature_constant),u_size_t:new c.aJ(b,o.u_size_t),u_size:new c.aJ(b,o.u_size),u_camera_to_center_distance:new c.aJ(b,o.u_camera_to_center_distance),u_pitch:new c.aJ(b,o.u_pitch),u_rotate_symbol:new c.aI(b,o.u_rotate_symbol),u_aspect_ratio:new c.aJ(b,o.u_aspect_ratio),u_fade_change:new c.aJ(b,o.u_fade_change),u_matrix:new c.aK(b,o.u_matrix),u_label_plane_matrix:new c.aK(b,o.u_label_plane_matrix),u_coord_matrix:new c.aK(b,o.u_coord_matrix),u_is_text:new c.aI(b,o.u_is_text),u_pitch_with_map:new c.aI(b,o.u_pitch_with_map),u_is_along_line:new c.aI(b,o.u_is_along_line),u_is_variable_anchor:new c.aI(b,o.u_is_variable_anchor),u_texsize:new c.aP(b,o.u_texsize),u_texture:new c.aI(b,o.u_texture),u_gamma_scale:new c.aJ(b,o.u_gamma_scale),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_is_halo:new c.aI(b,o.u_is_halo),u_translation:new c.aP(b,o.u_translation),u_pitched_scale:new c.aJ(b,o.u_pitched_scale)}),symbolTextAndIcon:(b,o)=>({u_is_size_zoom_constant:new c.aI(b,o.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aI(b,o.u_is_size_feature_constant),u_size_t:new c.aJ(b,o.u_size_t),u_size:new c.aJ(b,o.u_size),u_camera_to_center_distance:new c.aJ(b,o.u_camera_to_center_distance),u_pitch:new c.aJ(b,o.u_pitch),u_rotate_symbol:new c.aI(b,o.u_rotate_symbol),u_aspect_ratio:new c.aJ(b,o.u_aspect_ratio),u_fade_change:new c.aJ(b,o.u_fade_change),u_matrix:new c.aK(b,o.u_matrix),u_label_plane_matrix:new c.aK(b,o.u_label_plane_matrix),u_coord_matrix:new c.aK(b,o.u_coord_matrix),u_is_text:new c.aI(b,o.u_is_text),u_pitch_with_map:new c.aI(b,o.u_pitch_with_map),u_is_along_line:new c.aI(b,o.u_is_along_line),u_is_variable_anchor:new c.aI(b,o.u_is_variable_anchor),u_texsize:new c.aP(b,o.u_texsize),u_texsize_icon:new c.aP(b,o.u_texsize_icon),u_texture:new c.aI(b,o.u_texture),u_texture_icon:new c.aI(b,o.u_texture_icon),u_gamma_scale:new c.aJ(b,o.u_gamma_scale),u_device_pixel_ratio:new c.aJ(b,o.u_device_pixel_ratio),u_is_halo:new c.aI(b,o.u_is_halo),u_translation:new c.aP(b,o.u_translation),u_pitched_scale:new c.aJ(b,o.u_pitched_scale)}),background:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_opacity:new c.aJ(b,o.u_opacity),u_color:new c.aM(b,o.u_color)}),backgroundPattern:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_opacity:new c.aJ(b,o.u_opacity),u_image:new c.aI(b,o.u_image),u_pattern_tl_a:new c.aP(b,o.u_pattern_tl_a),u_pattern_br_a:new c.aP(b,o.u_pattern_br_a),u_pattern_tl_b:new c.aP(b,o.u_pattern_tl_b),u_pattern_br_b:new c.aP(b,o.u_pattern_br_b),u_texsize:new c.aP(b,o.u_texsize),u_mix:new c.aJ(b,o.u_mix),u_pattern_size_a:new c.aP(b,o.u_pattern_size_a),u_pattern_size_b:new c.aP(b,o.u_pattern_size_b),u_scale_a:new c.aJ(b,o.u_scale_a),u_scale_b:new c.aJ(b,o.u_scale_b),u_pixel_coord_upper:new c.aP(b,o.u_pixel_coord_upper),u_pixel_coord_lower:new c.aP(b,o.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aJ(b,o.u_tile_units_to_pixels)}),terrain:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_texture:new c.aI(b,o.u_texture),u_ele_delta:new c.aJ(b,o.u_ele_delta),u_fog_matrix:new c.aK(b,o.u_fog_matrix),u_fog_color:new c.aM(b,o.u_fog_color),u_fog_ground_blend:new c.aJ(b,o.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.aJ(b,o.u_fog_ground_blend_opacity),u_horizon_color:new c.aM(b,o.u_horizon_color),u_horizon_fog_blend:new c.aJ(b,o.u_horizon_fog_blend)}),terrainDepth:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_ele_delta:new c.aJ(b,o.u_ele_delta)}),terrainCoords:(b,o)=>({u_matrix:new c.aK(b,o.u_matrix),u_texture:new c.aI(b,o.u_texture),u_terrain_coords_id:new c.aJ(b,o.u_terrain_coords_id),u_ele_delta:new c.aJ(b,o.u_ele_delta)}),sky:(b,o)=>({u_sky_color:new c.aM(b,o.u_sky_color),u_horizon_color:new c.aM(b,o.u_horizon_color),u_horizon:new c.aJ(b,o.u_horizon),u_sky_horizon_blend:new c.aJ(b,o.u_sky_horizon_blend)})};class nf{constructor(o,d,p){this.context=o;const m=o.gl;this.buffer=m.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(o){const d=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),d.bufferSubData(d.ELEMENT_ARRAY_BUFFER,0,o.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const rf={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Qr{constructor(o,d,p,m){this.length=d.length,this.attributes=p,this.itemSize=d.bytesPerElement,this.dynamicDraw=m,this.context=o;const y=o.gl;this.buffer=y.createBuffer(),o.bindVertexBuffer.set(this.buffer),y.bufferData(y.ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(o){if(o.length!==this.length)throw new Error(`Length of new data is ${o.length}, which doesn't match current length of ${this.length}`);const d=this.context.gl;this.bind(),d.bufferSubData(d.ARRAY_BUFFER,0,o.arrayBuffer)}enableAttributes(o,d){for(let p=0;p0){const ke=c.H();c.aR(ke,ne.placementInvProjMatrix,b.transform.glCoordMatrix),c.aR(ke,ke,ne.placementViewportMatrix),M.push({circleArray:Pe,circleOffset:N,transform:_e.posMatrix,invTransform:ke,coord:_e}),k+=Pe.length/4,N=k}we&&I.draw(y,E.LINES,si.disabled,Ji.disabled,b.colorModeForRenderPass(),Li.disabled,{u_matrix:_e.posMatrix,u_pixel_extrude_scale:[1/(B=b.transform).width,1/B.height]},b.style.map.terrain&&b.style.map.terrain.getTerrainData(_e),d.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,null,b.transform.zoom,null,null,we.collisionVertexBuffer)}var B;if(!m||!M.length)return;const W=b.useProgram("collisionCircle"),Z=new c.aS;Z.resize(4*k),Z._trim();let ee=0;for(const ue of M)for(let _e=0;_e=0&&(ue[ne.associatedIconIndex]={shiftedAnchor:zt,angle:Ui})}else Mt(ne.numGlyphs,le)}if(k){oe.clear();const _e=b.icon.placedSymbolArray;for(let ne=0;ne<_e.length;ne++){const we=_e.get(ne);if(we.hidden)Mt(we.numGlyphs,oe);else{const Pe=ue[ne];if(Pe)for(let ke=0;keb.style.map.terrain.getElevation(tt,Xf,Rs):null,yl=d.layout.get("text-rotation-alignment")==="map";Y(Tt,tt.posMatrix,b,m,Na,gl,ue,k,yl,le,tt.toUnwrapped(),ee.width,ee.height,Ba,ss)}const Xs=tt.posMatrix,Fr=m&&et||qf,Vo=_e||Fr?pf:Na,_l=fh,nn=ut&&d.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let rn;rn=ut?Tt.iconsInText?Fb(zt.kind,ni,ne,ue,_e,Fr,b,Xs,Vo,_l,Ba,en,gn,gt):ig(zt.kind,ni,ne,ue,_e,Fr,b,Xs,Vo,_l,Ba,m,en,!0,gt):tg(zt.kind,ni,ne,ue,_e,Fr,b,Xs,Vo,_l,Ba,m,en,gt);const zs={program:Qt,buffers:qt,uniformValues:rn,atlasTexture:Or,atlasTextureIcon:tn,atlasInterpolation:ji,atlasInterpolationIcon:Pn,isSDF:ut,hasHalo:nn};if(Pe&&Tt.canOverlap){ke=!0;const ss=qt.segments.get();for(const yl of ss)pt.push({segments:new c.a0([yl]),sortKey:yl.sortKey,state:zs,terrainData:Vi})}else pt.push({segments:qt.segments,sortKey:0,state:zs,terrainData:Vi})}ke&&pt.sort((tt,rt)=>tt.sortKey-rt.sortKey);for(const tt of pt){const rt=tt.state;if(W.activeTexture.set(Z.TEXTURE0),rt.atlasTexture.bind(rt.atlasInterpolation,Z.CLAMP_TO_EDGE),rt.atlasTextureIcon&&(W.activeTexture.set(Z.TEXTURE1),rt.atlasTextureIcon&&rt.atlasTextureIcon.bind(rt.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),rt.isSDF){const Tt=rt.uniformValues;rt.hasHalo&&(Tt.u_is_halo=1,Pa(rt.buffers,tt.segments,d,b,rt.program,$e,N,B,Tt,tt.terrainData)),Tt.u_is_halo=0}Pa(rt.buffers,tt.segments,d,b,rt.program,$e,N,B,rt.uniformValues,tt.terrainData)}}function Pa(b,o,d,p,m,y,E,I,M,k){const N=p.context;m.draw(N,N.gl.TRIANGLES,y,E,I,Li.disabled,M,k,d.id,b.layoutVertexBuffer,b.indexBuffer,o,d.paint,p.transform.zoom,b.programConfigurations.get(d.id),b.dynamicLayoutVertexBuffer,b.opacityVertexBuffer)}function Kn(b,o,d,p,m){if(!d||!p||!p.imageAtlas)return;const y=p.imageAtlas.patternPositions;let E=y[d.to.toString()],I=y[d.from.toString()];if(!E&&I&&(E=I),!I&&E&&(I=E),!E||!I){const M=m.getPaintProperty(o);E=y[M],I=y[M]}E&&I&&b.setConstantPatternPositions(E,I)}function gf(b,o,d,p,m,y,E){const I=b.context.gl,M="fill-pattern",k=d.paint.get(M),N=k&&k.constantOr(1),B=d.getCrossfadeParameters();let W,Z,ee,le,oe;E?(Z=N&&!d.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",W=I.LINES):(Z=N?"fillPattern":"fill",W=I.TRIANGLES);const ue=k.constantOr(null);for(const _e of p){const ne=o.getTile(_e);if(N&&!ne.patternsLoaded())continue;const we=ne.getBucket(d);if(!we)continue;const Pe=we.programConfigurations.get(d.id),ke=b.useProgram(Z,Pe),$e=b.style.map.terrain&&b.style.map.terrain.getTerrainData(_e);N&&(b.context.activeTexture.set(I.TEXTURE0),ne.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Pe.updatePaintBuffers(B)),Kn(Pe,M,ue,ne,d);const et=$e?_e:null,pt=b.translatePosMatrix(et?et.posMatrix:_e.posMatrix,ne,d.paint.get("fill-translate"),d.paint.get("fill-translate-anchor"));if(E){le=we.indexBuffer2,oe=we.segments2;const gt=[I.drawingBufferWidth,I.drawingBufferHeight];ee=Z==="fillOutlinePattern"&&N?xs(pt,b,B,ne,gt):ii(pt,gt)}else le=we.indexBuffer,oe=we.segments,ee=N?xt(pt,b,B,ne):Ge(pt);ke.draw(b.context,W,m,b.stencilModeForClipping(_e),y,Li.disabled,ee,$e,d.id,we.layoutVertexBuffer,le,oe,d.paint,b.transform.zoom,Pe)}}function Qu(b,o,d,p,m,y,E){const I=b.context,M=I.gl,k="fill-extrusion-pattern",N=d.paint.get(k),B=N.constantOr(1),W=d.getCrossfadeParameters(),Z=d.paint.get("fill-extrusion-opacity"),ee=N.constantOr(null);for(const le of p){const oe=o.getTile(le),ue=oe.getBucket(d);if(!ue)continue;const _e=b.style.map.terrain&&b.style.map.terrain.getTerrainData(le),ne=ue.programConfigurations.get(d.id),we=b.useProgram(B?"fillExtrusionPattern":"fillExtrusion",ne);B&&(b.context.activeTexture.set(M.TEXTURE0),oe.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),ne.updatePaintBuffers(W)),Kn(ne,k,ee,oe,d);const Pe=b.translatePosMatrix(le.posMatrix,oe,d.paint.get("fill-extrusion-translate"),d.paint.get("fill-extrusion-translate-anchor")),ke=d.paint.get("fill-extrusion-vertical-gradient"),$e=B?Ne(Pe,b,ke,Z,le,W,oe):me(Pe,b,ke,Z);we.draw(I,I.gl.TRIANGLES,m,y,E,Li.backCCW,$e,_e,d.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,d.paint,b.transform.zoom,ne,b.style.map.terrain&&ue.centroidVertexBuffer)}}function _f(b,o,d,p,m,y,E){const I=b.context,M=I.gl,k=d.fbo;if(!k)return;const N=b.useProgram("hillshade"),B=b.style.map.terrain&&b.style.map.terrain.getTerrainData(o);I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,k.colorAttachment.get()),N.draw(I,M.TRIANGLES,m,y,E,Li.disabled,((W,Z,ee,le)=>{const oe=ee.paint.get("hillshade-shadow-color"),ue=ee.paint.get("hillshade-highlight-color"),_e=ee.paint.get("hillshade-accent-color");let ne=ee.paint.get("hillshade-illumination-direction")*(Math.PI/180);ee.paint.get("hillshade-illumination-anchor")==="viewport"&&(ne-=W.transform.angle);const we=!W.options.moving;return{u_matrix:le?le.posMatrix:W.transform.calculatePosMatrix(Z.tileID.toUnwrapped(),we),u_image:0,u_latrange:Zn(0,Z.tileID),u_light:[ee.paint.get("hillshade-exaggeration"),ne],u_shadow:oe,u_highlight:ue,u_accent:_e}})(b,d,p,B?o:null),B,p.id,b.rasterBoundsBuffer,b.quadTriangleIndexBuffer,b.rasterBoundsSegments)}function Ra(b,o,d,p,m,y){const E=b.context,I=E.gl,M=o.dem;if(M&&M.data){const k=M.dim,N=M.stride,B=M.getPixels();if(E.activeTexture.set(I.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||b.getTileTexture(N),o.demTexture){const Z=o.demTexture;Z.update(B,{premultiply:!1}),Z.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else o.demTexture=new He(E,B,I.RGBA,{premultiply:!1}),o.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);E.activeTexture.set(I.TEXTURE0);let W=o.fbo;if(!W){const Z=new He(E,{width:k,height:k,data:null},I.RGBA);Z.bind(I.LINEAR,I.CLAMP_TO_EDGE),W=o.fbo=E.createFramebuffer(k,k,!0,!1),W.colorAttachment.set(Z.texture)}E.bindFramebuffer.set(W.framebuffer),E.viewport.set([0,0,k,k]),b.useProgram("hillshadePrepare").draw(E,I.TRIANGLES,p,m,y,Li.disabled,((Z,ee)=>{const le=ee.stride,oe=c.H();return c.aQ(oe,0,c.X,-c.X,0,0,1),c.J(oe,oe,[0,-c.X,0]),{u_matrix:oe,u_image:1,u_dimension:[le,le],u_zoom:Z.overscaledZ,u_unpack:ee.getUnpackVector()}})(o.tileID,M),null,d.id,b.rasterBoundsBuffer,b.quadTriangleIndexBuffer,b.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function eh(b,o,d,p,m,y){const E=p.paint.get("raster-fade-duration");if(!y&&E>0){const I=C.now(),M=(I-b.timeAdded)/E,k=o?(I-o.timeAdded)/E:-1,N=d.getSource(),B=m.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),W=!o||Math.abs(o.tileID.overscaledZ-B)>Math.abs(b.tileID.overscaledZ-B),Z=W&&b.refreshedUponExpiration?1:c.ad(W?M:1-k,0,1);return b.refreshedUponExpiration&&M>=1&&(b.refreshedUponExpiration=!1),o?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const th=new c.aN(1,0,0,1),Rc=new c.aN(0,1,0,1),ih=new c.aN(0,0,1,1),_g=new c.aN(1,0,1,1),ll=new c.aN(0,1,1,1);function Ma(b,o,d,p){cl(b,0,o+d/2,b.transform.width,d,p)}function yf(b,o,d,p){cl(b,o-d/2,0,d,b.transform.height,p)}function cl(b,o,d,p,m,y){const E=b.context,I=E.gl;I.enable(I.SCISSOR_TEST),I.scissor(o*b.pixelRatio,d*b.pixelRatio,p*b.pixelRatio,m*b.pixelRatio),E.clear({color:y}),I.disable(I.SCISSOR_TEST)}function di(b,o,d){const p=b.context,m=p.gl,y=d.posMatrix,E=b.useProgram("debug"),I=si.disabled,M=Ji.disabled,k=b.colorModeForRenderPass(),N="$debug",B=b.style.map.terrain&&b.style.map.terrain.getTerrainData(d);p.activeTexture.set(m.TEXTURE0);const W=o.getTileByID(d.key).latestRawTileData,Z=Math.floor((W&&W.byteLength||0)/1024),ee=o.getTile(d).tileSize,le=512/Math.min(ee,512)*(d.overscaledZ/b.transform.zoom)*.5;let oe=d.canonical.toString();d.overscaledZ!==d.canonical.z&&(oe+=` => ${d.overscaledZ}`),function(ue,_e){ue.initDebugOverlayCanvas();const ne=ue.debugOverlayCanvas,we=ue.context.gl,Pe=ue.debugOverlayCanvas.getContext("2d");Pe.clearRect(0,0,ne.width,ne.height),Pe.shadowColor="white",Pe.shadowBlur=2,Pe.lineWidth=1.5,Pe.strokeStyle="white",Pe.textBaseline="top",Pe.font="bold 36px Open Sans, sans-serif",Pe.fillText(_e,5,5),Pe.strokeText(_e,5,5),ue.debugOverlayTexture.update(ne),ue.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}(b,`${oe} ${Z}kB`),E.draw(p,m.TRIANGLES,I,M,ki.alphaBlended,Li.disabled,Ps(y,c.aN.transparent,le),null,N,b.debugBuffer,b.quadTriangleIndexBuffer,b.debugSegments),E.draw(p,m.LINE_STRIP,I,M,k,Li.disabled,Ps(y,c.aN.red),B,N,b.debugBuffer,b.tileBorderIndexBuffer,b.debugSegments)}function Mc(b,o,d){const p=b.context,m=p.gl,y=b.colorModeForRenderPass(),E=new si(m.LEQUAL,si.ReadWrite,b.depthRangeFor3D),I=b.useProgram("terrain"),M=o.getTerrainMesh();p.bindFramebuffer.set(null),p.viewport.set([0,0,b.width,b.height]);for(const k of d){const N=b.renderToTexture.getTexture(k),B=o.getTerrainData(k.tileID);p.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,N.texture);const W=b.transform.calculatePosMatrix(k.tileID.toUnwrapped()),Z=o.getMeshFrameDelta(b.transform.zoom),ee=b.transform.calculateFogMatrix(k.tileID.toUnwrapped()),le=Tc(W,Z,ee,b.style.sky,b.transform.pitch);I.draw(p,m.TRIANGLES,E,Ji.disabled,y,Li.backCCW,le,B,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}}class yg{constructor(o,d,p){this.vertexBuffer=o,this.indexBuffer=d,this.segments=p}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class bg{constructor(o,d){this.context=new df(o),this.transform=d,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ot.maxUnderzooming+Ot.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Qs}resize(o,d,p){if(this.width=Math.floor(o*p),this.height=Math.floor(d*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style._order)this.style._layers[m].resize()}setup(){const o=this.context,d=new c.aX;d.emplaceBack(0,0),d.emplaceBack(c.X,0),d.emplaceBack(0,c.X),d.emplaceBack(c.X,c.X),this.tileExtentBuffer=o.createVertexBuffer(d,Sa.members),this.tileExtentSegments=c.a0.simpleSegment(0,0,4,2);const p=new c.aX;p.emplaceBack(0,0),p.emplaceBack(c.X,0),p.emplaceBack(0,c.X),p.emplaceBack(c.X,c.X),this.debugBuffer=o.createVertexBuffer(p,Sa.members),this.debugSegments=c.a0.simpleSegment(0,0,4,5);const m=new c.$;m.emplaceBack(0,0,0,0),m.emplaceBack(c.X,0,c.X,0),m.emplaceBack(0,c.X,0,c.X),m.emplaceBack(c.X,c.X,c.X,c.X),this.rasterBoundsBuffer=o.createVertexBuffer(m,Ye.members),this.rasterBoundsSegments=c.a0.simpleSegment(0,0,4,2);const y=new c.aX;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(y,Sa.members),this.viewportSegments=c.a0.simpleSegment(0,0,4,2);const E=new c.aZ;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=o.createIndexBuffer(E);const I=new c.aY;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(I);const M=this.context.gl;this.stencilClearMode=new Ji({func:M.ALWAYS,mask:0},0,255,M.ZERO,M.ZERO,M.ZERO)}clearStencil(){const o=this.context,d=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=c.H();c.aQ(p,0,this.width,this.height,0,0,1),c.K(p,p,[d.drawingBufferWidth,d.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(o,d.TRIANGLES,si.disabled,this.stencilClearMode,ki.disabled,Li.disabled,Sc(p),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(o,d){if(this.currentStencilSource===o.source||!o.isTileClipped()||!d||!d.length)return;this.currentStencilSource=o.source;const p=this.context,m=p.gl;this.nextStencilID+d.length>256&&this.clearStencil(),p.setColorMode(ki.disabled),p.setDepthMode(si.disabled);const y=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of d){const I=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,M=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);y.draw(p,m.TRIANGLES,si.disabled,new Ji({func:m.ALWAYS,mask:0},I,255,m.KEEP,m.KEEP,m.REPLACE),ki.disabled,Li.disabled,Sc(E.posMatrix),M,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,d=this.context.gl;return new Ji({func:d.NOTEQUAL,mask:255},o,255,d.KEEP,d.KEEP,d.REPLACE)}stencilModeForClipping(o){const d=this.context.gl;return new Ji({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,d.KEEP,d.KEEP,d.REPLACE)}stencilConfigForOverlap(o){const d=this.context.gl,p=o.sort((E,I)=>I.overscaledZ-E.overscaledZ),m=p[p.length-1].overscaledZ,y=p[0].overscaledZ-m+1;if(y>1){this.currentStencilSource=void 0,this.nextStencilID+y>256&&this.clearStencil();const E={};for(let I=0;I({u_sky_color:_e.properties.get("sky-color"),u_horizon_color:_e.properties.get("horizon-color"),u_horizon:(ne.height/2+ne.getHorizon())*we,u_sky_horizon_blend:_e.properties.get("sky-horizon-blend")*ne.height/2*we}))(N,k.style.map.transform,k.pixelRatio),ee=new si(W.LEQUAL,si.ReadWrite,[0,1]),le=Ji.disabled,oe=k.colorModeForRenderPass(),ue=k.useProgram("sky");if(!N.mesh){const _e=new c.aX;_e.emplaceBack(-1,-1),_e.emplaceBack(1,-1),_e.emplaceBack(1,1),_e.emplaceBack(-1,1);const ne=new c.aY;ne.emplaceBack(0,1,2),ne.emplaceBack(0,2,3),N.mesh=new yg(B.createVertexBuffer(_e,Sa.members),B.createIndexBuffer(ne),c.a0.simpleSegment(0,0,_e.length,ne.length))}ue.draw(B,W.TRIANGLES,ee,le,oe,Li.disabled,Z,void 0,"sky",N.mesh.vertexBuffer,N.mesh.indexBuffer,N.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=d.showOverdrawInspector,this.depthRangeFor3D=[0,1-(o._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=m.length-1;this.currentLayer>=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],N=y[k.source],B=E[k.source];this._renderTileClippingMasks(k,B),this.renderLayer(this,N,k,B)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerue.source&&!ue.isHidden(B)?[N.sourceCaches[ue.source]]:[]),ee=Z.filter(ue=>ue.getSource().type==="vector"),le=Z.filter(ue=>ue.getSource().type!=="vector"),oe=ue=>{(!W||W.getSource().maxzoomoe(ue)),W||le.forEach(ue=>oe(ue)),W}(this.style,this.transform.zoom);k&&function(N,B,W){for(let Z=0;Z0),m&&(c.b0(d,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(y,E){const I=y.context,M=I.gl,k=ki.unblended,N=new si(M.LEQUAL,si.ReadWrite,[0,1]),B=E.getTerrainMesh(),W=E.sourceCache.getRenderableTiles(),Z=y.useProgram("terrainDepth");I.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1});for(const ee of W){const le=E.getTerrainData(ee.tileID),oe={u_matrix:y.transform.calculatePosMatrix(ee.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};Z.draw(I,M.TRIANGLES,N,Ji.disabled,k,Li.backCCW,oe,le,"terrain",B.vertexBuffer,B.indexBuffer,B.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain),function(y,E){const I=y.context,M=I.gl,k=ki.unblended,N=new si(M.LEQUAL,si.ReadWrite,[0,1]),B=E.getTerrainMesh(),W=E.getCoordsTexture(),Z=E.sourceCache.getRenderableTiles(),ee=y.useProgram("terrainCoords");I.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),I.clear({color:c.aN.transparent,depth:1}),E.coordsIndex=[];for(const le of Z){const oe=E.getTerrainData(le.tileID);I.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,W.texture);const ue={u_matrix:y.transform.calculatePosMatrix(le.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};ee.draw(I,M.TRIANGLES,N,Ji.disabled,k,Li.backCCW,ue,oe,"terrain",B.vertexBuffer,B.indexBuffer,B.segments),E.coordsIndex.push(le.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain))}renderLayer(o,d,p,m){if(!p.isHidden(this.transform.zoom)&&(p.type==="background"||p.type==="custom"||(m||[]).length))switch(this.id=p.id,p.type){case"symbol":(function(y,E,I,M,k){if(y.renderPass!=="translucent")return;const N=Ji.disabled,B=y.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(W,Z,ee,le,oe,ue,_e,ne,we){const Pe=Z.transform,ke=Ta(),$e=oe==="map",et=ue==="map";for(const pt of W){const gt=le.getTile(pt),tt=gt.getBucket(ee);if(!tt||!tt.text||!tt.text.segments.get().length)continue;const rt=c.ah(tt.textSizeData,Pe.zoom),Tt=Ht(gt,1,Z.transform.zoom),qt=Pr(pt.posMatrix,et,$e,Z.transform,Tt),at=ee.layout.get("icon-text-fit")!=="none"&&tt.hasIconData();if(rt){const ut=Math.pow(2,Pe.zoom-gt.tileID.overscaledZ),zt=Z.style.map.terrain?(Qt,ni)=>Z.style.map.terrain.getElevation(pt,Qt,ni):null,Ui=ke.translatePosition(Pe,gt,_e,ne);Gu(tt,$e,et,we,Pe,qt,pt.posMatrix,ut,rt,at,ke,Ui,pt.toUnwrapped(),zt)}}}(M,y,I,E,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),k),I.paint.get("icon-opacity").constantOr(1)!==0&&Lo(y,E,I,M,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),N,B),I.paint.get("text-opacity").constantOr(1)!==0&&Lo(y,E,I,M,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),N,B),E.map.showCollisionBoxes&&(gg(y,E,I,M,!0),gg(y,E,I,M,!1))})(o,d,p,m,this.style.placement.variableOffsets);break;case"circle":(function(y,E,I,M){if(y.renderPass!=="translucent")return;const k=I.paint.get("circle-opacity"),N=I.paint.get("circle-stroke-width"),B=I.paint.get("circle-stroke-opacity"),W=!I.layout.get("circle-sort-key").isConstant();if(k.constantOr(1)===0&&(N.constantOr(1)===0||B.constantOr(1)===0))return;const Z=y.context,ee=Z.gl,le=y.depthModeForSublayer(0,si.ReadOnly),oe=Ji.disabled,ue=y.colorModeForRenderPass(),_e=[];for(let ne=0;nene.sortKey-we.sortKey);for(const ne of _e){const{programConfiguration:we,program:Pe,layoutVertexBuffer:ke,indexBuffer:$e,uniformValues:et,terrainData:pt}=ne.state;Pe.draw(Z,ee.TRIANGLES,le,oe,ue,Li.disabled,et,pt,I.id,ke,$e,ne.segments,I.paint,y.transform.zoom,we)}})(o,d,p,m);break;case"heatmap":(function(y,E,I,M){if(I.paint.get("heatmap-opacity")!==0)if(y.renderPass==="offscreen"){const k=y.context,N=k.gl,B=Ji.disabled,W=new ki([N.ONE,N.ONE],c.aN.transparent,[!0,!0,!0,!0]);(function(Z,ee,le){const oe=Z.gl;Z.activeTexture.set(oe.TEXTURE1),Z.viewport.set([0,0,ee.width/4,ee.height/4]);let ue=le.heatmapFbo;if(ue)oe.bindTexture(oe.TEXTURE_2D,ue.colorAttachment.get()),Z.bindFramebuffer.set(ue.framebuffer);else{const _e=oe.createTexture();oe.bindTexture(oe.TEXTURE_2D,_e),oe.texParameteri(oe.TEXTURE_2D,oe.TEXTURE_WRAP_S,oe.CLAMP_TO_EDGE),oe.texParameteri(oe.TEXTURE_2D,oe.TEXTURE_WRAP_T,oe.CLAMP_TO_EDGE),oe.texParameteri(oe.TEXTURE_2D,oe.TEXTURE_MIN_FILTER,oe.LINEAR),oe.texParameteri(oe.TEXTURE_2D,oe.TEXTURE_MAG_FILTER,oe.LINEAR),ue=le.heatmapFbo=Z.createFramebuffer(ee.width/4,ee.height/4,!1,!1),function(ne,we,Pe,ke){var $e,et;const pt=ne.gl,gt=($e=ne.HALF_FLOAT)!==null&&$e!==void 0?$e:pt.UNSIGNED_BYTE,tt=(et=ne.RGBA16F)!==null&&et!==void 0?et:pt.RGBA;pt.texImage2D(pt.TEXTURE_2D,0,tt,we.width/4,we.height/4,0,pt.RGBA,gt,null),ke.colorAttachment.set(Pe)}(Z,ee,_e,ue)}})(k,y,I),k.clear({color:c.aN.transparent});for(let Z=0;Z{const ne=c.H();c.aQ(ne,0,le.width,le.height,0,0,1);const we=le.context.gl;return{u_matrix:ne,u_world:[we.drawingBufferWidth,we.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:oe.paint.get("heatmap-opacity")}})(k,N),null,N.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,N.paint,k.transform.zoom)}(y,I))})(o,d,p,m);break;case"line":(function(y,E,I,M){if(y.renderPass!=="translucent")return;const k=I.paint.get("line-opacity"),N=I.paint.get("line-width");if(k.constantOr(1)===0||N.constantOr(1)===0)return;const B=y.depthModeForSublayer(0,si.ReadOnly),W=y.colorModeForRenderPass(),Z=I.paint.get("line-dasharray"),ee=I.paint.get("line-pattern"),le=ee.constantOr(1),oe=I.paint.get("line-gradient"),ue=I.getCrossfadeParameters(),_e=le?"linePattern":Z?"lineSDF":oe?"lineGradient":"line",ne=y.context,we=ne.gl;let Pe=!0;for(const ke of M){const $e=E.getTile(ke);if(le&&!$e.patternsLoaded())continue;const et=$e.getBucket(I);if(!et)continue;const pt=et.programConfigurations.get(I.id),gt=y.context.program.get(),tt=y.useProgram(_e,pt),rt=Pe||tt.program!==gt,Tt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(ke),qt=ee.constantOr(null);if(qt&&$e.imageAtlas){const zt=$e.imageAtlas,Ui=zt.patternPositions[qt.to.toString()],Qt=zt.patternPositions[qt.from.toString()];Ui&&Qt&&pt.setConstantPatternPositions(Ui,Qt)}const at=Tt?ke:null,ut=le?Gm(y,$e,I,ue,at):Z?Qm(y,$e,I,Z,ue,at):oe?Wu(y,$e,I,et.lineClipsArray.length,at):Ec(y,$e,I,at);if(le)ne.activeTexture.set(we.TEXTURE0),$e.imageAtlasTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE),pt.updatePaintBuffers(ue);else if(Z&&(rt||y.lineAtlas.dirty))ne.activeTexture.set(we.TEXTURE0),y.lineAtlas.bind(ne);else if(oe){const zt=et.gradients[I.id];let Ui=zt.texture;if(I.gradientVersion!==zt.version){let Qt=256;if(I.stepInterpolant){const ni=E.getSource().maxzoom,Vi=ke.canonical.z===ni?Math.ceil(1<20&&N.texParameterf(N.TEXTURE_2D,k.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,k.extTextureFilterAnisotropicMax);const tt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(_e),rt=tt?_e:null,Tt=rt?rt.posMatrix:y.transform.calculatePosMatrix(_e.toUnwrapped(),ue),qt=Ob(Tt,pt||[0,0],et||1,$e,I);B instanceof _t?W.draw(k,N.TRIANGLES,ne,Ji.disabled,Z,Li.disabled,qt,tt,I.id,B.boundsBuffer,y.quadTriangleIndexBuffer,B.boundsSegments):W.draw(k,N.TRIANGLES,ne,ee[_e.overscaledZ],Z,Li.disabled,qt,tt,I.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments)}})(o,d,p,m);break;case"background":(function(y,E,I,M){const k=I.paint.get("background-color"),N=I.paint.get("background-opacity");if(N===0)return;const B=y.context,W=B.gl,Z=y.transform,ee=Z.tileSize,le=I.paint.get("background-pattern");if(y.isPatternMissing(le))return;const oe=!le&&k.a===1&&N===1&&y.opaquePassEnabledForLayer()?"opaque":"translucent";if(y.renderPass!==oe)return;const ue=Ji.disabled,_e=y.depthModeForSublayer(0,oe==="opaque"?si.ReadWrite:si.ReadOnly),ne=y.colorModeForRenderPass(),we=y.useProgram(le?"backgroundPattern":"background"),Pe=M||Z.coveringTiles({tileSize:ee,terrain:y.style.map.terrain});le&&(B.activeTexture.set(W.TEXTURE0),y.imageManager.bind(y.context));const ke=I.getCrossfadeParameters();for(const $e of Pe){const et=M?$e.posMatrix:y.transform.calculatePosMatrix($e.toUnwrapped()),pt=le?sf(et,N,y,le,{tileID:$e,tileSize:ee},ke):Hu(et,N,k),gt=y.style.map.terrain&&y.style.map.terrain.getTerrainData($e);we.draw(B,W.TRIANGLES,_e,ue,ne,Li.disabled,pt,gt,I.id,y.tileExtentBuffer,y.quadTriangleIndexBuffer,y.tileExtentSegments)}})(o,0,p,m);break;case"custom":(function(y,E,I){const M=y.context,k=I.implementation;if(y.renderPass==="offscreen"){const N=k.prerender;N&&(y.setCustomLayerDefaults(),M.setColorMode(y.colorModeForRenderPass()),N.call(k,M.gl,y.transform.customLayerMatrix()),M.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),M.setColorMode(y.colorModeForRenderPass()),M.setStencilMode(Ji.disabled);const N=k.renderingMode==="3d"?new si(y.context.gl.LEQUAL,si.ReadWrite,y.depthRangeFor3D):y.depthModeForSublayer(0,si.ReadOnly);M.setDepthMode(N),k.render(M.gl,y.transform.customLayerMatrix(),{farZ:y.transform.farZ,nearZ:y.transform.nearZ,fov:y.transform._fov,modelViewProjectionMatrix:y.transform.modelViewProjectionMatrix,projectionMatrix:y.transform.projectionMatrix}),M.setDirty(),y.setBaseState(),M.bindFramebuffer.set(null)}})(o,0,p)}}translatePosMatrix(o,d,p,m,y){if(!p[0]&&!p[1])return o;const E=y?m==="map"?this.transform.angle:0:m==="viewport"?-this.transform.angle:0;if(E){const k=Math.sin(E),N=Math.cos(E);p=[p[0]*N-p[1]*k,p[0]*k+p[1]*N]}const I=[y?p[0]:Ht(d,p[0],this.transform.zoom),y?p[1]:Ht(d,p[1],this.transform.zoom),0],M=new Float32Array(16);return c.J(M,o,I),M}saveTileTexture(o){const d=this._tileTextures[o.size[0]];d?d.push(o):this._tileTextures[o.size[0]]=[o]}getTileTexture(o){const d=this._tileTextures[o];return d&&d.length>0?d.pop():null}isPatternMissing(o){if(!o)return!1;if(!o.from||!o.to)return!0;const d=this.imageManager.getPattern(o.from.toString()),p=this.imageManager.getPattern(o.to.toString());return!d||!p}useProgram(o,d){this.cache=this.cache||{};const p=o+(d?d.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[p]||(this.cache[p]=new X(this.context,Rr[o],d,qu[o],this._showOverdrawInspector,this.style.map.terrain)),this.cache[p]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new He(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:o,drawingBufferHeight:d}=this.context.gl;return this.width!==o||this.height!==d}}class ka{constructor(o,d){this.points=o,this.planes=d}static fromInvProjectionMatrix(o,d,p){const m=Math.pow(2,p),y=[[-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(I=>{const M=1/(I=c.ag([],I,o))[3]/d*m;return c.b1(I,I,[M,M,1/I[3],M])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const M=function(W,Z){var ee=Z[0],le=Z[1],oe=Z[2],ue=ee*ee+le*le+oe*oe;return ue>0&&(ue=1/Math.sqrt(ue)),W[0]=Z[0]*ue,W[1]=Z[1]*ue,W[2]=Z[2]*ue,W}([],function(W,Z,ee){var le=Z[0],oe=Z[1],ue=Z[2],_e=ee[0],ne=ee[1],we=ee[2];return W[0]=oe*we-ue*ne,W[1]=ue*_e-le*we,W[2]=le*ne-oe*_e,W}([],De([],y[I[0]],y[I[1]]),De([],y[I[2]],y[I[1]]))),k=-((N=M)[0]*(B=y[I[1]])[0]+N[1]*B[1]+N[2]*B[2]);var N,B;return M.concat(k)});return new ka(y,E)}}class sh{constructor(o,d){this.min=o,this.max=d,this.center=function(p,m,y){return p[0]=.5*m[0],p[1]=.5*m[1],p[2]=.5*m[2],p}([],function(p,m,y){return p[0]=m[0]+y[0],p[1]=m[1]+y[1],p[2]=m[2]+y[2],p}([],this.min,this.max))}quadrant(o){const d=[o%2==0,o<2],p=Se(this.min),m=Se(this.max);for(let y=0;y=0&&E++;if(E===0)return 0;E!==d.length&&(p=!1)}if(p)return 2;for(let m=0;m<3;m++){let y=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let I=0;Ithis.max[m]-this.min[m])return 0}return 1}}class nh{constructor(o=0,d=0,p=0,m=0){if(isNaN(o)||o<0||isNaN(d)||d<0||isNaN(p)||p<0||isNaN(m)||m<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=d,this.left=p,this.right=m}interpolate(o,d,p){return d.top!=null&&o.top!=null&&(this.top=c.z.number(o.top,d.top,p)),d.bottom!=null&&o.bottom!=null&&(this.bottom=c.z.number(o.bottom,d.bottom,p)),d.left!=null&&o.left!=null&&(this.left=c.z.number(o.left,d.left,p)),d.right!=null&&o.right!=null&&(this.right=c.z.number(o.right,d.right,p)),this}getCenter(o,d){const p=c.ad((this.left+o-this.right)/2,0,o),m=c.ad((this.top+d-this.bottom)/2,0,d);return new c.P(p,m)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new nh(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const bf=85.051129;class vf{constructor(o,d,p,m,y){this.tileSize=512,this._renderWorldCopies=y===void 0||!!y,this._minZoom=o||0,this._maxZoom=d||22,this._minPitch=p??0,this._maxPitch=m??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new nh,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const o=new vf(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return o.apply(this),o}apply(o){this.tileSize=o.tileSize,this.latRange=o.latRange,this.width=o.width,this.height=o.height,this._center=o._center,this._elevation=o._elevation,this.minElevationForCurrentTile=o.minElevationForCurrentTile,this.zoom=o.zoom,this.angle=o.angle,this._fov=o._fov,this._pitch=o._pitch,this._unmodified=o._unmodified,this._edgeInsets=o._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(o){const d=-c.b3(o,-180,180)*Math.PI/180;this.angle!==d&&(this._unmodified=!1,this.angle=d,this._calcMatrices(),this.rotationMatrix=function(){var p=new c.A(4);return c.A!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}(),function(p,m,y){var E=m[0],I=m[1],M=m[2],k=m[3],N=Math.sin(y),B=Math.cos(y);p[0]=E*B+M*N,p[1]=I*B+k*N,p[2]=E*-N+M*B,p[3]=I*-N+k*B}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const d=c.ad(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=o/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(o){const d=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._zoom=d,this.tileZoom=Math.max(0,Math.floor(d)),this.scale=this.zoomScale(d),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(o){o.lat===this._center.lat&&o.lng===this._center.lng||(this._unmodified=!1,this._center=o,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(o){o!==this._elevation&&(this._elevation=o,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(o){this._edgeInsets.equals(o)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,o,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(o){return this._edgeInsets.equals(o)}interpolatePadding(o,d,p){this._unmodified=!1,this._edgeInsets.interpolate(o,d,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(o){const d=(o.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/o.tileSize));return Math.max(0,d)}getVisibleUnwrappedCoordinates(o){const d=[new c.b4(0,o)];if(this._renderWorldCopies){const p=this.pointCoordinate(new c.P(0,0)),m=this.pointCoordinate(new c.P(this.width,0)),y=this.pointCoordinate(new c.P(this.width,this.height)),E=this.pointCoordinate(new c.P(0,this.height)),I=Math.floor(Math.min(p.x,m.x,y.x,E.x)),M=Math.floor(Math.max(p.x,m.x,y.x,E.x)),k=1;for(let N=I-k;N<=M+k;N++)N!==0&&d.push(new c.b4(N,o))}return d}coveringTiles(o){var d,p;let m=this.coveringZoomLevel(o);const y=m;if(o.minzoom!==void 0&&mo.maxzoom&&(m=o.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),I=c.Z.fromLngLat(this.center),M=Math.pow(2,m),k=[M*E.x,M*E.y,0],N=[M*I.x,M*I.y,0],B=ka.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,m);let W=o.minzoom||0;!o.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(W=m);const Z=o.terrain?2/Math.min(this.tileSize,o.tileSize)*this.tileSize:3,ee=ne=>({aabb:new sh([ne*M,0,0],[(ne+1)*M,M,0]),zoom:0,x:0,y:0,wrap:ne,fullyVisible:!1}),le=[],oe=[],ue=m,_e=o.reparseOverscaled?y:m;if(this._renderWorldCopies)for(let ne=1;ne<=3;ne++)le.push(ee(-ne)),le.push(ee(ne));for(le.push(ee(0));le.length>0;){const ne=le.pop(),we=ne.x,Pe=ne.y;let ke=ne.fullyVisible;if(!ke){const tt=ne.aabb.intersects(B);if(tt===0)continue;ke=tt===2}const $e=o.terrain?k:N,et=ne.aabb.distanceX($e),pt=ne.aabb.distanceY($e),gt=Math.max(Math.abs(et),Math.abs(pt));if(ne.zoom===ue||gt>Z+(1<=W){const tt=ue-ne.zoom,rt=k[0]-.5-(we<>1),qt=ne.zoom+1;let at=ne.aabb.quadrant(tt);if(o.terrain){const ut=new c.S(qt,ne.wrap,qt,rt,Tt),zt=o.terrain.getMinMaxElevation(ut),Ui=(d=zt.minElevation)!==null&&d!==void 0?d:this.elevation,Qt=(p=zt.maxElevation)!==null&&p!==void 0?p:this.elevation;at=new sh([at.min[0],at.min[1],Ui],[at.max[0],at.max[1],Qt])}le.push({aabb:at,zoom:qt,x:rt,y:Tt,wrap:ne.wrap,fullyVisible:ke})}}return oe.sort((ne,we)=>ne.distanceSq-we.distanceSq).map(ne=>ne.tileID)}resize(o,d){this.width=o,this.height=d,this.pixelsToGLUnits=[2/o,-2/d],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const d=c.ad(o.lat,-85.051129,bf);return new c.P(c.O(o.lng)*this.worldSize,c.Q(d)*this.worldSize)}unproject(o){return new c.Z(o.x/this.worldSize,o.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(o){const d=this.elevation,p=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,m=this.pointLocation(this.centerPoint,o),y=o.getElevationForLngLatZoom(m,this.tileZoom);if(!(this.elevation-y))return;const E=p+d-y,I=Math.cos(this._pitch)*this.cameraToCenterDistance/E/c.b5(1,m.lat),M=this.scaleZoom(I/this.tileSize);this._elevation=y,this._center=m,this.zoom=M}setLocationAtPoint(o,d){const p=this.pointCoordinate(d),m=this.pointCoordinate(this.centerPoint),y=this.locationCoordinate(o),E=new c.Z(y.x-(p.x-m.x),y.y-(p.y-m.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(o,d){return d?this.coordinatePoint(this.locationCoordinate(o),d.getElevationForLngLatZoom(o,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(o))}pointLocation(o,d){return this.coordinateLocation(this.pointCoordinate(o,d))}locationCoordinate(o){return c.Z.fromLngLat(o)}coordinateLocation(o){return o&&o.toLngLat()}pointCoordinate(o,d){if(d){const W=d.pointCoordinate(o);if(W!=null)return W}const p=[o.x,o.y,0,1],m=[o.x,o.y,1,1];c.ag(p,p,this.pixelMatrixInverse),c.ag(m,m,this.pixelMatrixInverse);const y=p[3],E=m[3],I=p[1]/y,M=m[1]/E,k=p[2]/y,N=m[2]/E,B=k===N?0:(0-k)/(N-k);return new c.Z(c.z.number(p[0]/y,m[0]/E,B)/this.worldSize,c.z.number(I,M,B)/this.worldSize)}coordinatePoint(o,d=0,p=this.pixelMatrix){const m=[o.x*this.worldSize,o.y*this.worldSize,d,1];return c.ag(m,m,p),new c.P(m[0]/m[3],m[1]/m[3])}getBounds(){const o=Math.max(0,this.height/2-this.getHorizon());return new he().extend(this.pointLocation(new c.P(0,o))).extend(this.pointLocation(new c.P(this.width,o))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new he([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(o){o?(this.lngRange=[o.getWest(),o.getEast()],this.latRange=[o.getSouth(),o.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,bf])}calculateTileMatrix(o){const d=o.canonical,p=this.worldSize/this.zoomScale(d.z),m=d.x+Math.pow(2,d.z)*o.wrap,y=c.ao(new Float64Array(16));return c.J(y,y,[m*p,d.y*p,0]),c.K(y,y,[p/c.X,p/c.X,1]),y}calculatePosMatrix(o,d=!1){const p=o.key,m=d?this._alignedPosMatrixCache:this._posMatrixCache;if(m[p])return m[p];const y=this.calculateTileMatrix(o);return c.L(y,d?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,y),m[p]=new Float32Array(y),m[p]}calculateFogMatrix(o){const d=o.key,p=this._fogMatrixCache;if(p[d])return p[d];const m=this.calculateTileMatrix(o);return c.L(m,this.fogMatrix,m),p[d]=new Float32Array(m),p[d]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(o,d){d=c.ad(+d,this.minZoom,this.maxZoom);const p={center:new c.N(o.lng,o.lat),zoom:d};let m=this.lngRange;if(!this._renderWorldCopies&&m===null){const ne=179.9999999999;m=[-ne,ne]}const y=this.tileSize*this.zoomScale(p.zoom);let E=0,I=y,M=0,k=y,N=0,B=0;const{x:W,y:Z}=this.size;if(this.latRange){const ne=this.latRange;E=c.Q(ne[1])*y,I=c.Q(ne[0])*y,I-EI&&(ue=I-ne)}if(m){const ne=(M+k)/2;let we=ee;this._renderWorldCopies&&(we=c.b3(ee,ne-y/2,ne+y/2));const Pe=W/2;we-Pek&&(oe=k-Pe)}if(oe!==void 0||ue!==void 0){const ne=new c.P(oe??ee,ue??le);p.center=this.unproject.call({worldSize:y},ne).wrap()}return p}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const o=this._unmodified,{center:d,zoom:p}=this.getConstrained(this.center,this.zoom);this.center=d,this.zoom=p,this._unmodified=o,this._constraining=!1}_calcMatrices(){if(!this.height)return;const o=this.centerOffset,d=this.point.x,p=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b5(1,this.center.lat)*this.worldSize;let m=c.ao(new Float64Array(16));c.K(m,m,[this.width/2,-this.height/2,1]),c.J(m,m,[1,-1,0]),this.labelPlaneMatrix=m,m=c.ao(new Float64Array(16)),c.K(m,m,[1,-1,1]),c.J(m,m,[-1,-1,0]),c.K(m,m,[2/this.width,2/this.height,1]),this.glCoordMatrix=m;const y=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),I=y-E*this._pixelPerMeter/Math.cos(this._pitch),M=E<0?I:y,k=Math.PI/2+this._pitch,N=this._fov*(.5+o.y/this.height),B=Math.sin(N)*M/Math.sin(c.ad(Math.PI-k-N,.01,Math.PI-.01)),W=this.getHorizon(),Z=2*Math.atan(W/this.cameraToCenterDistance)*(.5+o.y/(2*W)),ee=Math.sin(Z)*M/Math.sin(c.ad(Math.PI-k-Z,.01,Math.PI-.01)),le=Math.min(B,ee);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*le+M),this.nearZ=this.height/50,m=new Float64Array(16),c.b6(m,this._fov,this.width/this.height,this.nearZ,this.farZ),m[8]=2*-o.x/this.width,m[9]=2*o.y/this.height,this.projectionMatrix=c.af(m),c.K(m,m,[1,-1,1]),c.J(m,m,[0,0,-this.cameraToCenterDistance]),c.b7(m,m,this._pitch),c.ae(m,m,this.angle),c.J(m,m,[-d,-p,0]),this.mercatorMatrix=c.K([],m,[this.worldSize,this.worldSize,this.worldSize]),c.K(m,m,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.L(new Float64Array(16),this.labelPlaneMatrix,m),c.J(m,m,[0,0,-this.elevation]),this.modelViewProjectionMatrix=m,this.invModelViewProjectionMatrix=c.at([],m),this.fogMatrix=new Float64Array(16),c.b6(this.fogMatrix,this._fov,this.width/this.height,y,this.farZ),this.fogMatrix[8]=2*-o.x/this.width,this.fogMatrix[9]=2*o.y/this.height,c.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b7(this.fogMatrix,this.fogMatrix,this._pitch),c.ae(this.fogMatrix,this.fogMatrix,this.angle),c.J(this.fogMatrix,this.fogMatrix,[-d,-p,0]),c.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=c.L(new Float64Array(16),this.labelPlaneMatrix,m);const oe=this.width%2/2,ue=this.height%2/2,_e=Math.cos(this.angle),ne=Math.sin(this.angle),we=d-Math.round(d)+_e*oe+ne*ue,Pe=p-Math.round(p)+_e*ue+ne*oe,ke=new Float64Array(m);if(c.J(ke,ke,[we>.5?we-1:we,Pe>.5?Pe-1:Pe,0]),this.alignedModelViewProjectionMatrix=ke,m=c.at(new Float64Array(16),this.pixelMatrix),!m)throw new Error("failed to invert matrix");this.pixelMatrixInverse=m,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const o=this.pointCoordinate(new c.P(0,0)),d=[o.x*this.worldSize,o.y*this.worldSize,0,1];return c.ag(d,d,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,o))}getCameraQueryGeometry(o){const d=this.getCameraPoint();if(o.length===1)return[o[0],d];{let p=d.x,m=d.y,y=d.x,E=d.y;for(const I of o)p=Math.min(p,I.x),m=Math.min(m,I.y),y=Math.max(y,I.x),E=Math.max(E,I.y);return[new c.P(p,m),new c.P(y,m),new c.P(y,E),new c.P(p,E),new c.P(p,m)]}}lngLatToCameraDepth(o,d){const p=this.locationCoordinate(o),m=[p.x*this.worldSize,p.y*this.worldSize,d,1];return c.ag(m,m,this.modelViewProjectionMatrix),m[2]/m[3]}}function rh(b,o){let d,p=!1,m=null,y=null;const E=()=>{m=null,p&&(b.apply(y,d),m=setTimeout(E,o),p=!1)};return(...I)=>(p=!0,y=this,d=I,m||E(),m)}class kc{constructor(o){this._getCurrentHash=()=>{const d=window.location.hash.replace("#","");if(this._hashName){let p;return d.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(p=m)}),(p&&p[1]||"").split("/")}return d.split("/")},this._onHashChange=()=>{const d=this._getCurrentHash();if(d.length>=3&&!d.some(p=>isNaN(p))){const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(d[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+d[2],+d[1]],zoom:+d[0],bearing:p,pitch:+(d[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const d=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,d)},this._removeHash=()=>{const d=this._getCurrentHash();if(d.length===0)return;const p=d.join("/");let m=p;m.split("&").length>0&&(m=m.split("&")[0]),this._hashName&&(m=`${this._hashName}=${p}`);let y=window.location.hash.replace(m,"");y.startsWith("#&")?y=y.slice(0,1)+y.slice(2):y==="#"&&(y="");let E=window.location.href.replace(/(#.+)?$/,y);E=E.replace("&&","&"),window.history.replaceState(window.history.state,null,E)},this._updateHash=rh(this._updateHashUnthrottled,300),this._hashName=o&&encodeURIComponent(o)}addTo(o){return this._map=o,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(o){const d=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,m=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),y=Math.pow(10,m),E=Math.round(d.lng*y)/y,I=Math.round(d.lat*y)/y,M=this._map.getBearing(),k=this._map.getPitch();let N="";if(N+=o?`/${E}/${I}/${p}`:`${p}/${I}/${E}`,(M||k)&&(N+="/"+Math.round(10*M)/10),k&&(N+=`/${Math.round(k)}`),this._hashName){const B=this._hashName;let W=!1;const Z=window.location.hash.slice(1).split("&").map(ee=>{const le=ee.split("=")[0];return le===B?(W=!0,`${le}=${N}`):ee}).filter(ee=>ee);return W||Z.push(`${B}=${N}`),`#${Z.join("&")}`}return`#${N}`}}const Oa={linearity:.3,easing:c.b8(0,0,.3,1)},xf=c.e({deceleration:2500,maxSpeed:1400},Oa),wf=c.e({deceleration:20,maxSpeed:1400},Oa),vg=c.e({deceleration:1e3,maxSpeed:360},Oa),oh=c.e({deceleration:1e3,maxSpeed:90},Oa);class ah{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:C.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,d=C.now();for(;o.length>0&&d-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const d={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:y}of this._inertiaBuffer)d.zoom+=y.zoomDelta||0,d.bearing+=y.bearingDelta||0,d.pitch+=y.pitchDelta||0,y.panDelta&&d.pan._add(y.panDelta),y.around&&(d.around=y.around),y.pinchAround&&(d.pinchAround=y.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(d.pan.mag()){const y=lh(d.pan.mag(),p,c.e({},xf,o||{}));m.offset=d.pan.mult(y.amount/d.pan.mag()),m.center=this._map.transform.center,ul(m,y)}if(d.zoom){const y=lh(d.zoom,p,wf);m.zoom=this._map.transform.zoom+y.amount,ul(m,y)}if(d.bearing){const y=lh(d.bearing,p,vg);m.bearing=this._map.transform.bearing+c.ad(y.amount,-179,179),ul(m,y)}if(d.pitch){const y=lh(d.pitch,p,oh);m.pitch=this._map.transform.pitch+y.amount,ul(m,y)}if(m.zoom||m.bearing){const y=d.pinchAround===void 0?d.around:d.pinchAround;m.around=y?this._map.unproject(y):this._map.getCenter()}return this.clear(),c.e(m,{noMoveStart:!0})}}function ul(b,o){(!b.duration||b.durationd.unproject(M)),I=y.reduce((M,k,N,B)=>M.add(k.div(B.length)),new c.P(0,0));super(o,{points:y,point:I,lngLats:E,lngLat:d.unproject(I),originalEvent:p}),this._defaultPrevented=!1}}class Tf extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,d,p){super(o,{originalEvent:p}),this._defaultPrevented=!1}}class ch{constructor(o,d){this._map=o,this._clickTolerance=d.clickTolerance}reset(){delete this._mousedownPos}wheel(o){return this._firePreventable(new Tf(o.type,this._map,o))}mousedown(o,d){return this._mousedownPos=d,this._firePreventable(new mn(o.type,this._map,o))}mouseup(o){this._map.fire(new mn(o.type,this._map,o))}click(o,d){this._mousedownPos&&this._mousedownPos.dist(d)>=this._clickTolerance||this._map.fire(new mn(o.type,this._map,o))}dblclick(o){return this._firePreventable(new mn(o.type,this._map,o))}mouseover(o){this._map.fire(new mn(o.type,this._map,o))}mouseout(o){this._map.fire(new mn(o.type,this._map,o))}touchstart(o){return this._firePreventable(new Oc(o.type,this._map,o))}touchmove(o){this._map.fire(new Oc(o.type,this._map,o))}touchend(o){this._map.fire(new Oc(o.type,this._map,o))}touchcancel(o){this._map.fire(new Oc(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Sf{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(o){this._map.fire(new mn(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new mn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._ignoreContextMenu||this._map.fire(new mn(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hl{constructor(o){this._map=o}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(o){return this.transform.pointLocation(c.P.convert(o),this._map.terrain)}}class Ef{constructor(o,d){this._map=o,this._tr=new hl(o),this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=d.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,d){this.isEnabled()&&o.shiftKey&&o.button===0&&(P.disableDrag(),this._startPos=this._lastPos=d,this._active=!0)}mousemoveWindow(o,d){if(!this._active)return;const p=d;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)y.fitScreenCoordinates(p,m,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",o)}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(P.remove(this._box),this._box=null),P.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(o,d){return this._map.fire(new c.k(o,{originalEvent:d}))}}function dl(b,o){if(b.length!==o.length)throw new Error(`The number of touches and points are not equal - touches ${b.length}, points ${o.length}`);const d={};for(let p=0;pthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=o.timeStamp),p.length===this.numTouches&&(this.centroid=function(m){const y=new c.P(0,0);for(const E of m)y._add(E);return y.div(m.length)}(d),this.touches=dl(p,d)))}touchmove(o,d,p){if(this.aborted||!this.centroid)return;const m=dl(p,d);for(const y in this.touches){const E=m[y];(!E||E.dist(this.touches[y])>30)&&(this.aborted=!0)}}touchend(o,d,p){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class If{constructor(o){this.singleTap=new Af(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(o,d,p){this.singleTap.touchstart(o,d,p)}touchmove(o,d,p){this.singleTap.touchmove(o,d,p)}touchend(o,d,p){const m=this.singleTap.touchend(o,d,p);if(m){const y=o.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(m)<30;if(y&&E||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class xg{constructor(o){this._tr=new hl(o),this._zoomIn=new If({numTouches:1,numTaps:2}),this._zoomOut=new If({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,d,p){this._zoomIn.touchstart(o,d,p),this._zoomOut.touchstart(o,d,p)}touchmove(o,d,p){this._zoomIn.touchmove(o,d,p),this._zoomOut.touchmove(o,d,p)}touchend(o,d,p){const m=this._zoomIn.touchend(o,d,p),y=this._zoomOut.touchend(o,d,p),E=this._tr;return m?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(m)},{originalEvent:o})}):y?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(y)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zi{constructor(o){this._enabled=!!o.enable,this._moveStateManager=o.moveStateManager,this._clickTolerance=o.clickTolerance||1,this._moveFunction=o.move,this._activateOnStart=!!o.activateOnStart,o.assignEvents(this),this.reset()}reset(o){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(o)}_move(...o){const d=this._moveFunction(...o);if(d.bearingDelta||d.pitchDelta||d.around||d.panDelta)return this._active=!0,d}dragStart(o,d){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(o)&&(this._moveStateManager.startMove(o),this._lastPoint=d.length?d[0]:d,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(o,d){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(o.preventDefault(),!this._moveStateManager.isValidMoveEvent(o))return void this.reset(o);const m=d.length?d[0]:d;return!this._moved&&m.dist(p){b.mousedown=b.dragStart,b.mousemoveWindow=b.dragMove,b.mouseup=b.dragEnd,b.contextmenu=o=>{o.preventDefault()}},Cf=({enable:b,clickTolerance:o,bearingDegreesPerPixelMoved:d=.8})=>{const p=new Cn({checkCorrectEvent:m=>P.mouseButton(m)===0&&m.ctrlKey||P.mouseButton(m)===2});return new zi({clickTolerance:o,move:(m,y)=>({bearingDelta:(y.x-m.x)*d}),moveStateManager:p,enable:b,assignEvents:Dc})},Fa=({enable:b,clickTolerance:o,pitchDegreesPerPixelMoved:d=-.5})=>{const p=new Cn({checkCorrectEvent:m=>P.mouseButton(m)===0&&m.ctrlKey||P.mouseButton(m)===2});return new zi({clickTolerance:o,move:(m,y)=>({pitchDelta:(y.y-m.y)*d}),moveStateManager:p,enable:b,assignEvents:Dc})};class Fc{constructor(o,d){this._clickTolerance=o.clickTolerance||1,this._map=d,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(o){return o<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(o,d,p){return this._calculateTransform(o,d,p)}touchmove(o,d,p){if(this._active){if(!this._shouldBePrevented(p.length))return o.preventDefault(),this._calculateTransform(o,d,p);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",o)}}touchend(o,d,p){this._calculateTransform(o,d,p),this._active&&this._shouldBePrevented(p.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(o,d,p){p.length>0&&(this._active=!0);const m=dl(p,d),y=new c.P(0,0),E=new c.P(0,0);let I=0;for(const k in m){const N=m[k],B=this._touches[k];B&&(y._add(N),E._add(N.sub(B)),I++,m[k]=N)}if(this._touches=m,this._shouldBePrevented(I)||!E.mag())return;const M=E.div(I);return this._sum._add(M),this._sum.mag()Math.abs(b.x)}class Of extends Nc{constructor(o){super(),this._currentTouchCount=0,this._map=o}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(o,d,p){super.touchstart(o,d,p),this._currentTouchCount=p.length}_start(o){this._lastPoints=o,xo(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,d,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=o[0].sub(this._lastPoints[0]),y=o[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,y,p.timeStamp),this._valid?(this._lastPoints=o,this._active=!0,{pitchDelta:(m.y+y.y)/2*-.5}):void 0}gestureBeginsVertically(o,d,p){if(this._valid!==void 0)return this._valid;const m=o.mag()>=2,y=d.mag()>=2;if(!m&&!y)return;if(!m||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const E=o.y>0==d.y>0;return xo(o)&&xo(d)&&E}}const wg={panStep:100,bearingStep:15,pitchStep:10};class Df{constructor(o){this._tr=new hl(o);const d=wg;this._panStep=d.panStep,this._bearingStep=d.bearingStep,this._pitchStep=d.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let d=0,p=0,m=0,y=0,E=0;switch(o.keyCode){case 61:case 107:case 171:case 187:d=1;break;case 189:case 109:case 173:d=-1;break;case 37:o.shiftKey?p=-1:(o.preventDefault(),y=-1);break;case 39:o.shiftKey?p=1:(o.preventDefault(),y=1);break;case 38:o.shiftKey?m=1:(o.preventDefault(),E=-1);break;case 40:o.shiftKey?m=-1:(o.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(p=0,m=0),{cameraAnimation:I=>{const M=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:Tg,zoom:d?Math.round(M.zoom)+d*(o.shiftKey?2:1):M.zoom,bearing:M.bearing+p*this._bearingStep,pitch:M.pitch+m*this._pitchStep,offset:[-y*this._panStep,-E*this._panStep],center:M.center},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Tg(b){return b*(2-b)}const Ff=4.000244140625;class Nf{constructor(o,d){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=o,this._tr=new hl(o),this._triggerRenderFrame=d,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(o){return!!this._map.cooperativeGestures.isEnabled()&&!(o.ctrlKey||this._map.cooperativeGestures.isBypassed(o))}wheel(o){if(!this.isEnabled())return;if(this._shouldBePrevented(o))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",o);let d=o.deltaMode===WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const p=C.now(),m=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,d!==0&&d%Ff==0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=d,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(m*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),o.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=o,this._delta-=d,this._active||this._start(o)),o.preventDefault()}_start(o){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const d=P.mousePos(this._map.getCanvas(),o),p=this._tr;this._around=d.y>p.transform.height/2-p.transform.getHorizon()?c.N.convert(this._aroundCenter?p.center:p.unproject(d)):c.N.convert(p.center),this._aroundPoint=p.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._tr.transform;if(this._delta!==0){const M=this._type==="wheel"&&Math.abs(this._delta)>Ff?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&k!==0&&(k=1/k);const N=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(N*k))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,p=this._startZoom,m=this._easing;let y,E=!1;const I=C.now()-this._lastWheelEventTime;if(this._type==="wheel"&&p&&m&&I){const M=Math.min(I/200,1),k=m(M);y=c.z.number(p,d,k),M<1?this._frameId||(this._frameId=!0):E=!0}else y=d,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:y-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let d=c.b9;if(this._prevEase){const p=this._prevEase,m=(C.now()-p.start)/p.duration,y=p.easing(m+.01)-p.easing(m),E=.27/Math.sqrt(y*y+1e-4)*.01,I=Math.sqrt(.0729-E*E);d=c.b8(E,I,.25,1)}return this._prevEase={start:C.now(),duration:o,easing:d},d}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Bf{constructor(o,d){this._clickZoom=o,this._tapZoom=d}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Lc{constructor(o){this._tr=new hl(o),this.reset()}reset(){this._active=!1}dblclick(o,d){return o.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(o.shiftKey?-1:1),around:this._tr.unproject(d)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Sg{constructor(){this._tap=new If({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(o,d,p){if(!this._swipePoint)if(this._tapTime){const m=d[0],y=o.timeStamp-this._tapTime<500,E=this._tapPoint.dist(m)<30;y&&E?p.length>0&&(this._swipePoint=m,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(o,d,p)}touchmove(o,d,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const m=d[0],y=m.y-this._swipePoint.y;return this._swipePoint=m,o.preventDefault(),this._active=!0,{zoomDelta:y/128}}}else this._tap.touchmove(o,d,p)}touchend(o,d,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const m=this._tap.touchend(o,d,p);m&&(this._tapTime=o.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class dr{constructor(o,d,p){this._el=o,this._mousePan=d,this._touchPan=p}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Mr{constructor(o,d,p){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=d,this._mousePitch=p}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Lf{constructor(o,d,p,m){this._el=o,this._touchZoom=d,this._touchRotate=p,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class kr{constructor(o,d){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=o,this._options=d,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const o=this._map.getCanvasContainer();o.classList.add("maplibregl-cooperative-gestures"),this._container=P.create("div","maplibregl-cooperative-gesture-screen",o);let d=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(d=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=d,this._container.appendChild(m);const y=document.createElement("div");y.className="maplibregl-mobile-message",y.textContent=p,this._container.appendChild(y),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(P.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(o){return o[this._bypassKey]}notifyGestureBlocked(o,d){this._enabled&&(this._map.fire(new c.k("cooperativegestureprevented",{gestureType:o,originalEvent:d})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const wo=b=>b.zoom||b.drag||b.pitch||b.rotate;class Hb extends c.k{}function zf(b){return b.panDelta&&b.panDelta.mag()||b.zoomDelta||b.bearingDelta||b.pitchDelta}class qb{constructor(o,d){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,y)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=m.type==="renderFrame"?void 0:m,I={needsRenderFrame:!1},M={},k={},N=m.touches,B=N?this._getMapTouches(N):void 0,W=B?P.touchPos(this._map.getCanvas(),B):P.mousePos(this._map.getCanvas(),m);for(const{handlerName:le,handler:oe,allowed:ue}of this._handlers){if(!oe.isEnabled())continue;let _e;this._blockedByActive(k,ue,le)?oe.reset():oe[y||m.type]&&(_e=oe[y||m.type](m,W,B),this.mergeHandlerResult(I,M,_e,le,E),_e&&_e.needsRenderFrame&&this._triggerRenderFrame()),(_e||oe.isActive())&&(k[le]=oe)}const Z={};for(const le in this._previousActiveHandlers)k[le]||(Z[le]=E);this._previousActiveHandlers=k,(Object.keys(Z).length||zf(I))&&(this._changes.push([I,M,Z]),this._triggerRenderFrame()),(Object.keys(k).length||zf(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ee}=I;ee&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ee(this._map))},this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ah(o),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(d);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[m,y,E]of this._listeners)P.addEventListener(m,y,m===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[o,d,p]of this._listeners)P.removeEventListener(o,d,o===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(o){const d=this._map,p=d.getCanvasContainer();this._add("mapEvent",new ch(d,o));const m=d.boxZoom=new Ef(d,o);this._add("boxZoom",m),o.interactive&&o.boxZoom&&m.enable();const y=d.cooperativeGestures=new kr(d,o.cooperativeGestures);this._add("cooperativeGestures",y),o.cooperativeGestures&&y.enable();const E=new xg(d),I=new Lc(d);d.doubleClickZoom=new Bf(I,E),this._add("tapZoom",E),this._add("clickZoom",I),o.interactive&&o.doubleClickZoom&&d.doubleClickZoom.enable();const M=new Sg;this._add("tapDragZoom",M);const k=d.touchPitch=new Of(d);this._add("touchPitch",k),o.interactive&&o.touchPitch&&d.touchPitch.enable(o.touchPitch);const N=Cf(o),B=Fa(o);d.dragRotate=new Mr(o,N,B),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",B,["mouseRotate"]),o.interactive&&o.dragRotate&&d.dragRotate.enable();const W=(({enable:_e,clickTolerance:ne})=>{const we=new Cn({checkCorrectEvent:Pe=>P.mouseButton(Pe)===0&&!Pe.ctrlKey});return new zi({clickTolerance:ne,move:(Pe,ke)=>({around:ke,panDelta:ke.sub(Pe)}),activateOnStart:!0,moveStateManager:we,enable:_e,assignEvents:Dc})})(o),Z=new Fc(o,d);d.dragPan=new dr(p,W,Z),this._add("mousePan",W),this._add("touchPan",Z,["touchZoom","touchRotate"]),o.interactive&&o.dragPan&&d.dragPan.enable(o.dragPan);const ee=new kf,le=new Rf;d.touchZoomRotate=new Lf(p,le,ee,M),this._add("touchRotate",ee,["touchPan","touchZoom"]),this._add("touchZoom",le,["touchPan","touchRotate"]),o.interactive&&o.touchZoomRotate&&d.touchZoomRotate.enable(o.touchZoomRotate);const oe=d.scrollZoom=new Nf(d,()=>this._triggerRenderFrame());this._add("scrollZoom",oe,["mousePan"]),o.interactive&&o.scrollZoom&&d.scrollZoom.enable(o.scrollZoom);const ue=d.keyboard=new Df(d);this._add("keyboard",ue),o.interactive&&o.keyboard&&d.keyboard.enable(),this._add("blockableMapEvent",new Sf(d))}_add(o,d,p){this._handlers.push({handlerName:o,handler:d,allowed:p}),this._handlersById[o]=d}stop(o){if(!this._updatingCamera){for(const{handler:d}of this._handlers)d.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!wo(this._eventsInProgress)||this.isZooming()}_blockedByActive(o,d,p){for(const m in o)if(m!==p&&(!d||d.indexOf(m)<0))return!0;return!1}_getMapTouches(o){const d=[];for(const p of o)this._el.contains(p.target)&&d.push(p);return d}mergeHandlerResult(o,d,p,m,y){if(!p)return;c.e(o,p);const E={handlerName:m,originalEvent:p.originalEvent||y};p.zoomDelta!==void 0&&(d.zoom=E),p.panDelta!==void 0&&(d.drag=E),p.pitchDelta!==void 0&&(d.pitch=E),p.bearingDelta!==void 0&&(d.rotate=E)}_applyChanges(){const o={},d={},p={};for(const[m,y,E]of this._changes)m.panDelta&&(o.panDelta=(o.panDelta||new c.P(0,0))._add(m.panDelta)),m.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+m.pitchDelta),m.around!==void 0&&(o.around=m.around),m.pinchAround!==void 0&&(o.pinchAround=m.pinchAround),m.noInertia&&(o.noInertia=m.noInertia),c.e(d,y),c.e(p,E);this._updateMapTransform(o,d,p),this._changes=[]}_updateMapTransform(o,d,p){const m=this._map,y=m._getTransformForUpdate(),E=m.terrain;if(!(zf(o)||E&&this._terrainMovement))return this._fireEvents(d,p,!0);let{panDelta:I,zoomDelta:M,bearingDelta:k,pitchDelta:N,around:B,pinchAround:W}=o;W!==void 0&&(B=W),m._stop(!0),B=B||m.transform.centerPoint;const Z=y.pointLocation(I?B.sub(I):B);k&&(y.bearing+=k),N&&(y.pitch+=N),M&&(y.zoom+=M),E?this._terrainMovement||!d.drag&&!d.zoom?d.drag&&this._terrainMovement?y.center=y.pointLocation(y.centerPoint.sub(I)):y.setLocationAtPoint(Z,B):(this._terrainMovement=!0,this._map._elevationFreeze=!0,y.setLocationAtPoint(Z,B)):y.setLocationAtPoint(Z,B),m._applyUpdatedTransform(y),this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(d,p,!0)}_fireEvents(o,d,p){const m=wo(this._eventsInProgress),y=wo(o),E={};for(const B in o){const{originalEvent:W}=o[B];this._eventsInProgress[B]||(E[`${B}start`]=W),this._eventsInProgress[B]=o[B]}!m&&y&&this._fireEvent("movestart",y.originalEvent);for(const B in E)this._fireEvent(B,E[B]);y&&this._fireEvent("move",y.originalEvent);for(const B in o){const{originalEvent:W}=o[B];this._fireEvent(B,W)}const I={};let M;for(const B in this._eventsInProgress){const{handlerName:W,originalEvent:Z}=this._eventsInProgress[B];this._handlersById[W].isActive()||(delete this._eventsInProgress[B],M=d[W]||Z,I[`${B}end`]=M)}for(const B in I)this._fireEvent(B,I[B]);const k=wo(this._eventsInProgress),N=(m||y)&&!k;if(N&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const B=this._map._getTransformForUpdate();B.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(B)}if(p&&N){this._updatingCamera=!0;const B=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),W=Z=>Z!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Hb("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Xb extends c.E{constructor(o,d){super(),this._renderFrameCallback=()=>{const p=Math.min((C.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=d.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.N(this.transform.center.lng,this.transform.center.lat)}setCenter(o,d){return this.jumpTo({center:o},d)}panBy(o,d,p){return o=c.P.convert(o).mult(-1),this.panTo(this.transform.center,c.e({offset:o},d),p)}panTo(o,d,p){return this.easeTo(c.e({center:o},d),p)}getZoom(){return this.transform.zoom}setZoom(o,d){return this.jumpTo({zoom:o},d),this}zoomTo(o,d,p){return this.easeTo(c.e({zoom:o},d),p)}zoomIn(o,d){return this.zoomTo(this.getZoom()+1,o,d),this}zoomOut(o,d){return this.zoomTo(this.getZoom()-1,o,d),this}getBearing(){return this.transform.bearing}setBearing(o,d){return this.jumpTo({bearing:o},d),this}getPadding(){return this.transform.padding}setPadding(o,d){return this.jumpTo({padding:o},d),this}rotateTo(o,d,p){return this.easeTo(c.e({bearing:o},d),p)}resetNorth(o,d){return this.rotateTo(0,c.e({duration:1e3},o),d),this}resetNorthPitch(o,d){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},o),d),this}snapToNorth(o,d){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=c.z.number(y,oe,$e)),this._rotating&&(m.bearing=c.z.number(E,k,$e)),this._pitching&&(m.pitch=c.z.number(I,N,$e)),this._padding&&(m.interpolatePadding(M,B,$e),Z=m.centerPoint.add(W)),this.terrain&&!o.freezeElevation&&this._updateElevation($e),we)m.setLocationAtPoint(we,Pe);else{const et=m.zoomScale(m.zoom-y),pt=oe>y?Math.min(2,ne):Math.max(.5,ne),gt=Math.pow(pt,1-$e),tt=m.unproject(ue.add(_e.mult($e*gt)).mult(et));m.setLocationAtPoint(m.renderWorldCopies?tt.wrap():tt,Z)}this._applyUpdatedTransform(m),this._fireMoveEvents(d)},$e=>{this.terrain&&o.freezeElevation&&this._finalizeElevation(),this._afterEase(d,$e)},o),this}_prepareEase(o,d,p={}){this._moving=!0,d||p.moving||this.fire(new c.k("movestart",o)),this._zooming&&!p.zooming&&this.fire(new c.k("zoomstart",o)),this._rotating&&!p.rotating&&this.fire(new c.k("rotatestart",o)),this._pitching&&!p.pitching&&this.fire(new c.k("pitchstart",o))}_prepareElevation(o){this._elevationCenter=o,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(o){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const d=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(o<1&&d!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=o*(p-(d-(p*o+this._elevationStart))/(1-o)),this._elevationTarget=d}this.transform.elevation=c.z.number(this._elevationStart,this._elevationTarget,o)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(o){const d=o.getCameraPosition(),p=this.terrain.getElevationForLngLatZoom(d.lngLat,o.zoom);if(d.altitudethis._elevateCameraIfInsideTerrain(m)),this.transformCameraUpdate&&d.push(m=>this.transformCameraUpdate(m)),!d.length)return;const p=o.clone();for(const m of d){const y=p.clone(),{center:E,zoom:I,pitch:M,bearing:k,elevation:N}=m(y);E&&(y.center=E),I!==void 0&&(y.zoom=I),M!==void 0&&(y.pitch=M),k!==void 0&&(y.bearing=k),N!==void 0&&(y.elevation=N),p.apply(y)}this.transform.apply(p)}_fireMoveEvents(o){this.fire(new c.k("move",o)),this._zooming&&this.fire(new c.k("zoom",o)),this._rotating&&this.fire(new c.k("rotate",o)),this._pitching&&this.fire(new c.k("pitch",o))}_afterEase(o,d){if(this._easeId&&d&&this._easeId===d)return;delete this._easeId;const p=this._zooming,m=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new c.k("zoomend",o)),m&&this.fire(new c.k("rotateend",o)),y&&this.fire(new c.k("pitchend",o)),this.fire(new c.k("moveend",o))}flyTo(o,d){var p;if(!o.essential&&C.prefersReducedMotion){const ut=c.M(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ut,d)}this.stop(),o=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b9},o);const m=this._getTransformForUpdate(),y=m.zoom,E=m.bearing,I=m.pitch,M=m.padding,k="bearing"in o?this._normalizeBearing(o.bearing,E):E,N="pitch"in o?+o.pitch:I,B="padding"in o?o.padding:m.padding,W=c.P.convert(o.offset);let Z=m.centerPoint.add(W);const ee=m.pointLocation(Z),{center:le,zoom:oe}=m.getConstrained(c.N.convert(o.center||ee),(p=o.zoom)!==null&&p!==void 0?p:y);this._normalizeCenter(le,m);const ue=m.zoomScale(oe-y),_e=m.project(ee),ne=m.project(le).sub(_e);let we=o.curve;const Pe=Math.max(m.width,m.height),ke=Pe/ue,$e=ne.mag();if("minZoom"in o){const ut=c.ad(Math.min(o.minZoom,y,oe),m.minZoom,m.maxZoom),zt=Pe/m.zoomScale(ut-y);we=Math.sqrt(zt/$e*2)}const et=we*we;function pt(ut){const zt=(ke*ke-Pe*Pe+(ut?-1:1)*et*et*$e*$e)/(2*(ut?ke:Pe)*et*$e);return Math.log(Math.sqrt(zt*zt+1)-zt)}function gt(ut){return(Math.exp(ut)-Math.exp(-ut))/2}function tt(ut){return(Math.exp(ut)+Math.exp(-ut))/2}const rt=pt(!1);let Tt=function(ut){return tt(rt)/tt(rt+we*ut)},qt=function(ut){return Pe*((tt(rt)*(gt(zt=rt+we*ut)/tt(zt))-gt(rt))/et)/$e;var zt},at=(pt(!0)-rt)/we;if(Math.abs($e)<1e-6||!isFinite(at)){if(Math.abs(Pe-ke)<1e-6)return this.easeTo(o,d);const ut=ke0,Tt=zt=>Math.exp(ut*we*zt)}return o.duration="duration"in o?+o.duration:1e3*at/("screenSpeed"in o?+o.screenSpeed/we:+o.speed),o.maxDuration&&o.duration>o.maxDuration&&(o.duration=0),this._zooming=!0,this._rotating=E!==k,this._pitching=N!==I,this._padding=!m.isPaddingEqual(B),this._prepareEase(d,!1),this.terrain&&this._prepareElevation(le),this._ease(ut=>{const zt=ut*at,Ui=1/Tt(zt);m.zoom=ut===1?oe:y+m.scaleZoom(Ui),this._rotating&&(m.bearing=c.z.number(E,k,ut)),this._pitching&&(m.pitch=c.z.number(I,N,ut)),this._padding&&(m.interpolatePadding(M,B,ut),Z=m.centerPoint.add(W)),this.terrain&&!o.freezeElevation&&this._updateElevation(ut);const Qt=ut===1?le:m.unproject(_e.add(ne.mult(qt(zt))).mult(Ui));m.setLocationAtPoint(m.renderWorldCopies?Qt.wrap():Qt,Z),this._applyUpdatedTransform(m),this._fireMoveEvents(d)},()=>{this.terrain&&o.freezeElevation&&this._finalizeElevation(),this._afterEase(d)},o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,d){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,d)}return o||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(o,d,p){p.animate===!1||p.duration===0?(o(1),d()):(this._easeStart=C.now(),this._easeOptions=p,this._onEaseFrame=o,this._onEaseEnd=d,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(o,d){o=c.b3(o,-180,180);const p=Math.abs(o-d);return Math.abs(o-360-d)180?-360:p<-180?360:0}queryTerrainElevation(o){return this.terrain?this.terrain.getElevationForLngLatZoom(c.N.convert(o),this.transform.tileZoom)-this.transform.elevation:null}}const Uf={compact:!0,customAttribution:'MapLibre'};class fl{constructor(o=Uf){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=d=>{!d||d.sourceDataType!=="metadata"&&d.sourceDataType!=="visibility"&&d.dataType!=="style"&&d.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=o}getDefaultPosition(){return"bottom-right"}onAdd(o){return this._map=o,this._compact=this.options.compact,this._container=P.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=P.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=P.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){P.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(o,d){const p=this._map._getUIString(`AttributionControl.${d}`);o.title=p,o.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let o=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=o.concat(this.options.customAttribution.map(m=>typeof m!="string"?"":m)):typeof this.options.customAttribution=="string"&&o.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const d=this._map.style.sourceCaches;for(const m in d){const y=d[m];if(y.used||y.usedForTerrain){const E=y.getSource();E.attribution&&o.indexOf(E.attribution)<0&&o.push(E.attribution)}}o=o.filter(m=>String(m).trim()),o.sort((m,y)=>m.length-y.length),o=o.filter((m,y)=>{for(let E=y+1;E=0)return!1;return!0});const p=o.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,o.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class eo{constructor(o={}){this._updateCompact=()=>{const d=this._container.children;if(d.length){const p=d[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=o}getDefaultPosition(){return"bottom-left"}onAdd(o){this._map=o,this._compact=this.options&&this.options.compact,this._container=P.create("div","maplibregl-ctrl");const d=P.create("a","maplibregl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://maplibre.org/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){P.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class vt{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const d=++this._id;return this._queue.push({callback:o,id:d,cancelled:!1}),d}remove(o){const d=this._currentlyRunning,p=d?this._queue.concat(d):this._queue;for(const m of p)if(m.id===o)return void(m.cancelled=!0)}run(o=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const d=this._currentlyRunning=this._queue;this._queue=[];for(const p of d)if(!p.cancelled&&(p.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Eg=c.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Vf extends c.E{constructor(o){super(),this.sourceCache=o,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,o.usedForTerrain=!0,o.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(o,d){this.sourceCache.update(o,d),this._renderableTilesKeys=[];const p={};for(const m of o.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:d}))p[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.posMatrix=new Float64Array(16),c.aQ(m.posMatrix,0,c.X,0,c.X,0,1),this._tiles[m.key]=new Cs(m,this.tileSize));for(const m in this._tiles)p[m]||delete this._tiles[m]}freeRtt(o){for(const d in this._tiles){const p=this._tiles[d];(!o||p.tileID.equals(o)||p.tileID.isChildOf(o)||o.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(o=>this.getTileByID(o))}getTileByID(o){return this._tiles[o]}getTerrainCoords(o){const d={};for(const p of this._renderableTilesKeys){const m=this._tiles[p].tileID;if(m.canonical.equals(o.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16),c.aQ(y.posMatrix,0,c.X,0,c.X,0,1),d[p]=y}else if(m.canonical.isChildOf(o.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const E=m.canonical.z-o.canonical.z,I=m.canonical.x-(m.canonical.x>>E<>E<>E;c.aQ(y.posMatrix,0,k,0,k,0,1),c.J(y.posMatrix,y.posMatrix,[-I*k,-M*k,0]),d[p]=y}else if(o.canonical.isChildOf(m.canonical)){const y=o.clone();y.posMatrix=new Float64Array(16);const E=o.canonical.z-m.canonical.z,I=o.canonical.x-(o.canonical.x>>E<>E<>E;c.aQ(y.posMatrix,0,c.X,0,c.X,0,1),c.J(y.posMatrix,y.posMatrix,[I*k,M*k,0]),c.K(y.posMatrix,y.posMatrix,[1/2**E,1/2**E,0]),d[p]=y}}return d}getSourceTile(o,d){const p=this.sourceCache._source;let m=o.overscaledZ-this.deltaZoom;if(m>p.maxzoom&&(m=p.maxzoom),m=p.minzoom&&(!y||!y.dem);)y=this.sourceCache.getTileByID(o.scaledTo(m--).key);return y}tilesAfterTime(o=Date.now()){return Object.values(this._tiles).filter(d=>d.timeAdded>=o)}}class Ag{constructor(o,d,p){this.painter=o,this.sourceCache=new Vf(d),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(o,d,p,m=c.X){var y;if(!(d>=0&&d=0&&po.canonical.z&&(o.canonical.z>=m?y=o.canonical.z-m:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=o.canonical.x-(o.canonical.x>>y<>y<>8<<4|y>>8,d[E+3]=0;const p=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(d.buffer)),m=new He(o,p,o.gl.RGBA,{premultiply:!1});return m.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(o){this.painter.maybeDrawDepthAndCoords(!0);const d=new Uint8Array(4),p=this.painter.context,m=p.gl,y=Math.round(o.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(o.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(y,I-E-1,1,1,m.RGBA,m.UNSIGNED_BYTE,d),p.bindFramebuffer.set(null);const M=d[0]+(d[2]>>4<<8),k=d[1]+((15&d[2])<<8),N=this.coordsIndex[255-d[3]],B=N&&this.sourceCache.getTileByID(N);if(!B)return null;const W=this._coordsTextureSize,Z=(1<o.id!==d),this._recentlyUsed.push(o.id)}stampObject(o){o.stamp=++this._stamp}getOrCreateFreeObject(){for(const d of this._recentlyUsed)if(!this._objects[d].inUse)return this._objects[d];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const o=this._createObject(this._objects.length);return this._objects.push(o),o}freeObject(o){o.inUse=!1}freeAllObjects(){for(const o of this._objects)this.freeObject(o)}isFull(){return!(this._objects.length!o.inUse)===!1}}const to={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ig{constructor(o,d){this.painter=o,this.terrain=d,this.pool=new zc(o.context,30,d.sourceCache.tileSize*d.qualityFactor)}destruct(){this.pool.destruct()}getTexture(o){return this.pool.getObjectForId(o.rtt[this._stacks.length-1].id).texture}prepareForRender(o,d){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=o._order.filter(p=>!o._layers[p].isHidden(d)),this._coordsDescendingInv={};for(const p in o.sourceCaches){this._coordsDescendingInv[p]={};const m=o.sourceCaches[p].getVisibleCoordinates();for(const y of m){const E=this.terrain.sourceCache.getTerrainCoords(y);for(const I in E)this._coordsDescendingInv[p][I]||(this._coordsDescendingInv[p][I]=[]),this._coordsDescendingInv[p][I].push(E[I])}}this._coordsDescendingInvStr={};for(const p of o._order){const m=o._layers[p],y=m.source;if(to[m.type]&&!this._coordsDescendingInvStr[y]){this._coordsDescendingInvStr[y]={};for(const E in this._coordsDescendingInv[y])this._coordsDescendingInvStr[y][E]=this._coordsDescendingInv[y][E].map(I=>I.key).sort().join()}}for(const p of this._renderableTiles)for(const m in this._coordsDescendingInvStr){const y=this._coordsDescendingInvStr[m][p.tileID.key];y&&y!==p.rttCoords[m]&&(p.rtt=[])}}renderLayer(o){if(o.isHidden(this.painter.transform.zoom))return!1;const d=o.type,p=this.painter,m=this._renderableLayerIds[this._renderableLayerIds.length-1]===o.id;if(to[d]&&(this._prevType&&to[this._prevType]||this._stacks.push([]),this._prevType=d,this._stacks[this._stacks.length-1].push(o.id),!m))return!0;if(to[this._prevType]||to[d]&&m){this._prevType=d;const y=this._stacks.length-1,E=this._stacks[y]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(Mc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[y]){const k=this.pool.getObjectForId(I.rtt[y].id);if(k.stamp===I.rtt[y].stamp){this.pool.useObject(k);continue}}const M=this.pool.getOrCreateFreeObject();this.pool.useObject(M),this.pool.stampObject(M),I.rtt[y]={id:M.id,stamp:M.stamp},p.context.bindFramebuffer.set(M.fbo.framebuffer),p.context.clear({color:c.aN.transparent,stencil:0}),p.currentStencilSource=void 0;for(let k=0;k{b.touchstart=b.dragStart,b.touchmoveWindow=b.dragMove,b.touchend=b.dragEnd},$f={showCompass:!0,showZoom:!0,visualizePitch:!1};class Pg{constructor(o,d,p=!1){this.mousedown=E=>{this.startMouse(c.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),P.mousePos(this.element,E)),P.addEventListener(window,"mousemove",this.mousemove),P.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,P.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=P.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),P.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=P.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const m=o.dragRotate._mouseRotate.getClickTolerance(),y=o.dragRotate._mousePitch.getClickTolerance();this.element=d,this.mouseRotate=Cf({clickTolerance:m,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:I,bearingDegreesPerPixelMoved:M=.8})=>{const k=new uh;return new zi({clickTolerance:I,move:(N,B)=>({bearingDelta:(B.x-N.x)*M}),moveStateManager:k,enable:E,assignEvents:Cg})})({clickTolerance:m,enable:!0}),this.map=o,p&&(this.mousePitch=Fa({clickTolerance:y,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:I,pitchDegreesPerPixelMoved:M=-.5})=>{const k=new uh;return new zi({clickTolerance:I,move:(N,B)=>({pitchDelta:(B.y-N.y)*M}),moveStateManager:k,enable:E,assignEvents:Cg})})({clickTolerance:y,enable:!0})),P.addEventListener(d,"mousedown",this.mousedown),P.addEventListener(d,"touchstart",this.touchstart,{passive:!1}),P.addEventListener(d,"touchcancel",this.reset)}startMouse(o,d){this.mouseRotate.dragStart(o,d),this.mousePitch&&this.mousePitch.dragStart(o,d),P.disableDrag()}startTouch(o,d){this.touchRotate.dragStart(o,d),this.touchPitch&&this.touchPitch.dragStart(o,d),P.disableDrag()}moveMouse(o,d){const p=this.map,{bearingDelta:m}=this.mouseRotate.dragMove(o,d)||{};if(m&&p.setBearing(p.getBearing()+m),this.mousePitch){const{pitchDelta:y}=this.mousePitch.dragMove(o,d)||{};y&&p.setPitch(p.getPitch()+y)}}moveTouch(o,d){const p=this.map,{bearingDelta:m}=this.touchRotate.dragMove(o,d)||{};if(m&&p.setBearing(p.getBearing()+m),this.touchPitch){const{pitchDelta:y}=this.touchPitch.dragMove(o,d)||{};y&&p.setPitch(p.getPitch()+y)}}off(){const o=this.element;P.removeEventListener(o,"mousedown",this.mousedown),P.removeEventListener(o,"touchstart",this.touchstart,{passive:!1}),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend),P.removeEventListener(o,"touchcancel",this.reset),this.offTemp()}offTemp(){P.enableDrag(),P.removeEventListener(window,"mousemove",this.mousemove),P.removeEventListener(window,"mouseup",this.mouseup),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend)}}let zo;function Rg(b,o,d){const p=new c.N(b.lng,b.lat);if(b=new c.N(b.lng,b.lat),o){const m=new c.N(b.lng-360,b.lat),y=new c.N(b.lng+360,b.lat),E=d.locationPoint(b).distSqr(o);d.locationPoint(m).distSqr(o)180;){const m=d.locationPoint(b);if(m.x>=0&&m.y>=0&&m.x<=d.width&&m.y<=d.height)break;b.lng>d.center.lng?b.lng-=360:b.lng+=360}return b.lng!==p.lng&&d.locationPoint(b).y>d.height/2-d.getHorizon()?b:p}const Wf={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 Uo(b,o,d){const p=b.classList;for(const m in Wf)p.remove(`maplibregl-${d}-anchor-${m}`);p.add(`maplibregl-${d}-anchor-${o}`)}class Oi extends c.E{constructor(o){if(super(),this._onKeyPress=d=>{const p=d.code,m=d.charCode||d.keyCode;p!=="Space"&&p!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=d=>{const p=d.originalEvent.target,m=this._element;this._popup&&(p===m||m.contains(p))&&this.togglePopup()},this._update=d=>{var p;if(!this._map)return;const m=this._map.loaded()&&!this._map.isMoving();((d==null?void 0:d.type)==="terrain"||(d==null?void 0:d.type)==="render"&&!m)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Rg(this._lngLat,this._flatPos,this._map.transform):(p=this._lngLat)===null||p===void 0?void 0:p.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let y="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?y=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(y=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||d&&d.type!=="moveend"||(this._pos=this._pos.round()),P.setTransform(this._element,`${Wf[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${y}`),C.frameAsync(new AbortController).then(()=>{this._updateOpacity(d&&d.type==="moveend")}).catch(()=>{})},this._onMove=d=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=d.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=d.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=d=>{this._element.contains(d.originalEvent.target)&&(d.preventDefault(),this._positionDelta=d.point.sub(this._pos).add(this._offset),this._pointerdownPos=d.point,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))},this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._subpixelPositioning=o&&o.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment!=="auto"?o.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(o==null?void 0:o.opacity,o==null?void 0:o.opacityWhenCovered),o&&o.element)this._element=o.element,this._offset=c.P.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=P.create("div");const d=P.createNS("http://www.w3.org/2000/svg","svg"),p=41,m=27;d.setAttributeNS(null,"display","block"),d.setAttributeNS(null,"height",`${p}px`),d.setAttributeNS(null,"width",`${m}px`),d.setAttributeNS(null,"viewBox",`0 0 ${m} ${p}`);const y=P.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"stroke","none"),y.setAttributeNS(null,"stroke-width","1"),y.setAttributeNS(null,"fill","none"),y.setAttributeNS(null,"fill-rule","evenodd");const E=P.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const I=P.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const M=[{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"}];for(const ue of M){const _e=P.createNS("http://www.w3.org/2000/svg","ellipse");_e.setAttributeNS(null,"opacity","0.04"),_e.setAttributeNS(null,"cx","10.5"),_e.setAttributeNS(null,"cy","5.80029008"),_e.setAttributeNS(null,"rx",ue.rx),_e.setAttributeNS(null,"ry",ue.ry),I.appendChild(_e)}const k=P.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"fill",this._color);const N=P.createNS("http://www.w3.org/2000/svg","path");N.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"),k.appendChild(N);const B=P.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"fill","#000000");const W=P.createNS("http://www.w3.org/2000/svg","path");W.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"),B.appendChild(W);const Z=P.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const ee=P.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(8.0, 8.0)");const le=P.createNS("http://www.w3.org/2000/svg","circle");le.setAttributeNS(null,"fill","#000000"),le.setAttributeNS(null,"opacity","0.25"),le.setAttributeNS(null,"cx","5.5"),le.setAttributeNS(null,"cy","5.5"),le.setAttributeNS(null,"r","5.4999962");const oe=P.createNS("http://www.w3.org/2000/svg","circle");oe.setAttributeNS(null,"fill","#FFFFFF"),oe.setAttributeNS(null,"cx","5.5"),oe.setAttributeNS(null,"cy","5.5"),oe.setAttributeNS(null,"r","5.4999962"),ee.appendChild(le),ee.appendChild(oe),E.appendChild(I),E.appendChild(k),E.appendChild(B),E.appendChild(Z),E.appendChild(ee),d.appendChild(E),d.setAttributeNS(null,"height",p*this._scale+"px"),d.setAttributeNS(null,"width",m*this._scale+"px"),this._element.appendChild(d),this._offset=c.P.convert(o&&o.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",d=>{d.preventDefault()}),this._element.addEventListener("mousedown",d=>{d.preventDefault()}),Uo(this._element,this._anchor,"marker"),o&&o.className)for(const d of o.className.split(" "))this._element.classList.add(d);this._popup=null}addTo(o){return this.remove(),this._map=o,this._element.setAttribute("aria-label",o._getUIString("Marker.Title")),o.getCanvasContainer().appendChild(this._element),o.on("move",this._update),o.on("moveend",this._update),o.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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),P.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=c.N.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const m=Math.abs(13.5)/Math.SQRT2;o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(o){return this._subpixelPositioning=o,this}getPopup(){return this._popup}togglePopup(){const o=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:o?(o.isOpen()?o.remove():(o.setLngLat(this._lngLat),o.addTo(this._map)),this):this}_updateOpacity(o=!1){var d,p;if(!(!((d=this._map)===null||d===void 0)&&d.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(o)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const m=this._map,y=m.terrain.depthAtPoint(this._pos),E=m.terrain.getElevationForLngLatZoom(this._lngLat,m.transform.tileZoom);if(m.transform.lngLatToCameraDepth(this._lngLat,E)-y<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/m.transform._pixelPerMeter,M=Math.sin(m.getPitch()*Math.PI/180)*I,k=m.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),N=m.transform.lngLatToCameraDepth(this._lngLat,E+M)-k>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&N&&this._popup.remove(),this._element.style.opacity=N?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(o){return this._offset=c.P.convert(o),this._update(),this}addClassName(o){this._element.classList.add(o)}removeClassName(o){this._element.classList.remove(o)}toggleClassName(o){return this._element.classList.toggle(o)}setDraggable(o){return this._draggable=!!o,this._map&&(o?(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}isDraggable(){return this._draggable}setRotation(o){return this._rotation=o||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(o){return this._rotationAlignment=o||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(o){return this._pitchAlignment=o&&o!=="auto"?o:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(o,d){return o===void 0&&d===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),o!==void 0&&(this._opacity=o),d!==void 0&&(this._opacityWhenCovered=d),this._map&&this._updateOpacity(!0),this}}const hh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let pl=0,ml=!1;const Mg={maxWidth:100,unit:"metric"};function Hf(b,o,d){const p=d&&d.maxWidth||100,m=b._container.clientHeight/2,y=b.unproject([0,m]),E=b.unproject([p,m]),I=y.distanceTo(E);if(d&&d.unit==="imperial"){const M=3.2808*I;M>5280?Uc(o,p,M/5280,b._getUIString("ScaleControl.Miles")):Uc(o,p,M,b._getUIString("ScaleControl.Feet"))}else d&&d.unit==="nautical"?Uc(o,p,I/1852,b._getUIString("ScaleControl.NauticalMiles")):I>=1e3?Uc(o,p,I/1e3,b._getUIString("ScaleControl.Kilometers")):Uc(o,p,I,b._getUIString("ScaleControl.Meters"))}function Uc(b,o,d,p){const m=function(y){const E=Math.pow(10,`${Math.floor(y)}`.length-1);let I=y/E;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(M){const k=Math.pow(10,Math.ceil(-Math.log(M)/Math.LN10));return Math.round(M*k)/k}(I),E*I}(d);b.style.width=o*(m/d)+"px",b.innerHTML=`${m} ${p}`}const io={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},dh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ct(b){if(b){if(typeof b=="number"){const o=Math.round(Math.abs(b)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,b),"top-left":new c.P(o,o),"top-right":new c.P(-o,o),bottom:new c.P(0,-b),"bottom-left":new c.P(o,-o),"bottom-right":new c.P(-o,-o),left:new c.P(b,0),right:new c.P(-b,0)}}if(b instanceof c.P||Array.isArray(b)){const o=c.P.convert(b);return{center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return{center:c.P.convert(b.center||[0,0]),top:c.P.convert(b.top||[0,0]),"top-left":c.P.convert(b["top-left"]||[0,0]),"top-right":c.P.convert(b["top-right"]||[0,0]),bottom:c.P.convert(b.bottom||[0,0]),"bottom-left":c.P.convert(b["bottom-left"]||[0,0]),"bottom-right":c.P.convert(b["bottom-right"]||[0,0]),left:c.P.convert(b.left||[0,0]),right:c.P.convert(b.right||[0,0])}}return Ct(new c.P(0,0))}const Nt=_;u.AJAXError=c.bg,u.Evented=c.E,u.LngLat=c.N,u.MercatorCoordinate=c.Z,u.Point=c.P,u.addProtocol=c.bh,u.config=c.a,u.removeProtocol=c.bi,u.AttributionControl=fl,u.BoxZoomHandler=Ef,u.CanvasSource=St,u.CooperativeGesturesHandler=kr,u.DoubleClickZoomHandler=Bf,u.DragPanHandler=dr,u.DragRotateHandler=Mr,u.EdgeInsets=nh,u.FullscreenControl=class extends c.E{constructor(b={}){super(),this._onFullscreenChange=()=>{var o;let d=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((o=d==null?void 0:d.shadowRoot)===null||o===void 0)&&o.fullscreenElement;)d=d.shadowRoot.fullscreenElement;d===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,b&&b.container&&(b.container instanceof HTMLElement?this._container=b.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(b){return this._map=b,this._container||(this._container=this._map.getContainer()),this._controlContainer=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){P.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const b=this._fullscreenButton=P.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);P.create("span","maplibregl-ctrl-icon",b).setAttribute("aria-hidden","true"),b.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const b=this._getTitle();this._fullscreenButton.setAttribute("aria-label",b),this._fullscreenButton.title=b}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},u.GeoJSONSource=st,u.GeolocateControl=class extends c.E{constructor(b){super(),this._onSuccess=o=>{if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",o)),this._finish()}},this._updateCamera=o=>{const d=new c.N(o.coords.longitude,o.coords.latitude),p=o.coords.accuracy,m=this._map.getBearing(),y=c.e({bearing:m},this.options.fitBoundsOptions),E=he.fromLngLat(d,p);this._map.fitBounds(E,y,{geolocateSource:!0})},this._updateMarker=o=>{if(o){const d=new c.N(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(d).addTo(this._map),this._userLocationDotMarker.setLngLat(d).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=o=>{if(this._map){if(this.options.trackUserLocation)if(o.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const d=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&ml)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",o)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=P.create("button","maplibregl-ctrl-geolocate",this._container),P.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=o=>{if(this._map){if(o===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const d=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d)}else{const d=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=d,this._geolocateButton.setAttribute("aria-label",d)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=P.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Oi({element:this._dotElement}),this._circleElement=P.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Oi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",d=>{d.geolocateSource||this._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")),this.fire(new c.k("userlocationlostfocus")))})}},this.options=c.e({},hh,b)}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return c._(this,arguments,void 0,function*(o=!1){if(zo!==void 0&&!o)return zo;if(window.navigator.permissions===void 0)return zo=!!window.navigator.geolocation,zo;try{zo=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zo=!!window.navigator.geolocation}return zo})}().then(o=>this._finishSetupUI(o)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),P.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,pl=0,ml=!1}_isOutOfMapMaxBounds(b){const o=this._map.getMaxBounds(),d=b.coords;return o&&(d.longitudeo.getEast()||d.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const b=this._map.getBounds(),o=b.getSouthEast(),d=b.getNorthEast(),p=o.distanceTo(d),m=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}px`}trigger(){if(!this._setup)return c.w("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 c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":pl--,ml=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart")),this.fire(new c.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let b;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),pl++,pl>1?(b={maximumAge:6e5,timeout:0},ml=!0):(b=this.options.positionOptions,ml=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,b)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},u.Hash=kc,u.ImageSource=_t,u.KeyboardHandler=Df,u.LngLatBounds=he,u.LogoControl=eo,u.Map=class extends Xb{constructor(b){c.be.mark(c.bf.create);const o=Object.assign(Object.assign({},Zb),b);if(o.minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new vf(o.minZoom,o.maxZoom,o.minPitch,o.maxPitch,o.renderWorldCopies),{bearingSnap:o.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new vt,this._controls=[],this._mapId=c.a4(),this._contextLost=d=>{d.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:d}))},this._contextRestored=d=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:d}))},this._onMapScroll=d=>{if(d.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=o.interactive,this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=o.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=o.preserveDrawingBuffer===!0,this._antialias=o.antialias===!0,this._trackResize=o.trackResize===!0,this._bearingSnap=o.bearingSnap,this._refreshExpiredTiles=o.refreshExpiredTiles===!0,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions===!0,this._collectResourceTiming=o.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ft),o.locale),this._clickTolerance=o.clickTolerance,this._overridePixelRatio=o.pixelRatio,this._maxCanvasSize=o.maxCanvasSize,this.transformCameraUpdate=o.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=o.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=se.addThrottleControl(()=>this.isMoving()),this._requestManager=new ve(o.transformRequest),typeof o.container=="string"){if(this._container=document.getElementById(o.container),!this._container)throw new Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let d=!1;const p=rh(m=>{this._trackResize&&!this._removed&&this.resize(m)._update()},50);this._resizeObserver=new ResizeObserver(m=>{d?p(m):d=!0}),this._resizeObserver.observe(this._container)}this.handlers=new qb(this,o),this._hash=o.hash&&new kc(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,c.e({},o.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new fl(typeof o.attributionControl=="boolean"?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new eo,o.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",d=>{this._update(d.dataType==="style"),this.fire(new c.k(`${d.dataType}data`,d))}),this.on("dataloading",d=>{this.fire(new c.k(`${d.dataType}dataloading`,d))}),this.on("dataabort",d=>{this.fire(new c.k("sourcedataabort",d))})}_getMapId(){return this._mapId}addControl(b,o){if(o===void 0&&(o=b.getDefaultPosition?b.getDefaultPosition():"top-right"),!b||!b.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const d=b.onAdd(this);this._controls.push(b);const p=this._controlPositions[o];return o.indexOf("bottom")!==-1?p.insertBefore(d,p.firstChild):p.appendChild(d),this}removeControl(b){if(!b||!b.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(b);return o>-1&&this._controls.splice(o,1),b.onRemove(this),this}hasControl(b){return this._controls.indexOf(b)>-1}calculateCameraOptionsFromTo(b,o,d,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(d,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(b,o,d,p)}resize(b){var o;const d=this._containerDimensions(),p=d[0],m=d[1],y=this._getClampedPixelRatio(p,m);if(this._resizeCanvas(p,m,y),this.painter.resize(p,m,y),this.painter.overLimit()){const I=this.painter.context.gl;this._maxCanvasSize=[I.drawingBufferWidth,I.drawingBufferHeight];const M=this._getClampedPixelRatio(p,m);this._resizeCanvas(p,m,M),this.painter.resize(p,m,M)}this.transform.resize(p,m),(o=this._requestedCameraState)===null||o===void 0||o.resize(p,m);const E=!this._moving;return E&&(this.stop(),this.fire(new c.k("movestart",b)).fire(new c.k("move",b))),this.fire(new c.k("resize",b)),E&&this.fire(new c.k("moveend",b)),this}_getClampedPixelRatio(b,o){const{0:d,1:p}=this._maxCanvasSize,m=this.getPixelRatio(),y=b*m,E=o*m;return Math.min(y>d?d/y:1,E>p?p/E:1)*m}getPixelRatio(){var b;return(b=this._overridePixelRatio)!==null&&b!==void 0?b:devicePixelRatio}setPixelRatio(b){this._overridePixelRatio=b,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(b){return this.transform.setMaxBounds(he.convert(b)),this._update()}setMinZoom(b){if((b=b??-2)>=-2&&b<=this.transform.maxZoom)return this.transform.minZoom=b,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=b,this._update(),this.getZoom()>b&&this.setZoom(b),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(b){if((b=b??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(b>=0&&b<=this.transform.maxPitch)return this.transform.minPitch=b,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(b>=this.transform.minPitch)return this.transform.maxPitch=b,this._update(),this.getPitch()>b&&this.setPitch(b),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(b){return this.transform.renderWorldCopies=b,this._update()}project(b){return this.transform.locationPoint(c.N.convert(b),this.style&&this.terrain)}unproject(b){return this.transform.pointLocation(c.P.convert(b),this.terrain)}isMoving(){var b;return this._moving||((b=this.handlers)===null||b===void 0?void 0:b.isMoving())}isZooming(){var b;return this._zooming||((b=this.handlers)===null||b===void 0?void 0:b.isZooming())}isRotating(){var b;return this._rotating||((b=this.handlers)===null||b===void 0?void 0:b.isRotating())}_createDelegatedListener(b,o,d){if(b==="mouseenter"||b==="mouseover"){let p=!1;return{layer:o,listener:d,delegates:{mousemove:y=>{const E=this.getLayer(o)?this.queryRenderedFeatures(y.point,{layers:[o]}):[];E.length?p||(p=!0,d.call(this,new mn(b,this,y.originalEvent,{features:E}))):p=!1},mouseout:()=>{p=!1}}}}if(b==="mouseleave"||b==="mouseout"){let p=!1;return{layer:o,listener:d,delegates:{mousemove:E=>{(this.getLayer(o)?this.queryRenderedFeatures(E.point,{layers:[o]}):[]).length?p=!0:p&&(p=!1,d.call(this,new mn(b,this,E.originalEvent)))},mouseout:E=>{p&&(p=!1,d.call(this,new mn(b,this,E.originalEvent)))}}}}{const p=m=>{const y=this.getLayer(o)?this.queryRenderedFeatures(m.point,{layers:[o]}):[];y.length&&(m.features=y,d.call(this,m),delete m.features)};return{layer:o,listener:d,delegates:{[b]:p}}}}on(b,o,d){if(d===void 0)return super.on(b,o);const p=this._createDelegatedListener(b,o,d);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[b]=this._delegatedListeners[b]||[],this._delegatedListeners[b].push(p);for(const m in p.delegates)this.on(m,p.delegates[m]);return this}once(b,o,d){if(d===void 0)return super.once(b,o);const p=this._createDelegatedListener(b,o,d);for(const m in p.delegates)this.once(m,p.delegates[m]);return this}off(b,o,d){return d===void 0?super.off(b,o):(this._delegatedListeners&&this._delegatedListeners[b]&&(p=>{const m=this._delegatedListeners[b];for(let y=0;ythis._updateStyle(b,o));const d=this.style&&o.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!b)),b?(this.style=new hr(this,o||{}),this.style.setEventedParent(this,{style:this.style}),typeof b=="string"?this.style.loadURL(b,o,d):this.style.loadJSON(b,o,d),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new hr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(b,o){if(typeof b=="string"){const d=this._requestManager.transformRequest(b,"Style");c.h(d,new AbortController).then(p=>{this._updateDiff(p.data,o)}).catch(p=>{p&&this.fire(new c.j(p))})}else typeof b=="object"&&this._updateDiff(b,o)}_updateDiff(b,o){try{this.style.setState(b,o)&&this._update(!0)}catch(d){c.w(`Unable to perform style diff: ${d.message||d.error||d}. Rebuilding the style from scratch.`),this._updateStyle(b,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(b,o){return this._lazyInitEmptyStyle(),this.style.addSource(b,o),this._update(!0)}isSourceLoaded(b){const o=this.style&&this.style.sourceCaches[b];if(o!==void 0)return o.loaded();this.fire(new c.j(new Error(`There is no source with ID '${b}'`)))}setTerrain(b){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),b){const o=this.style.sourceCaches[b.source];if(!o)throw new Error(`cannot load terrain, because there exists no source with ID: ${b.source}`);this.terrain===null&&o.reload();for(const d in this.style._layers){const p=this.style._layers[d];p.type==="hillshade"&&p.source===b.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ag(this.painter,o,b),this.painter.renderToTexture=new Ig(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=d=>{d.dataType==="style"?this.terrain.sourceCache.freeRtt():d.dataType==="source"&&d.tile&&(d.sourceId!==b.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(d.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:b})),this}getTerrain(){var b,o;return(o=(b=this.terrain)===null||b===void 0?void 0:b.options)!==null&&o!==void 0?o:null}areTilesLoaded(){const b=this.style&&this.style.sourceCaches;for(const o in b){const d=b[o]._tiles;for(const p in d){const m=d[p];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}removeSource(b){return this.style.removeSource(b),this._update(!0)}getSource(b){return this.style.getSource(b)}addImage(b,o,d={}){const{pixelRatio:p=1,sdf:m=!1,stretchX:y,stretchY:E,content:I,textFitWidth:M,textFitHeight:k}=d;if(this._lazyInitEmptyStyle(),!(o instanceof HTMLImageElement||c.b(o))){if(o.width===void 0||o.height===void 0)return this.fire(new c.j(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`")));{const{width:N,height:B,data:W}=o,Z=o;return this.style.addImage(b,{data:new c.R({width:N,height:B},new Uint8Array(W)),pixelRatio:p,stretchX:y,stretchY:E,content:I,textFitWidth:M,textFitHeight:k,sdf:m,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,b),this}}{const{width:N,height:B,data:W}=C.getImageData(o);this.style.addImage(b,{data:new c.R({width:N,height:B},W),pixelRatio:p,stretchX:y,stretchY:E,content:I,textFitWidth:M,textFitHeight:k,sdf:m,version:0})}}updateImage(b,o){const d=this.style.getImage(b);if(!d)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=o instanceof HTMLImageElement||c.b(o)?C.getImageData(o):o,{width:m,height:y,data:E}=p;if(m===void 0||y===void 0)return this.fire(new c.j(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`")));if(m!==d.data.width||y!==d.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(o instanceof HTMLImageElement||c.b(o));return d.data.replace(E,I),this.style.updateImage(b,d),this}getImage(b){return this.style.getImage(b)}hasImage(b){return b?!!this.style.getImage(b):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(b){this.style.removeImage(b)}loadImage(b){return se.getImage(this._requestManager.transformRequest(b,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(b,o){return this._lazyInitEmptyStyle(),this.style.addLayer(b,o),this._update(!0)}moveLayer(b,o){return this.style.moveLayer(b,o),this._update(!0)}removeLayer(b){return this.style.removeLayer(b),this._update(!0)}getLayer(b){return this.style.getLayer(b)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(b,o,d){return this.style.setLayerZoomRange(b,o,d),this._update(!0)}setFilter(b,o,d={}){return this.style.setFilter(b,o,d),this._update(!0)}getFilter(b){return this.style.getFilter(b)}setPaintProperty(b,o,d,p={}){return this.style.setPaintProperty(b,o,d,p),this._update(!0)}getPaintProperty(b,o){return this.style.getPaintProperty(b,o)}setLayoutProperty(b,o,d,p={}){return this.style.setLayoutProperty(b,o,d,p),this._update(!0)}getLayoutProperty(b,o){return this.style.getLayoutProperty(b,o)}setGlyphs(b,o={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(b,o),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(b,o,d={}){return this._lazyInitEmptyStyle(),this.style.addSprite(b,o,d,p=>{p||this._update(!0)}),this}removeSprite(b){return this._lazyInitEmptyStyle(),this.style.removeSprite(b),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(b,o={}){return this._lazyInitEmptyStyle(),this.style.setSprite(b,o,d=>{d||this._update(!0)}),this}setLight(b,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(b,o),this._update(!0)}getLight(){return this.style.getLight()}setSky(b){return this._lazyInitEmptyStyle(),this.style.setSky(b),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(b,o){return this.style.setFeatureState(b,o),this._update()}removeFeatureState(b,o){return this.style.removeFeatureState(b,o),this._update()}getFeatureState(b){return this.style.getFeatureState(b)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let b=0,o=0;return this._container&&(b=this._container.clientWidth||400,o=this._container.clientHeight||300),[b,o]}_setupContainer(){const b=this._container;b.classList.add("maplibregl-map");const o=this._canvasContainer=P.create("div","maplibregl-canvas-container",b);this._interactive&&o.classList.add("maplibregl-interactive"),this._canvas=P.create("canvas","maplibregl-canvas",o),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const d=this._containerDimensions(),p=this._getClampedPixelRatio(d[0],d[1]);this._resizeCanvas(d[0],d[1],p);const m=this._controlContainer=P.create("div","maplibregl-control-container",b),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{y[E]=P.create("div",`maplibregl-ctrl-${E} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(b,o,d){this._canvas.width=Math.floor(d*b),this._canvas.height=Math.floor(d*o),this._canvas.style.width=`${b}px`,this._canvas.style.height=`${o}px`}_setupPainter(){const b={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let o=null;this._canvas.addEventListener("webglcontextcreationerror",p=>{o={requestedAttributes:b},p&&(o.statusMessage=p.statusMessage,o.type=p.type)},{once:!0});const d=this._canvas.getContext("webgl2",b)||this._canvas.getContext("webgl",b);if(!d){const p="Failed to initialize WebGL";throw o?(o.message=p,new Error(JSON.stringify(o))):new Error(p)}this.painter=new bg(d,this.transform),D.testSupport(d)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(b){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||b,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(b){return this._update(),this._renderTaskQueue.add(b)}_cancelRenderFrame(b){this._renderTaskQueue.remove(b)}_render(b){const o=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(b),this._removed)return;let d=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const m=this.transform.zoom,y=C.now();this.style.zoomHistory.update(m,y);const E=new c.a9(m,{now:y,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),I=E.crossFadingFactor();I===1&&I===this._crossFadingFactor||(d=!0,this._crossFadingFactor=I),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.be.mark(c.bf.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||d)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0,c.be.mark(c.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var b;this._hash&&this._hash.remove();for(const d of this._controls)d.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),se.removeThrottleControl(this._imageQueueHandle),(b=this._resizeObserver)===null||b===void 0||b.disconnect();const o=this.painter.context.gl.getExtension("WEBGL_lose_context");o!=null&&o.loseContext&&o.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),P.remove(this._canvasContainer),P.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.be.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,C.frameAsync(this._frameRequest).then(b=>{c.be.frame(b),this._frameRequest=null,this._render(b)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(b){this._showTileBoundaries!==b&&(this._showTileBoundaries=b,this._update())}get showPadding(){return!!this._showPadding}set showPadding(b){this._showPadding!==b&&(this._showPadding=b,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(b){this._showCollisionBoxes!==b&&(this._showCollisionBoxes=b,b?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(b){this._showOverdrawInspector!==b&&(this._showOverdrawInspector=b,this._update())}get repaint(){return!!this._repaint}set repaint(b){this._repaint!==b&&(this._repaint=b,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(b){this._vertices=b,this._update()}get version(){return jf}getCameraTargetElevation(){return this.transform.elevation}},u.MapMouseEvent=mn,u.MapTouchEvent=Oc,u.MapWheelEvent=Tf,u.Marker=Oi,u.NavigationControl=class{constructor(b){this._updateZoomButtons=()=>{const o=this._map.getZoom(),d=o===this._map.getMaxZoom(),p=o===this._map.getMinZoom();this._zoomInButton.disabled=d,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",d.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{const o=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=o},this._setButtonTitle=(o,d)=>{const p=this._map._getUIString(`NavigationControl.${d}`);o.title=p,o.setAttribute("aria-label",p)},this.options=c.e({},$f,b),this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",o=>this._map.zoomIn({},{originalEvent:o})),P.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",o=>this._map.zoomOut({},{originalEvent:o})),P.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",o=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:o}):this._map.resetNorth({},{originalEvent:o})}),this._compassIcon=P.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(b){return this._map=b,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 Pg(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){P.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}_createButton(b,o){const d=P.create("button",b,this._container);return d.type="button",d.addEventListener("click",o),d}},u.Popup=class extends c.E{constructor(b){super(),this.remove=()=>(this._content&&P.remove(this._content),this._container&&(P.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=o=>{this._update(o.point)},this._onMouseMove=o=>{this._update(o.point)},this._onDrag=o=>{this._update(o.point)},this._update=o=>{var d;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=P.create("div","maplibregl-popup",this._map.getContainer()),this._tip=P.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Rg(this._lngLat,this._flatPos,this._map.transform):(d=this._lngLat)===null||d===void 0?void 0:d.wrap(),this._trackPointer&&!o)return;const p=this._flatPos=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&o?o:this._map.transform.locationPoint(this._lngLat));let m=this.options.anchor;const y=Ct(this.options.offset);if(!m){const I=this._container.offsetWidth,M=this._container.offsetHeight;let k;k=p.y+y.bottom.ythis._map.transform.height-M?["bottom"]:[],p.xthis._map.transform.width-I/2&&k.push("right"),m=k.length===0?"bottom":k.join("-")}let E=p.add(y[m]);this.options.subpixelPositioning||(E=E.round()),P.setTransform(this._container,`${Wf[m]} translate(${E.x}px,${E.y}px)`),Uo(this._container,m,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(io),b)}addTo(b){return this._map&&this.remove(),this._map=b,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(b){return this._lngLat=c.N.convert(b),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(b){return this.setDOMContent(document.createTextNode(b))}setHTML(b){const o=document.createDocumentFragment(),d=document.createElement("body");let p;for(d.innerHTML=b;p=d.firstChild,p;)o.appendChild(p);return this.setDOMContent(o)}getMaxWidth(){var b;return(b=this._container)===null||b===void 0?void 0:b.style.maxWidth}setMaxWidth(b){return this.options.maxWidth=b,this._update(),this}setDOMContent(b){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=P.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(b),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(b){return this._container&&this._container.classList.add(b),this}removeClassName(b){return this._container&&this._container.classList.remove(b),this}setOffset(b){return this.options.offset=b,this._update(),this}toggleClassName(b){if(this._container)return this._container.classList.toggle(b)}setSubpixelPositioning(b){this.options.subpixelPositioning=b}_createCloseButton(){this.options.closeButton&&(this._closeButton=P.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const b=this._container.querySelector(dh);b&&b.focus()}},u.RasterDEMTileSource=Ke,u.RasterTileSource=Ze,u.ScaleControl=class{constructor(b){this._onMove=()=>{Hf(this._map,this._container,this.options)},this.setUnit=o=>{this.options.unit=o,Hf(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Mg),b)}getDefaultPosition(){return"bottom-left"}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-scale",b.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){P.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},u.ScrollZoomHandler=Nf,u.Style=hr,u.TerrainControl=class{constructor(b){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=b}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=P.create("button","maplibregl-ctrl-terrain",this._container),P.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){P.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},u.TwoFingersTouchPitchHandler=Of,u.TwoFingersTouchRotateHandler=kf,u.TwoFingersTouchZoomHandler=Rf,u.TwoFingersTouchZoomRotateHandler=Lf,u.VectorTileSource=it,u.VideoSource=Rt,u.addSourceType=(b,o)=>c._(void 0,void 0,void 0,function*(){if(Kt(b))throw new Error(`A source type called "${b}" already exists.`);((d,p)=>{$t[d]=p})(b,o)}),u.clearPrewarmedResources=function(){const b=hi;b&&(b.isPreloaded()&&b.numActive()===1?(b.release(En),hi=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()"))},u.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},u.getRTLTextPluginStatus=function(){return Mi().getRTLTextPluginStatus()},u.getVersion=function(){return Nt},u.getWorkerCount=function(){return An.workerCount},u.getWorkerUrl=function(){return c.a.WORKER_URL},u.importScriptInWorkers=function(b){return Wn().broadcast("IS",b)},u.prewarm=function(){gi().acquire(En)},u.setMaxParallelImageRequests=function(b){c.a.MAX_PARALLEL_IMAGE_REQUESTS=b},u.setRTLTextPlugin=function(b,o){return Mi().setRTLTextPlugin(b,o)},u.setWorkerCount=function(b){An.workerCount=b},u.setWorkerUrl=function(b){c.a.WORKER_URL=b}});var a=i;return a})})(C3);var lX=C3.exports;const AC=dk(lX);function Wr(t,e,i,s,n){return Co(e,R3(t,e),i,s,n)}function Co(t,e,i,s,n,a){const u=Yw(e,i,s);if(n&&e!==u)throw new RangeError(JO(t,e,i,s,a));return u}function R3(t,e){const i=t[e];if(i===void 0)throw new TypeError(oS(e));return i}function ar(t){return t!==null&&/object|function/.test(typeof t)}function mo(t,e=Map){const i=new e;return(s,...n)=>{if(i.has(s))return i.get(s);const a=t(s,...n);return i.set(s,a),a}}function IC(t){return Id({name:t},1)}function Id(t,e){return fa(i=>({value:i,configurable:1,writable:!e}),t)}function cX(t){return fa(e=>({get:e,configurable:1}),t)}function gT(t){return{[Symbol.toStringTag]:{value:t,configurable:1}}}function Vd(t,e){const i={};let s=t.length;for(const n of e)i[t[--s]]=n;return i}function fa(t,e,i){const s={};for(const n in e)s[n]=t(e[n],n,i);return s}function q0(t,e,i){const s={};for(let n=0;nt(...e,...i)}function PC(t){return t[0].toUpperCase()+t.substring(1)}function Bm(t){return t.slice().sort()}function My(t,e){return String(e).padStart(t,"0")}function Gl(t,e){return Math.sign(t-e)}function Yw(t,e,i){return Math.min(Math.max(t,e),i)}function Ja(t,e){return[Math.floor(t/e),qp(t,e)]}function qp(t,e){return(t%e+e)%e}function lc(t,e){return[X0(t,e),_T(t,e)]}function X0(t,e){return Math.trunc(t/e)||0}function _T(t,e){return t%e||0}function P_(t){return Math.abs(t%1)===.5}function D3(t,e,i){let s=0,n=0;for(let c=0;c<=e;c++){const _=t[i[c]],w=pa[c],S=Is/w,[C,P]=lc(_,S);s+=P*w,n+=C}const[a,u]=lc(s,Is);return[n+a,u]}function Z0(t,e,i){const s={};for(let n=e;n>=0;n--){const a=pa[n];s[i[n]]=X0(t,a),t=_T(t,a)}return s}function dX(t){return t===Ri?Sb:[]}function fX(t){return t===Ri?jm:[]}function pX(t){return t===Ri?["year","day"]:[]}function mX(t){if(t!==void 0)return Sn(t)}function gX(t){if(t!==void 0)return oa(t)}function F3(t){if(t!==void 0)return K0(t)}function oa(t){return L3(K0(t))}function K0(t){return B3(BK(t))}function RC(t){if(t==null)throw new TypeError("Cannot be null or undefined");return t}function N3(t,e){if(e==null)throw new RangeError(oS(t));return e}function mc(t){if(!ar(t))throw new TypeError(YO);return t}function Y0(t,e,i=t){if(typeof e!==t)throw new TypeError(Um(i,e));return e}function B3(t,e="number"){if(!Number.isInteger(t))throw new RangeError(iK(e,t));return t||0}function L3(t,e="number"){if(t<=0)throw new RangeError(sK(e,t));return t}function yT(t){if(typeof t=="symbol")throw new TypeError(aK);return String(t)}function ky(t,e){return ar(t)?String(t):Sn(t,e)}function J0(t){if(typeof t=="string")return BigInt(t);if(typeof t!="bigint")throw new TypeError(oK(t));return t}function z3(t,e="number"){if(typeof t=="bigint")throw new TypeError(rK(e));if(t=Number(t),!Number.isFinite(t))throw new RangeError(nK(e,t));return t}function xr(t,e){return Math.trunc(z3(t,e))||0}function U3(t,e){return B3(z3(t,e),e)}function MC(t,e){return L3(xr(t,e),e)}function bT(t,e){let[i,s]=lc(e,Is),n=t+i;const a=Math.sign(n);return a&&a===-Math.sign(s)&&(n-=a,s+=a*Is),[n,s]}function Cd(t,e,i=1){return bT(t[0]+e[0]*i,t[1]+e[1]*i)}function Pd(t,e){return bT(t[0],t[1]+e)}function Mo(t,e){return Cd(e,t,-1)}function Yr(t,e){return Gl(t[0],e[0])||Gl(t[1],e[1])}function V3(t,e,i){return Yr(t,e)===-1||Yr(t,i)===1}function G0(t,e=1){const i=BigInt(Is/e);return[Number(t/i),Number(t%i)*e]}function gm(t,e=1){const i=Is/e,[s,n]=lc(t,i);return[s,n*e]}function j3(t,e=1){const[i,s]=t,n=Math.floor(s/e),a=Is/e;return BigInt(i)*BigInt(a)+BigInt(n)}function ko(t,e=1,i){const[s,n]=t,[a,u]=lc(n,e);return s*(Is/e)+(a+(i?u/e:0))}function vT(t,e,i=Ja){const[s,n]=t,[a,u]=i(n,e);return[s*(Is/e)+a,u]}function xT(t,e){const i=t.formatToParts(e),s={};for(const n of i)s[n.type]=n.value;return s}function wT(t){return Wr(t,"isoYear",xm,vm,1),t.isoYear===xm?Wr(t,"isoMonth",4,12,1):t.isoYear===vm&&Wr(t,"isoMonth",1,9,1),t}function Ql(t){return nl({...t,...ma,isoHour:12}),t}function nl(t){const e=Wr(t,"isoYear",xm,vm,1),i=e===xm?1:e===vm?-1:0;return i&&yo(wr({...t,isoDay:t.isoDay+i,isoNanosecond:t.isoNanosecond-i})),t}function yo(t){if(!t||V3(t,HK,WK))throw new RangeError(bb);return t}function cc(t){return D3(t,5,ya)[1]}function Q0(t){const[e,i]=Ja(t,Is);return[Z0(i,5,ya),e]}function $3(t){return W3(t)[0]}function W3(t){return vT(t,Ro)}function Sr(t){return jd(t.isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond,t.isoMillisecond)}function wr(t){const e=Sr(t);if(e!==void 0){const[i,s]=lc(e,Kr);return[i,s*rl+(t.isoMicrosecond||0)*ju+(t.isoNanosecond||0)]}}function TT(t,e){const[i,s]=Q0(cc(t)-e);return yo(wr({...t,isoDay:t.isoDay+s,...i}))}function Oy(...t){return jd(...t)/nD}function jd(...t){const[e,i]=H3(...t),s=e.valueOf();if(!isNaN(s))return s-i*Kr}function H3(t,e=1,i=1,s=0,n=0,a=0,u=0){const c=t===xm?1:t===vm?-1:0,_=new Date;return _.setUTCHours(s,n,a,u),_.setUTCFullYear(t,e-1,i+c),[_,c]}function Fu(t,e){let[i,s]=Pd(t,e);s<0&&(s+=Is,i-=1);const[n,a]=Ja(s,rl),[u,c]=Ja(a,ju);return eb(i*Kr+n,u,c)}function eb(t,e=0,i=0){const s=Math.ceil(Math.max(0,Math.abs(t)-$K)/Kr)*Math.sign(t),n=new Date(t-s*Kr);return Vd(Ab,[n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()+s,n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds(),e,i])}function q3(t){return[t.isoYear,t.isoMonth,t.isoDay]}function X3(){return Wa}function ST(t,e){switch(e){case 2:return ET(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Z3(t){return ET(t)?366:365}function ET(t){return t%4==0&&(t%100!=0||t%400==0)}function K3(t){const[e,i]=H3(t.isoYear,t.isoMonth,t.isoDay);return qp(e.getUTCDay()-i,7)||7}function Y3({isoYear:t}){return t<1?["bce",1-t]:["ce",t]}function _X(t){const e=Sr(t);if(eS<4?(S+2)%4:S)(_)),[u,w,c,_]}function nb(t,e=6,i){let s=CT(t=RT(t,zy));const n=Wm(t,7);let a=$m(t,e);return a=N3(zy,a),s=PT(s,a,void 0,i),[a,s,n]}function AT(t){return yS(Fo(t))}function Q3(t,e){return IT(Fo(t),e)}function IT(t,e=4){const i=tO(t);return[Wm(t,4),...eO($m(t,e),i)]}function eO(t,e){return t!=null?[pa[t],t<4?9-3*t:-1]:[e===void 0?1:10**(9-e),e]}function CT(t){const e=t[Xp];return e===void 0?1:xr(e,Xp)}function PT(t,e,i,s){const n=s?Is:pa[e+1];if(n){const a=pa[e];if(n%((t=Co(Xp,t,1,n/a-(s?0:1),1))*a))throw new RangeError(Um(Xp,t))}else t=Co(Xp,t,1,i?10**9:1,1);return t}function tO(t){let e=t[Fx];if(e!==void 0){if(typeof e!="number"){if(yT(e)==="auto")return;throw new RangeError(Um(Fx,e))}e=Co(Fx,Math.floor(e),0,9,1)}return e}function Fo(t){return t===void 0?{}:mc(t)}function RT(t,e){return typeof t=="string"?{[e]:t}:mc(t)}function $n(t){if(t!==void 0){if(ar(t))return Object.assign(Object.create(null),t);throw new TypeError(YO)}}function rb(t,e){return t&&Object.assign(Object.create(null),t,{overflow:KK[e]})}function MT(t,e,i=9,s=0,n){let a=e[t];if(a===void 0)return n?s:void 0;if(a=yT(a),a==="auto")return n?s:null;let u=e1[a];if(u===void 0&&(u=VK[a]),u===void 0)throw new RangeError(eD(t,a,e1));return Co(t,u,s,i,1,xb),u}function Bu(t,e,i,s=0){const n=i[t];if(n===void 0)return s;const a=yT(n),u=e[a];if(u===void 0)throw new RangeError(eD(t,a,e));return u}function iO(t,e){if(e>t)throw new RangeError(PK)}function rr(t){return{branding:vS,epochNanoseconds:t}}function Er(t,e,i){return{branding:xc,calendar:i,timeZone:e,epochNanoseconds:t}}function Un(t,e=t.calendar){return{branding:Qd,calendar:e,..._o(mD,t)}}function Vn(t,e=t.calendar){return{branding:Gd,calendar:e,..._o(mS,t)}}function Iu(t,e=t.calendar){return{branding:wm,calendar:e,..._o(mS,t)}}function Dy(t,e=t.calendar){return{branding:Tm,calendar:e,..._o(mS,t)}}function ga(t){return{branding:bS,..._o(pD,t)}}function pn(t){return{branding:xS,sign:gc(t),..._o(hS,t)}}function bX(t){return $3(t.epochNanoseconds)}function kT(t){return vT(t.epochNanoseconds,rl)[0]}function vX(t){return j3(t.epochNanoseconds,ju)}function xX(t){return j3(t.epochNanoseconds)}function sO(t){return t.epochNanoseconds}function Ar(t){return typeof t=="string"?t:Sn(t.id)}function Wd(t,e){return t===e||Ar(t)===Ar(e)}function wX(t,e,i,s,n){const a=Cu(s),[u,c]=((H,te)=>{const G=te((H=RT(H,s1))[_D]);let se=iY(H);return se=N3(s1,se),[se,G]})(n,t);if(ym(Math.max(u,a),c))return OC(s,u);if(!c)throw new RangeError(vb);const[_,w,S]=ub(e,i,c),C=VT(S),P=hb(S),D=jT(S),j=P(w,_,s),L=D(w,_,j,u);return ym(u,c)?OC(L,u):((H,te,G,se,ve,Se,ge)=>{const De=gc(H),[Fe,Be]=OT(se,fS(G,H),G,De,ve,Se,ge),Qe=DT(te,Fe,Be);return H[hs[G]]+Qe*De})(L,C(j),u,w,_,C,P)}function OC(t,e){return ko(jn(t),pa[e],1)}function OT(t,e,i,s,n,a,u){const c=hs[i],_={...e,[c]:e[c]+s},w=u(t,n,e),S=u(t,n,_);return[a(w),a(S)]}function DT(t,e,i){const s=ko(Mo(e,i));if(!s)throw new RangeError(Vm);return ko(Mo(e,t))/s}function TX(t,e){const[i,s,n]=nb(e,5,1);return rr(ab(t.epochNanoseconds,i,s,n,1))}function SX(t,e,i){let{epochNanoseconds:s,timeZone:n,calendar:a}=e;const[u,c,_]=nb(i);if(u===0&&c===1)return e;const w=t(n);if(u===6)s=((S,C,P,D)=>{const j=Jr(P,C),[L,H]=S(j),te=P.epochNanoseconds,G=go(C,L),se=go(C,H);if(V3(te,G,se))throw new RangeError(Vm);return lO(DT(te,G,se),D)?se:G})(oO,w,e,_);else{const S=w.getOffsetNanosecondsFor(s);s=Lu(w,nO(Fu(s,S),u,c,_),S,2,0,1)}return Er(s,n,a)}function EX(t,e){return Un(nO(t,...nb(e)),t.calendar)}function AX(t,e){const[i,s,n]=nb(e,5);var a;return ga((a=n,FT(t,Lm(i,s),a)[0]))}function IX(t,e){const i=t(e.timeZone),s=Jr(e,i),[n,a]=oO(s),u=ko(Mo(go(i,n),go(i,a)),Tb,1);if(u<=0)throw new RangeError(Vm);return u}function CX(t,e){const{timeZone:i,calendar:s}=e,n=((a,u,c)=>go(u,a(Jr(c,u))))(aO,t(i),e);return Er(n,i,s)}function nO(t,e,i,s){return rO(t,Lm(e,i),s)}function rO(t,e,i){const[s,n]=FT(t,e,i);return nl({...zu(t,n),...s})}function FT(t,e,i){return Q0(uc(cc(t),e,i))}function Fy(t){return uc(t,wb,7)}function Lm(t,e){return pa[t]*e}function oO(t){const e=aO(t);return[e,zu(e,1)]}function aO(t){return jK(6,t)}function PX(t,e,i){const s=Math.min(Cu(t),6);return Xd(lb(jn(t,s),e,i),s)}function ob(t,e,i,s,n,a,u,c,_,w){if(s===0&&n===1)return t;const S=ym(s,c)?db(c)&&s<6&&i>=6?MX:RX:kX;let[C,P,D]=S(t,e,i,s,n,a,u,c,_,w);return D&&s!==7&&(C=((j,L,H,te,G,se,ve,Se)=>{const ge=gc(j);for(let De=te+1;De<=H;De++){if(De===7&&H!==7)continue;const Fe=fS(De,j);Fe[hs[De]]+=ge;const Be=ko(Mo(ve(Se(G,se,Fe)),L));if(Be&&Math.sign(Be)!==ge)break;j=Fe}return j})(C,P,i,Math.max(6,s),u,c,_,w)),C}function ab(t,e,i,s,n){if(e===6){const a=(u=>u[0]+u[1]/Is)(t);return[uc(a,i,s),0]}return lb(t,Lm(e,i),s,n)}function lb(t,e,i,s){let[n,a]=t;s&&a<0&&(a+=Is,n-=1);const[u,c]=Ja(uc(a,e,i),Is);return bT(n+u,c)}function uc(t,e,i){return lO(t/e,i)*e}function lO(t,e){return oY[e](t)}function RX(t,e,i,s,n,a){const u=gc(t),c=jn(t),_=ab(c,s,n,a),w=Mo(c,_),S=Math.sign(_[0]-c[0])===u,C=Xd(_,Math.min(i,6));return[{...t,...C},Cd(e,w),S]}function MX(t,e,i,s,n,a,u,c,_,w){const S=gc(t),C=ko(jn(t,5)),P=Lm(s,n);let D=uc(C,P,a);const[j,L]=OT(u,{...t,...dS},6,S,c,_,w),H=D-ko(Mo(j,L));let te=0;H&&Math.sign(H)!==S?e=Pd(j,D):(te+=S,D=uc(H,P,a),e=Pd(L,D));const G=fb(D);return[{...t,...G,days:t.days+te},e,!!te]}function kX(t,e,i,s,n,a,u,c,_,w){const S=gc(t),C=hs[s],P=fS(s,t);s===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const D=X0(t[C],n)*n;P[C]=D;const[j,L]=OT(u,P,s,n*S,c,_,w),H=D+DT(e,j,L)*S*n,te=uc(H,n,a),G=Math.sign(te-H)===S;return P[C]=te,[P,G?L:j,G]}function DC(t,e,i,s){const[n,a,u,c]=(w=>{const S=IT(w=Fo(w));return[w.timeZone,...S]})(s),_=n!==void 0;return((w,S,C,P,D,j)=>{C=lb(C,D,P,1);const L=S.getOffsetNanosecondsFor(C);return NT(Fu(C,L),j)+(w?Hd(Fy(L)):"Z")})(_,e(_?t(n):$u),i.epochNanoseconds,a,u,c)}function FC(t,e,i){const[s,n,a,u,c,_]=(w=>{w=Fo(w);const S=yS(w),C=tO(w),P=rY(w),D=Wm(w,4),j=$m(w,4);return[S,nY(w),P,D,...eO(j,C)]})(i);return((w,S,C,P,D,j,L,H,te,G)=>{P=lb(P,te,H,1);const se=w(C).getOffsetNanosecondsFor(P);return NT(Fu(P,se),G)+Hd(Fy(se),L)+((ve,Se)=>Se!==1?"["+(Se===2?"!":"")+Ar(ve)+"]":"")(C,j)+BT(S,D)})(t,e.calendar,e.timeZone,e.epochNanoseconds,s,n,a,u,c,_)}function NC(t,e){const[i,s,n,a]=(w=>(w=Fo(w),[yS(w),...IT(w)]))(e);return u=t.calendar,c=i,_=a,NT(rO(t,n,s),_)+BT(u,c);var u,c,_}function BC(t,e){return i=t.calendar,s=t,n=AT(e),Ny(s)+BT(i,n);var i,s,n}function LC(t,e){return cO(t.calendar,uO,t,AT(e))}function zC(t,e){return cO(t.calendar,OX,t,AT(e))}function UC(t,e){const[i,s,n]=Q3(e);return a=n,hO(FT(t,s,i)[0],a);var a}function Mx(t,e){const[i,s,n]=Q3(e,3);return s>1&&(t={...t,...PX(t,s,i)}),((a,u)=>{const{sign:c}=a,_=c===-1?Ir(a):a,{hours:w,minutes:S}=_,[C,P]=vT(jn(_,3),Ro,lc);_O(C);const D=LT(P,u),j=u>=0||!c||D;return(c<0?"-":"")+"P"+VC({Y:Qc(_.years),M:Qc(_.months),W:Qc(_.weeks),D:Qc(_.days)})+(w||S||C||j?"T"+VC({H:Qc(w),M:Qc(S),S:Qc(C,j)+D}):"")})(t,n)}function cO(t,e,i,s){const n=Ar(t),a=s>1||s===0&&n!==Ri;return s===1?n===Ri?e(i):Ny(i):a?Ny(i)+dO(n,s===2):e(i)}function VC(t){const e=[];for(const i in t){const s=t[i];s&&e.push(s,i)}return e.join("")}function NT(t,e){return Ny(t)+"T"+hO(t,e)}function Ny(t){return uO(t)+"-"+Po(t.isoDay)}function uO(t){const{isoYear:e}=t;return(e<0||e>9999?fO(e)+My(6,Math.abs(e)):My(4,e))+"-"+Po(t.isoMonth)}function OX(t){return Po(t.isoMonth)+"-"+Po(t.isoDay)}function hO(t,e){const i=[Po(t.isoHour),Po(t.isoMinute)];return e!==-1&&i.push(Po(t.isoSecond)+((s,n,a,u)=>LT(s*rl+n*ju+a,u))(t.isoMillisecond,t.isoMicrosecond,t.isoNanosecond,e)),i.join(":")}function Hd(t,e=0){if(e===1)return"";const[i,s]=Ja(Math.abs(t),Tb),[n,a]=Ja(s,wb),[u,c]=Ja(a,Ro);return fO(t)+Po(i)+":"+Po(n)+(u||c?":"+Po(u)+LT(c):"")}function BT(t,e){if(e!==1){const i=Ar(t);if(e>1||e===0&&i!==Ri)return dO(i,e===2)}return""}function dO(t,e){return"["+(e?"!":"")+"u-ca="+t+"]"}function LT(t,e){let i=My(9,t);return i=e===void 0?i.replace(cY,""):i.slice(0,e),i?"."+i:""}function fO(t){return t<0?"-":"+"}function Qc(t,e){return t||e?t.toLocaleString("fullwide",{useGrouping:0}):""}function DX(t,e){const{epochNanoseconds:i}=t,s=(e.getOffsetNanosecondsFor?e:e(t.timeZone)).getOffsetNanosecondsFor(i),n=Fu(i,s);return{calendar:t.calendar,...n,offsetNanoseconds:s}}function FX(t,e){const i=Jr(e,t);return{calendar:e.calendar,..._o(mD,i),offset:Hd(i.offsetNanoseconds),timeZone:e.timeZone}}function Lu(t,e,i,s=0,n=0,a,u){if(i!==void 0&&s===1&&(s===1||u))return TT(e,i);const c=t.getPossibleInstantsFor(e);if(i!==void 0&&s!==3){const _=((w,S,C,P)=>{const D=wr(S);P&&(C=Fy(C));for(const j of w){let L=ko(Mo(j,D));if(P&&(L=Fy(L)),L===C)return j}})(c,e,i,a);if(_!==void 0)return _;if(s===0)throw new RangeError(TK)}return u?wr(e):go(t,e,n,c)}function go(t,e,i=0,s=t.getPossibleInstantsFor(e)){if(s.length===1)return s[0];if(i===1)throw new RangeError(SK);if(s.length)return s[i===3?1:0];const n=wr(e),a=((c,_)=>{const w=c.getOffsetNanosecondsFor(Pd(_,-Is));return mO(c.getOffsetNanosecondsFor(Pd(_,Is))-w)})(t,n),u=a*(i===2?-1:1);return(s=t.getPossibleInstantsFor(Fu(n,u)))[i===2?0:s.length-1]}function pO(t){if(Math.abs(t)>=Is)throw new RangeError(xK);return t}function mO(t){if(t>Is)throw new RangeError(wK);return t}function jC(t,e,i){return rr(yo(Cd(e.epochNanoseconds,(s=>{if(yO(s))throw new RangeError(IK);return jn(s,5)})(t?Ir(i):i))))}function $C(t,e,i,s,n,a=Object.create(null)){const u=e(s.timeZone),c=t(s.calendar);return{...s,...zT(u,c,s,i?Ir(n):n,a)}}function WC(t,e,i,s,n=Object.create(null)){const{calendar:a}=i;return Un(UT(t(a),i,e?Ir(s):s,n),a)}function HC(t,e,i,s,n){const{calendar:a}=i;return Vn(cb(t(a),i,e?Ir(s):s,n),a)}function qC(t,e,i,s,n=Object.create(null)){const a=i.calendar,u=t(a);let c=_m(u,i);e&&(s=$T(s)),s.sign<0&&(c=u.dateAdd(c,{...or,months:1}),c=zu(c,-1));const _=u.dateAdd(c,s,n);return Iu(_m(u,_),a)}function XC(t,e,i){return ga(gO(e,t?Ir(i):i)[0])}function zT(t,e,i,s,n){const a=jn(s,5);let u=i.epochNanoseconds;if(yO(s)){const c=Jr(i,t);u=Cd(go(t,{...cb(e,c,{...s,...dS},n),..._o(ya,c)}),a)}else u=Cd(u,a),rs(n);return{epochNanoseconds:yo(u)}}function UT(t,e,i,s){const[n,a]=gO(e,i);return nl({...cb(t,e,{...i,...dS,days:i.days+a},s),...n})}function cb(t,e,i,s){if(i.years||i.months||i.weeks)return t.dateAdd(e,i,s);rs(s);const n=i.days+jn(i,5)[0];return n?Ql(zu(e,n)):e}function _m(t,e,i=1){return zu(e,i-t.day(e))}function gO(t,e){const[i,s]=jn(e,5),[n,a]=Q0(cc(t)+s);return[n,i+a]}function zu(t,e){return e?{...t,...eb(Sr(t)+e*Kr)}:t}function ub(t,e,i){const s=t(i.calendar);return db(i)?[i,s,e(i.timeZone)]:[{...i,...ma},s]}function VT(t){return t?sO:wr}function hb(t){return t?Ai(zT,t):UT}function jT(t){return t?Ai(rZ,t):oZ}function db(t){return t&&t.epochNanoseconds}function ym(t,e){return t<=6-(db(e)?1:0)}function ZC(t,e,i,s,n,a,u){const c=t(Fo(u).relativeTo),_=Math.max(Cu(n),Cu(a));if(ym(_,c))return pn(qd(((L,H,te,G)=>{const se=Cd(jn(L),jn(H),G?-1:1);if(!Number.isFinite(se[0]))throw new RangeError(bb);return{...or,...Xd(se,te)}})(n,a,_,s)));if(!c)throw new RangeError(vb);s&&(a=Ir(a));const[w,S,C]=ub(e,i,c),P=hb(C),D=jT(C),j=P(S,w,n);return pn(D(S,w,P(S,j,a),_))}function NX(t,e,i,s,n){const a=Cu(s),[u,c,_,w,S]=((ge,De,Fe)=>{ge=RT(ge,zy);let Be=_S(ge);const Qe=Fe(ge[_D]);let He=CT(ge);const Xe=Wm(ge,7);let dt=$m(ge);if(Be===void 0&&dt===void 0)throw new RangeError(CK);return dt==null&&(dt=0),Be==null&&(Be=Math.max(dt,De)),iO(Be,dt),He=PT(He,dt,1),[Be,dt,He,Xe,Qe]})(n,a,t),C=Math.max(a,u);if(!db(S)&&C<=6)return pn(qd(((ge,De,Fe,Be,Qe)=>{const He=ab(jn(ge),Fe,Be,Qe);return{...or,...Xd(He,De)}})(s,u,c,_,w)));if(!S)throw new RangeError(vb);const[P,D,j]=ub(e,i,S),L=VT(j),H=hb(j),te=jT(j),G=H(D,P,s);let se=te(D,P,G,u);const ve=s.sign,Se=gc(se);if(ve&&Se&&ve!==Se)throw new RangeError(Vm);return Se&&(se=ob(se,L(G),u,c,_,w,D,P,L,H)),pn(se)}function BX(t){return t.sign===-1?$T(t):t}function $T(t){return pn(Ir(t))}function Ir(t){const e={};for(const i of hs)e[i]=-1*t[i]||0;return e}function LX(t){return!t.sign}function gc(t,e=hs){let i=0;for(const s of e){const n=Math.sign(t[s]);if(n){if(i&&i!==n)throw new RangeError(AK);i=n}}return i}function qd(t){for(const e of UK)Co(e,t[e],-cP,cP,1);return _O(ko(jn(t),Ro)),t}function _O(t){if(!Number.isSafeInteger(t))throw new RangeError(EK)}function jn(t,e=6){return D3(t,e,hs)}function Xd(t,e=6){const[i,s]=t,n=Z0(s,e,hs);if(n[hs[e]]+=i*(Is/pa[e]),!Number.isFinite(n[hs[e]]))throw new RangeError(bb);return n}function fb(t,e=5){return Z0(t,e,hs)}function yO(t){return!!gc(t,fD)}function Cu(t){let e=9;for(;e>0&&!t[hs[e]];e--);return e}function zX(t,e){return[t,e]}function KC(t){const e=Math.floor(t/q_)*q_;return[e,e+q_]}function UX(t){const e=_c(t=ky(t));if(!e)throw new RangeError(Zr(t));let i;if(e.m)i=0;else{if(!e.offset)throw new RangeError(Zr(t));i=Zd(e.offset)}return e.timeZone&&ZT(e.timeZone,1),rr(TT(tb(e),i))}function VX(t){const e=_c(Sn(t));if(!e)throw new RangeError(Zr(t));if(e.timeZone)return bO(e,e.offset?Zd(e.offset):void 0);if(e.m)throw new RangeError(Zr(t));return xO(e)}function jX(t,e){const i=_c(Sn(t));if(!i||!i.timeZone)throw new RangeError(Zr(t));const{offset:s}=i,n=s?Zd(s):void 0,[,a,u]=sb(e);return bO(i,n,a,u)}function Zd(t){const e=ZT(t);if(e===void 0)throw new RangeError(Zr(t));return e}function $X(t){const e=_c(Sn(t));if(!e||e.m)throw new RangeError(Zr(t));return Un(vO(e))}function WT(t){const e=_c(Sn(t));if(!e||e.m)throw new RangeError(Zr(t));return Vn(e.p?vO(e):xO(e))}function WX(t,e){const i=qT(Sn(e));if(i)return HT(i),Iu(wT(Nu(i)));const s=WT(e);return Iu(_m(t(s.calendar),s))}function HT(t){if(t.calendar!==Ri)throw new RangeError(Ga(t.calendar))}function HX(t,e){const i=XT(Sn(e));if(i)return HT(i),Dy(Nu(i));const s=WT(e),{calendar:n}=s,a=t(n),[u,c,_]=a.h(s),[w,S]=a.I(u,c),[C,P]=a.N(w,S,_);return Dy(Ql(a.P(C,P,_)),n)}function qX(t){let e,i=(s=>{const n=gY.exec(s);return n?(pb(n[10]),SO(n)):void 0})(Sn(t));if(!i){if(i=_c(t),!i)throw new RangeError(Zr(t));if(!i.p)throw new RangeError(Zr(t));if(i.m)throw new RangeError(Ga("Z"));HT(i)}if((e=qT(t))&&kC(e))throw new RangeError(Zr(t));if((e=XT(t))&&kC(e))throw new RangeError(Zr(t));return ga(ib(i,1))}function XX(t){const e=(i=>{const s=bY.exec(i);return s?(n=>{function a(S,C,P){let D=0,j=0;if(P&&([D,_]=Ja(_,pa[P])),S!==void 0){if(c)throw new RangeError(Ga(S));j=(L=>{const H=parseInt(L);if(!Number.isFinite(H))throw new RangeError(Ga(L));return H})(S),u=1,C&&(_=KT(C)*(pa[P]/Ro),c=1)}return D+j}let u=0,c=0,_=0,w={...Vd(hs,[a(n[2]),a(n[3]),a(n[4]),a(n[5]),a(n[6],n[7],5),a(n[8],n[9],4),a(n[10],n[11],3)]),...Z0(_,2,hs)};if(!u)throw new RangeError(QO(hs));return YT(n[1])<0&&(w=Ir(w)),w})(s):void 0})(Sn(t));if(!e)throw new RangeError(Zr(t));return pn(qd(e))}function ZX(t){const e=_c(t)||qT(t)||XT(t);return e?e.calendar:t}function KX(t){const e=_c(t);return e&&(e.timeZone||e.m&&$u||e.offset)||t}function bO(t,e,i=0,s=0){const n=JT(t.timeZone),a=wS(n);return Er(Lu(a,tb(t),e,i,s,!a.v,t.m),n,yb(t.calendar))}function vO(t){return wO(nl(tb(t)))}function xO(t){return wO(Ql(Nu(t)))}function wO(t){return{...t,calendar:yb(t.calendar)}}function _c(t){const e=mY.exec(t);return e?(i=>{const s=i[10],n=(s||"").toUpperCase()==="Z";return{isoYear:TO(i),isoMonth:parseInt(i[4]),isoDay:parseInt(i[5]),...SO(i.slice(5)),...pb(i[16]),p:!!i[6],m:n,offset:n?void 0:s}})(e):void 0}function qT(t){const e=fY.exec(t);return e?(i=>({isoYear:TO(i),isoMonth:parseInt(i[4]),isoDay:1,...pb(i[5])}))(e):void 0}function XT(t){const e=pY.exec(t);return e?(i=>({isoYear:Md,isoMonth:parseInt(i[1]),isoDay:parseInt(i[2]),...pb(i[3])}))(e):void 0}function ZT(t,e){const i=_Y.exec(t);return i?((s,n)=>{const a=s[4]||s[5];if(n&&a)throw new RangeError(Ga(a));return pO((pd(s[2])*Tb+pd(s[3])*wb+pd(s[4])*Ro+KT(s[5]||""))*YT(s[1]))})(i,e):void 0}function TO(t){const e=YT(t[1]),i=parseInt(t[2]||t[3]);if(e<0&&!i)throw new RangeError(Ga(-0));return e*i}function SO(t){const e=pd(t[3]);return{...Q0(KT(t[4]||""))[0],isoHour:pd(t[1]),isoMinute:pd(t[2]),isoSecond:e===60?59:e}}function pb(t){let e,i;const s=[];if(t.replace(yY,(n,a,u)=>{const c=!!a,[_,w]=u.split("=").reverse();if(w){if(w==="u-ca")s.push(_),e||(e=c);else if(c||/[A-Z]/.test(w))throw new RangeError(Ga(n))}else{if(i)throw new RangeError(Ga(n));i=_}return""}),s.length>1&&e)throw new RangeError(Ga(t));return{timeZone:i,calendar:s[0]||Ri}}function KT(t){return parseInt(t.padEnd(9,"0"))}function Kd(t){return new RegExp(`^${t}$`,"i")}function YT(t){return t&&t!=="+"?-1:1}function pd(t){return t===void 0?0:parseInt(t)}function YX(t){return JT(Sn(t))}function JT(t){const e=GT(t);return typeof e=="number"?Hd(e):e?(i=>{if(xY.test(i))throw new RangeError(vK);return i.toLowerCase().split("/").map((s,n)=>(s.length<=3||/\d/.test(s))&&!/etc|yap/.test(s)?s.toUpperCase():s.replace(/baja|dumont|[a-z]+/g,(a,u)=>a.length<=2&&!n||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!u?PC(a).replace(/island|noronha|murdo|rivadavia|urville/,PC):a)).join("/")})(t):$u}function YC(t){const e=GT(t);return typeof e=="number"?e:e?e.resolvedOptions().timeZone:$u}function GT(t){const e=ZT(t=t.toUpperCase(),1);return e!==void 0?e:t!==$u?vY(t):void 0}function EO(t,e){return Yr(t.epochNanoseconds,e.epochNanoseconds)}function AO(t,e){return Yr(t.epochNanoseconds,e.epochNanoseconds)}function JX(t,e,i,s,n,a){const u=t(Fo(a).relativeTo),c=Math.max(Cu(s),Cu(n));if(k3(hs,s,n))return 0;if(ym(c,u))return Yr(jn(s),jn(n));if(!u)throw new RangeError(vb);const[_,w,S]=ub(e,i,u),C=VT(S),P=hb(S);return Yr(C(P(w,_,s)),C(P(w,_,n)))}function IO(t,e){return Yd(t,e)||QT(t,e)}function Yd(t,e){return Gl(Sr(t),Sr(e))}function QT(t,e){return Gl(cc(t),cc(e))}function GX(t,e){return!EO(t,e)}function QX(t,e){return!AO(t,e)&&!!eS(t.timeZone,e.timeZone)&&Wd(t.calendar,e.calendar)}function eZ(t,e){return!IO(t,e)&&Wd(t.calendar,e.calendar)}function tZ(t,e){return!Yd(t,e)&&Wd(t.calendar,e.calendar)}function iZ(t,e){return!Yd(t,e)&&Wd(t.calendar,e.calendar)}function sZ(t,e){return!Yd(t,e)&&Wd(t.calendar,e.calendar)}function nZ(t,e){return!QT(t,e)}function eS(t,e){if(t===e)return 1;const i=Ar(t),s=Ar(e);if(i===s)return 1;try{return YC(i)===YC(s)}catch{}}function JC(t,e,i,s){const n=$d(t,$n(s),3,5),a=mb(e.epochNanoseconds,i.epochNanoseconds,...n);return pn(t?Ir(a):a)}function GC(t,e,i,s,n,a){const u=_b(s.calendar,n.calendar),c=$n(a),[_,w,S,C]=$d(i,c,5),P=s.epochNanoseconds,D=n.epochNanoseconds,j=Yr(D,P);let L;if(j)if(_<6)L=mb(P,D,_,w,S,C);else{const H=e(((G,se)=>{if(!eS(G,se))throw new RangeError(iD);return G})(s.timeZone,n.timeZone)),te=t(u);L=PO(te,H,s,n,j,_,c),L=ob(L,D,_,w,S,C,te,s,sO,Ai(zT,H))}else L=or;return pn(i?Ir(L):L)}function QC(t,e,i,s,n){const a=_b(i.calendar,s.calendar),u=$n(n),[c,_,w,S]=$d(e,u,6),C=wr(i),P=wr(s),D=Yr(P,C);let j;if(D)if(c<=6)j=mb(C,P,c,_,w,S);else{const L=t(a);j=RO(L,i,s,D,c,u),j=ob(j,P,c,_,w,S,L,i,wr,UT)}else j=or;return pn(e?Ir(j):j)}function eP(t,e,i,s,n){const a=_b(i.calendar,s.calendar),u=$n(n);return CO(e,()=>t(a),i,s,...$d(e,u,6,9,6),u)}function tP(t,e,i,s,n){const a=_b(i.calendar,s.calendar),u=$n(n),c=$d(e,u,9,9,8),_=t(a);return CO(e,()=>_,_m(_,i),_m(_,s),...c,u)}function CO(t,e,i,s,n,a,u,c,_){const w=wr(i),S=wr(s);let C;if(Yr(S,w))if(n===6)C=mb(w,S,n,a,u,c);else{const P=e();C=P.dateUntil(i,s,n,_),a===6&&u===1||(C=ob(C,S,n,a,u,c,P,i,wr,cb))}else C=or;return pn(t?Ir(C):C)}function iP(t,e,i,s){const n=$n(s),[a,u,c,_]=$d(t,n,5,5),w=uc(tS(e,i),Lm(u,c),_),S={...or,...fb(w,a)};return pn(t?Ir(S):S)}function rZ(t,e,i,s,n,a){const u=Yr(s.epochNanoseconds,i.epochNanoseconds);return u?n<6?MO(i.epochNanoseconds,s.epochNanoseconds,n):PO(e,t,i,s,u,n,a):or}function oZ(t,e,i,s,n){const a=wr(e),u=wr(i),c=Yr(u,a);return c?s<=6?MO(a,u,s):RO(t,e,i,c,s,n):or}function PO(t,e,i,s,n,a,u){const[c,_,w]=((P,D,j,L)=>{function H(){return De={...zu(se,Se++*-L),...G},Fe=go(P,De),Yr(ve,Fe)===-L}const te=Jr(D,P),G=_o(ya,te),se=Jr(j,P),ve=j.epochNanoseconds;let Se=0;const ge=tS(te,se);let De,Fe;if(Math.sign(ge)===-L&&Se++,H()&&(L===-1||H()))throw new RangeError(Vm);const Be=ko(Mo(Fe,ve));return[te,De,Be]})(e,i,s,n);var S,C;return{...a===6?(S=c,C=_,{...or,days:kO(S,C)}):t.dateUntil(c,_,a,u),...fb(w)}}function RO(t,e,i,s,n,a){const[u,c,_]=((w,S,C)=>{let P=S,D=tS(w,S);return Math.sign(D)===-C&&(P=zu(S,-C),D+=Is*C),[w,P,D]})(e,i,s);return{...t.dateUntil(u,c,n,a),...fb(_)}}function mb(t,e,i,s,n,a){return{...or,...Xd(ab(Mo(t,e),s,n,a),i)}}function MO(t,e,i){return{...or,...Xd(Mo(t,e),i)}}function kO(t,e){return gb(Sr(t),Sr(e))}function gb(t,e){return Math.trunc((e-t)/Kr)}function tS(t,e){return cc(e)-cc(t)}function _b(t,e){if(!Wd(t,e))throw new RangeError(aS);return t}function aZ(t){function e(n){return((a,u)=>({...OO(a,u),F:a.month,day:parseInt(a.day)}))(xT(i,n),s)}const i=AS(t),s=By(t);return{id:t,O:lZ(e),B:cZ(e)}}function lZ(t){return mo(e=>{const i=Sr(e);return t(i)},WeakMap)}function cZ(t){const e=t(0).year-qK;return mo(i=>{let s,n=jd(i-e);const a=[],u=[];do n+=400*Kr;while((s=t(n)).year<=i);do n+=(1-s.day)*Kr,s.year===i&&(a.push(n),u.push(s.F)),n-=Kr;while((s=t(n)).year>=i);return{k:a.reverse(),C:sD(u.reverse())}})}function OO(t,e){let i,s,n=DO(t);if(t.era){const a=dD[e];a!==void 0&&(i=e==="islamic"?"ah":t.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),i==="bc"||i==="b"?i="bce":i!=="ad"&&i!=="a"||(i="ce"),s=n,n=LO(s,a[i]||0))}return{era:i,eraYear:s,year:n}}function DO(t){return parseInt(t.relatedYear||t.year)}function Jw(t){const{year:e,F:i,day:s}=this.O(t),{C:n}=this.B(e);return[e,n[i]+1,s]}function bm(t,e=1,i=1){return this.B(t).k[e-1]+(i-1)*Kr}function R_(t){const e=nP(this,t),i=nP(this,t-1),s=e.length;if(s>i.length){const n=zO(this);if(n<0)return-n;for(let a=0;ai.length&&(s=1,n=this.B(t+1).k),gb(i[e-1],n[s-1])}function k_(t){return this.B(t).k.length}function nP(t,e){return Object.keys(t.B(e).C)}function uZ(t){return yb(Sn(t))}function yb(t){if((t=t.toLowerCase())!==Ri&&t!==Eb&&By(t)!==By(AS(t).resolvedOptions().calendar))throw new RangeError(bK(t));return t}function By(t){return t==="islamicc"&&(t="islamic"),t.split("-")[0]}function FO(t){return this.R(t)[0]}function NO(t){return this.R(t)[1]}function iS(t){const[e]=this.h(t);return gb(this.q(e),Sr(t))+1}function BO(t){const e=TY.exec(t);if(!e)throw new RangeError(gK(t));return[parseInt(e[1]),!!e[2]]}function Ly(t,e,i){return t+(e||i&&t>=i?1:0)}function Gw(t,e){return t-(e&&t>=e?1:0)}function LO(t,e){return(e+t)*(Math.sign(e)||1)||0}function Qw(t){return dD[UO(t)]}function zO(t){return FK[UO(t)]}function UO(t){return By(t.id||Ri)}function hZ(t,e,i,s){const n=yc(i,s,_a,[],lD);if(n.timeZone!==void 0){const a=i.dateFromFields(n),u=Uu(n),c=t(n.timeZone);return{epochNanoseconds:Lu(e(c),{...a,...u},n.offset!==void 0?Zd(n.offset):void 0),timeZone:c}}return{...i.dateFromFields(n),...ma}}function dZ(t,e,i,s,n,a){const u=yc(i,n,_a,oD,lD),c=t(u.timeZone),[_,w,S]=sb(a),C=i.dateFromFields(u,rb(a,_)),P=Uu(u,_);return Er(Lu(e(c),{...C,...P},u.offset!==void 0?Zd(u.offset):void 0,w,S),c,s)}function fZ(t,e,i){const s=yc(t,e,_a,[],vc),n=rs(i);return Un(nl({...t.dateFromFields(s,rb(i,n)),...Uu(s,n)}))}function VO(t,e,i,s=[]){const n=yc(t,e,_a,s);return t.dateFromFields(n,i)}function jO(t,e,i,s){const n=yc(t,e,uS,s);return t.yearMonthFromFields(n,i)}function $O(t,e,i,s,n=[]){const a=yc(t,i,_a,n);return e&&a.month!==void 0&&a.monthCode===void 0&&a.year===void 0&&(a.year=Md),t.monthDayFromFields(a,s)}function pZ(t,e){const i=rs(e);return ga(Uu(ca(t,t1,[],1),i))}function mZ(t){const e=ca(t,hS);return pn(qd({...or,...e}))}function yc(t,e,i,s=[],n=[]){return ca(e,[...t.fields(i),...n].sort(),s)}function ca(t,e,i,s=!i){const n={};let a,u=0;for(const c of e){if(c===a)throw new RangeError(lK(c));if(c==="constructor"||c==="__proto__")throw new RangeError(GO(c));let _=t[c];if(_!==void 0)u=1,uP[c]&&(_=uP[c](_,c)),n[c]=_;else if(i){if(i.includes(c))throw new TypeError(oS(c));n[c]=hD[c]}a=c}if(s&&!u)throw new TypeError(QO(e));return n}function Uu(t,e){return ib(IY({...hD,...t}),e)}function gZ(t,e,i,s,n,a){const u=$n(a),{calendar:c,timeZone:_}=i;return Er(((w,S,C,P,D)=>{const j=zm(w,C,P,_a,aD,rD),[L,H,te]=sb(D,2);return Lu(S,{...w.dateFromFields(j,rb(D,L)),...Uu(j,L)},Zd(j.offset),H,te)})(t(c),e(_),s,n,u),_,c)}function _Z(t,e,i,s,n){const a=$n(n);return Un(((u,c,_,w)=>{const S=zm(u,c,_,_a,vc),C=rs(w);return nl({...u.dateFromFields(S,rb(w,C)),...Uu(S,C)})})(t(e.calendar),i,s,a))}function yZ(t,e,i,s,n){const a=$n(n);return((u,c,_,w)=>{const S=zm(u,c,_,_a);return u.dateFromFields(S,w)})(t(e.calendar),i,s,a)}function bZ(t,e,i,s,n){const a=$n(n);return Iu(((u,c,_,w)=>{const S=zm(u,c,_,uS);return u.yearMonthFromFields(S,w)})(t(e.calendar),i,s,a))}function vZ(t,e,i,s,n){const a=$n(n);return((u,c,_,w)=>{const S=zm(u,c,_,_a);return u.monthDayFromFields(S,w)})(t(e.calendar),i,s,a)}function xZ(t,e,i){return ga(((s,n,a)=>{const u=rs(a);return Uu({..._o(t1,s),...ca(n,t1)},u)})(t,e,i))}function wZ(t,e){return pn((i=t,s=e,qd({...i,...ca(s,hS)})));var i,s}function zm(t,e,i,s,n=[],a=[]){const u=[...t.fields(s),...n].sort();let c=ca(e,u,a);const _=ca(i,u);return c=t.mergeFields(c,_),ca(c,u,[])}function sS(t,e){const i=yc(t,e,uD);return t.monthDayFromFields(i)}function nS(t,e,i){const s=yc(t,e,cD);return t.yearMonthFromFields(s,i)}function WO(t,e,i,s,n){e=_o(i=t.fields(i),e),s=ca(s,n=t.fields(n),[]);let a=t.mergeFields(e,s);return a=ca(a,[...i,...n].sort(),[]),t.dateFromFields(a)}function kx(t,e){let{era:i,eraYear:s,year:n}=e;const a=Qw(t);if(i!==void 0||s!==void 0){if(i===void 0||s===void 0)throw new TypeError(dK);if(!a)throw new RangeError(hK);const u=a[i];if(u===void 0)throw new RangeError(pK(i));const c=LO(s,u);if(n!==void 0&&n!==c)throw new RangeError(fK);n=c}else if(n===void 0)throw new TypeError(mK(a));return n}function Ox(t,e,i,s){let{month:n,monthCode:a}=e;if(a!==void 0){const u=((c,_,w,S)=>{const C=c.U(w),[P,D]=BO(_);let j=Ly(P,D,C);if(D){const L=zO(c);if(L===void 0)throw new RangeError(Ep);if(L>0){if(j>L)throw new RangeError(Ep);if(C===void 0){if(S===1)throw new RangeError(Ep);j--}}else{if(j!==-L)throw new RangeError(Ep);if(C===void 0&&S===1)throw new RangeError(Ep)}}return j})(t,a,i,s);if(n!==void 0&&n!==u)throw new RangeError(tD);n=u,s=1}else if(n===void 0)throw new TypeError(_K);return Co("month",n,1,t.L(i),s)}function rP(t,e,i,s,n){return Wr(e,"day",1,t.j(s,i),n)}function Dx(t,e,i,s){let n=0;const a=[];for(const u of i)e[u]!==void 0?n=1:a.push(u);if(Object.assign(t,e),n)for(const u of s||a)delete t[u]}function TZ(t){return rr(yo(G0(J0(t))))}function SZ(t,e,i,s,n=Ri){return Er(yo(G0(J0(i))),e(s),t(n))}function EZ(t,e,i,s,n=0,a=0,u=0,c=0,_=0,w=0,S=Ri){return Un(nl(tb(fa(xr,Vd(Ab,[e,i,s,n,a,u,c,_,w])))),t(S))}function AZ(t,e,i,s,n=Ri){return Vn(Ql(Nu(fa(xr,{isoYear:e,isoMonth:i,isoDay:s}))),t(n))}function IZ(t,e,i,s=Ri,n=1){const a=xr(e),u=xr(i),c=t(s);return Iu(wT(Nu({isoYear:a,isoMonth:u,isoDay:xr(n)})),c)}function CZ(t,e,i,s=Ri,n=Md){const a=xr(e),u=xr(i),c=t(s);return Dy(Ql(Nu({isoYear:xr(n),isoMonth:a,isoDay:u})),c)}function PZ(t=0,e=0,i=0,s=0,n=0,a=0){return ga(ib(fa(xr,Vd(ya,[t,e,i,s,n,a])),1))}function RZ(t=0,e=0,i=0,s=0,n=0,a=0,u=0,c=0,_=0,w=0){return pn(qd(fa(U3,Vd(hs,[t,e,i,s,n,a,u,c,_,w]))))}function oP(t,e,i=Ri){return Er(t.epochNanoseconds,e,i)}function MZ(t){return rr(t.epochNanoseconds)}function HO(t,e){return Un(Jr(e,t))}function qO(t,e){return Vn(Jr(e,t))}function kZ(t,e,i){return nS(t(e.calendar),i)}function OZ(t,e,i){return sS(t(e.calendar),i)}function XO(t,e){return ga(Jr(e,t))}function DZ(t,e,i,s){const n=((a,u,c,_)=>{const w=G3(_);return go(a(u),c,w)})(t,i,e,s);return Er(yo(n),i,e.calendar)}function FZ(t,e,i){const s=t(e.calendar);return Iu({...e,...nS(s,i)})}function NZ(t,e,i){return sS(t(e.calendar),i)}function BZ(t,e,i,s,n){const a=t(n.timeZone),u=n.plainTime,c=u!==void 0?e(u):ma;return Er(go(i(a),{...s,...c}),a,s.calendar)}function LZ(t,e=ma){return Un(nl({...t,...e}))}function zZ(t,e,i){return nS(t(e.calendar),i)}function UZ(t,e,i){return sS(t(e.calendar),i)}function VZ(t,e,i,s){return((n,a,u)=>WO(n,a,cD,mc(u),jm))(t(e.calendar),i,s)}function jZ(t,e,i,s){return((n,a,u)=>WO(n,a,uD,mc(u),Sb))(t(e.calendar),i,s)}function $Z(t,e,i,s,n){const a=mc(n),u=e(a.plainDate),c=t(a.timeZone);return Er(go(i(c),{...u,...s}),c,u.calendar)}function WZ(t,e){return Un(nl({...t,...e}))}function HZ(t){return rr(yo(gm(t,Ro)))}function qZ(t){return rr(yo(gm(t,rl)))}function XZ(t){return rr(yo(G0(J0(t),ju)))}function ZZ(t){return rr(yo(G0(J0(t))))}function KZ(t,e,i=ma){const s=e.timeZone,n=t(s),a={...Jr(e,n),...i};return Er(Lu(n,a,a.offsetNanoseconds,2),s,e.calendar)}function YZ(t,e,i){const s=e.timeZone,n=t(s),a={...Jr(e,n),...i},u=ZO(e.calendar,i.calendar);return Er(Lu(n,a,a.offsetNanoseconds,2),s,u)}function JZ(t,e=ma){return Un({...t,...e})}function GZ(t,e){return Un({...t,...e},ZO(t.calendar,e.calendar))}function rS(t,e){return{...t,calendar:e}}function QZ(t,e){return{...t,timeZone:e}}function ZO(t,e){if(t===e)return t;const i=Ar(t),s=Ar(e);if(i===s||i===Ri)return e;if(s===Ri)return t;throw new RangeError(aS)}function eK(t,e){return i=>i===Ri?t:i===Eb||i===Rd?Object.assign(Object.create(t),{id:i}):Object.assign(Object.create(e),wY(i))}function Vu(t,e,i){const s=new Set(i);return n=>(((a,u)=>{for(const c of u)if(c in a)return 1;return 0})(n=M3(s,n),t)||Object.assign(n,e),i&&(n.timeZone=$u,["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium")),n)}function bc(t,e=KO){const[i,,,s]=t;return(n,a=$Y,...u)=>{const c=e(s&&s(...u),n,a,i),_=c.resolvedOptions();return[c,...tK(t,_,u)]}}function KO(t,e,i,s){if(i=s(i),t){if(i.timeZone!==void 0)throw new TypeError(kK);i.timeZone=t}return new vu(e,i)}function tK(t,e,i){const[,s,n]=t;return i.map(a=>(a.calendar&&((u,c,_)=>{if((_||u!==Ri)&&u!==c)throw new RangeError(aS)})(Ar(a.calendar),e.calendar,n),s(a,e)))}function Sp(t){const e=H_();return Fu(e,t.getOffsetNanosecondsFor(e))}function H_(){return gm(Date.now(),rl)}function Dl(){return dP||(dP=new vu().resolvedOptions().timeZone)}const iK=(t,e)=>`Non-integer ${t}: ${e}`,sK=(t,e)=>`Non-positive ${t}: ${e}`,nK=(t,e)=>`Non-finite ${t}: ${e}`,rK=t=>`Cannot convert bigint to ${t}`,oK=t=>`Invalid bigint: ${t}`,aK="Cannot convert Symbol to string",YO="Invalid object",JO=(t,e,i,s,n)=>n?JO(t,n[e],n[i],n[s]):Um(t,e)+`; must be between ${i}-${s}`,Um=(t,e)=>`Invalid ${t}: ${e}`,oS=t=>`Missing ${t}`,GO=t=>`Invalid field ${t}`,lK=t=>`Duplicate field ${t}`,QO=t=>"No valid fields: "+t.join(),cK="Invalid bag",eD=(t,e,i)=>Um(t,e)+"; must be "+Object.keys(i).join(),uK="Cannot use valueOf",aP="Invalid calling context",hK="Forbidden era/eraYear",dK="Mismatching era/eraYear",fK="Mismatching year/eraYear",pK=t=>`Invalid era: ${t}`,mK=t=>"Missing year"+(t?"/era/eraYear":""),gK=t=>`Invalid monthCode: ${t}`,tD="Mismatching month/monthCode",_K="Missing month/monthCode",lP="Cannot guess year",Ep="Invalid leap month",yK="Invalid protocol",Vm="Invalid protocol results",aS="Mismatching Calendars",bK=t=>`Invalid Calendar: ${t}`,iD="Mismatching TimeZones",vK="Forbidden ICU TimeZone",xK="Out-of-bounds offset",wK="Out-of-bounds TimeZone gap",TK="Invalid TimeZone offset",SK="Ambiguous offset",bb="Out-of-bounds date",EK="Out-of-bounds duration",AK="Cannot mix duration signs",vb="Missing relativeTo",IK="Cannot use large units",CK="Required smallestUnit or largestUnit",PK="smallestUnit > largestUnit",Zr=t=>`Cannot parse: ${t}`,Ga=t=>`Invalid substring: ${t}`,RK=t=>`Cannot format ${t}`,MK="Mismatching types for formatting",kK="Cannot specify TimeZone",sD=Ai(q0,(t,e)=>e),Jd=Ai(q0,(t,e,i)=>i),Po=Ai(My,2),e1={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},xb=Object.keys(e1),Kr=864e5,nD=1e3,ju=1e3,rl=1e6,Ro=1e9,wb=6e10,Tb=36e11,Is=864e11,pa=[1,ju,rl,Ro,wb,Tb,Is],vc=xb.slice(0,6),t1=Bm(vc),rD=["offset"],oD=["timeZone"],aD=vc.concat(rD),lD=aD.concat(oD),i1=["era","eraYear"],OK=i1.concat(["year"]),Sb=["year"],lS=["monthCode"],cS=["month"].concat(lS),jm=["day"],uS=cS.concat(Sb),cD=lS.concat(Sb),_a=jm.concat(uS),DK=jm.concat(cS),uD=jm.concat(lS),hD=Jd(vc,0),Ri="iso8601",Eb="gregory",Rd="japanese",dD={[Eb]:{bce:-1,ce:0},[Rd]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},FK={chinese:13,dangi:13,hebrew:-6},Sn=Ai(Y0,"string"),NK=Ai(Y0,"boolean"),BK=Ai(Y0,"number"),LK=Ai(Y0,"function"),hs=xb.map(t=>t+"s"),hS=Bm(hs),zK=hs.slice(0,6),fD=hs.slice(6),UK=fD.slice(1),VK=sD(hs),or=Jd(hs,0),dS=Jd(zK,0),fS=Ai(O3,hs),ya=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],pS=["isoDay","isoMonth","isoYear"],Ab=ya.concat(pS),mS=Bm(pS),pD=Bm(ya),mD=Bm(Ab),ma=Jd(pD,0),jK=Ai(O3,Ab),vu=Intl.DateTimeFormat,gD="en-GB",gS=1e8,$K=gS*Kr,WK=[gS,0],HK=[-gS,0],vm=275760,xm=-271821,qK=1970,Md=1972,Wa=12,XK=jd(1868,9,8),ZK=mo(_X,WeakMap),zy="smallestUnit",s1="unit",Xp="roundingIncrement",Fx="fractionalSecondDigits",_D="relativeTo",yD={constrain:0,reject:1},KK=Object.keys(yD),YK={compatible:0,reject:1,earlier:2,later:3},JK={reject:0,use:1,prefer:2,ignore:3},GK={auto:0,never:1,critical:2,always:3},QK={auto:0,never:1,critical:2},eY={auto:0,never:1},tY={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},$m=Ai(MT,zy),_S=Ai(MT,"largestUnit"),iY=Ai(MT,s1),bD=Ai(Bu,"overflow",yD),vD=Ai(Bu,"disambiguation",YK),sY=Ai(Bu,"offset",JK),yS=Ai(Bu,"calendarName",GK),nY=Ai(Bu,"timeZoneName",QK),rY=Ai(Bu,"offset",eY),Wm=Ai(Bu,"roundingMode",tY),wm="PlainYearMonth",Tm="PlainMonthDay",Gd="PlainDate",Qd="PlainDateTime",bS="PlainTime",xc="ZonedDateTime",vS="Instant",xS="Duration",oY=[Math.floor,t=>P_(t)?Math.floor(t):Math.round(t),Math.ceil,t=>P_(t)?Math.ceil(t):Math.round(t),Math.trunc,t=>P_(t)?Math.trunc(t)||0:Math.round(t),t=>t<0?Math.floor(t):Math.ceil(t),t=>Math.sign(t)*Math.round(Math.abs(t))||0,t=>P_(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)],$u="UTC",q_=5184e3,aY=Oy(1847),lY=Oy(new Date().getUTCFullYear()+10),cY=/0+$/,Jr=mo(DX,WeakMap),cP=2**32-1,wS=mo(t=>{const e=GT(t);return typeof e=="object"?new hY(e):new uY(e||0)});class uY{constructor(e){this.v=e}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(e){return[TT(e,this.v)]}l(){}}class hY{constructor(e){this.$=(i=>{function s(w){const S=Yw(w,c,_),[C,P]=KC(S),D=a(C),j=a(P);return D===j?D:n(u(C,P),D,j,w)}function n(w,S,C,P){let D,j;for(;(P===void 0||(D=P=w[1]?C:void 0)===void 0)&&(j=w[1]-w[0]);){const L=w[0]+Math.floor(j/2);i(L)===C?w[1]=L:w[0]=L+1}return D}const a=mo(i),u=mo(zX);let c=aY,_=lY;return{G(w){const S=s(w-86400),C=s(w+86400),P=w-S,D=w-C;if(S===C)return[P];const j=s(P);return j===s(D)?[w-j]:S>C?[P,D]:[]},V:s,l(w,S){const C=Yw(w,c,_);let[P,D]=KC(C);const j=q_*S,L=S<0?()=>D>c||(c=C,0):()=>P<_||(_=C,0);for(;L();){const H=a(P),te=a(D);if(H!==te){const G=u(P,D);n(G,H,te);const se=G[0];if((Gl(se,w)||1)===S)return se}P+=j,D+=j}}}})((i=>s=>{const n=xT(i,s*nD);return Oy(DO(n),parseInt(n.month),parseInt(n.day),parseInt(n.hour),parseInt(n.minute),parseInt(n.second))-s})(e))}getOffsetNanosecondsFor(e){return this.$.V($3(e))*Ro}getPossibleInstantsFor(e){const[i,s]=[Oy((n=e).isoYear,n.isoMonth,n.isoDay,n.isoHour,n.isoMinute,n.isoSecond),n.isoMillisecond*rl+n.isoMicrosecond*ju+n.isoNanosecond];var n;return this.$.G(i).map(a=>yo(Pd(gm(a,Ro),s)))}l(e,i){const[s,n]=W3(e),a=this.$.l(s+(i>0||n?1:0),i);if(a!==void 0)return gm(a,Ro)}}const TS="([+−-])",X_="(?:[.,](\\d{1,9}))?",xD=`(?:(?:${TS}(\\d{6}))|(\\d{4}))-?(\\d{2})`,SS="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+X_+")?)?",ES=TS+SS,dY=xD+"-?(\\d{2})(?:[T ]"+SS+"(Z|"+ES+")?)?",wD="\\[(!?)([^\\]]*)\\]",Ib=`((?:${wD}){0,9})`,fY=Kd(xD+Ib),pY=Kd("(?:--)?(\\d{2})-?(\\d{2})"+Ib),mY=Kd(dY+Ib),gY=Kd("T?"+SS+"(?:"+ES+")?"+Ib),_Y=Kd(ES),yY=new RegExp(wD,"g"),bY=Kd(`${TS}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${X_}H)?(?:(\\d+)${X_}M)?(?:(\\d+)${X_}S)?)?`),vY=mo(t=>new vu(gD,{timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),xY=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,wY=mo(aZ),AS=mo(t=>new vu(gD,{calendar:t,timeZone:$u,era:"short",year:"numeric",month:"short",day:"numeric"})),TY=/^M(\d{2})(L?)$/,SY={era:ky,eraYear:xr,year:xr,month:MC,monthCode:ky,day:MC},EY=Jd(vc,xr),AY=Jd(hs,U3),uP=Object.assign({},SY,EY,AY,{offset:ky}),IY=Ai(uX,vc,ya),hP={dateAdd(t,e,i){const s=rs(i);let n,{years:a,months:u,weeks:c,days:_}=e;if(_+=jn(e,5)[0],a||u)n=((w,S,C,P,D)=>{let[j,L,H]=w.h(S);if(C){const[te,G]=w.I(j,L);j+=C,L=Ly(te,G,w.U(j)),L=Co("month",L,1,w.L(j),D)}return P&&([j,L]=w._(j,L,P)),H=Co("day",H,1,w.j(j,L),D),w.q(j,L,H)})(this,t,a,u,s);else{if(!c&&!_)return t;n=Sr(t)}return n+=(7*c+_)*Kr,Ql(eb(n))},dateUntil(t,e,i){if(i<=7){let _=0,w=kO({...t,...ma},{...e,...ma});return i===7&&([_,w]=lc(w,7)),{...or,weeks:_,days:w}}const s=this.h(t),n=this.h(e);let[a,u,c]=((_,w,S,C,P,D,j)=>{let L=P-w,H=D-S,te=j-C;if(L||H){const G=Math.sign(L||H);let se=_.j(P,D),ve=0;if(Math.sign(te)===-G){const Se=se;[P,D]=_._(P,D,-G),L=P-w,H=D-S,se=_.j(P,D),ve=G<0?-Se:se}if(te=j-Math.min(C,se)+ve,L){const[Se,ge]=_.I(w,S),[De,Fe]=_.I(P,D);if(H=De-Se||Number(Fe)-Number(ge),Math.sign(H)===-G){const Be=G<0&&-_.L(P);L=(P-=G)-w,H=D-Ly(Se,ge,_.U(P))+(Be||_.L(P))}}}return[L,H,te]})(this,...s,...n);return i===8&&(u+=this.J(a,s[0]),a=0),{...or,years:a,months:u,days:c}},dateFromFields(t,e){const i=rs(e),s=kx(this,t),n=Ox(this,t,s,i),a=rP(this,t,n,s,i);return Vn(Ql(this.P(s,n,a)),this.id||Ri)},yearMonthFromFields(t,e){const i=rs(e),s=kx(this,t),n=Ox(this,t,s,i);return Iu(wT(this.P(s,n,1)),this.id||Ri)},monthDayFromFields(t,e){const i=rs(e),s=!this.id,{monthCode:n,year:a,month:u}=t;let c,_,w,S,C;if(n!==void 0){[c,_]=BO(n),C=R3(t,"day");const P=this.N(c,_,C);if(!P)throw new RangeError(lP);if([w,S]=P,u!==void 0&&u!==S)throw new RangeError(tD);s&&(S=Co("month",S,1,Wa,1),C=Co("day",C,1,ST(a!==void 0?a:w,S),i))}else{w=a===void 0&&s?Md:kx(this,t),S=Ox(this,t,w,i),C=rP(this,t,S,w,i);const P=this.U(w);_=S===P,c=Gw(S,P);const D=this.N(c,_,C);if(!D)throw new RangeError(lP);[w,S]=D}return Dy(Ql(this.P(w,S,C)),this.id||Ri)},fields(t){return Qw(this)&&t.includes("year")?[...t,...i1]:t},mergeFields(t,e){const i=Object.assign(Object.create(null),t);return Dx(i,e,cS),Qw(this)&&(Dx(i,e,OK),this.id===Rd&&Dx(i,e,DK,i1)),i},inLeapYear(t){const[e]=this.h(t);return this.K(e)},monthsInYear(t){const[e]=this.h(t);return this.L(e)},daysInMonth(t){const[e,i]=this.h(t);return this.j(e,i)},daysInYear(t){const[e]=this.h(t);return this.X(e)},dayOfYear:iS,era(t){return this.ee(t)[0]},eraYear(t){return this.ee(t)[1]},monthCode(t){const[e,i]=this.h(t),[s,n]=this.I(e,i);return((a,u)=>"M"+Po(a)+(u?"L":""))(s,n)},dayOfWeek:K3,daysInWeek(){return 7}},CY={dayOfYear:iS,h:q3,q:jd},PY=Object.assign({},CY,{weekOfYear:FO,yearOfWeek:NO,R(t){function e(D){return(7-Di(0)&&(C=1,P++):(C=i(-1),P--),[C,P,S]}}),RY={dayOfYear:iS,h:Jw,q:bm,weekOfYear:FO,yearOfWeek:NO,R(){return[]}},Hm=eK(Object.assign({},hP,PY,{h:q3,ee(t){return this.id===Eb?Y3(t):this.id===Rd?ZK(t):[]},I:(t,e)=>[e,0],N(t,e){if(!e)return[Md,t]},K:ET,U(){},L:X3,J:t=>t*Wa,j:ST,X:Z3,P:(t,e,i)=>({isoYear:t,isoMonth:e,isoDay:i}),q:jd,_:(t,e,i)=>(t+=X0(i,Wa),(e+=_T(i,Wa))<1?(t--,e+=Wa):e>Wa&&(t++,e-=Wa),[t,e]),year(t){return t.isoYear},month(t){return t.isoMonth},day:t=>t.isoDay}),Object.assign({},hP,RY,{h:Jw,ee(t){const e=this.O(t);return[e.era,e.eraYear]},I(t,e){const i=R_.call(this,t);return[Gw(e,i),i===e]},N(t,e,i){let[s,n,a]=Jw.call(this,{isoYear:Md,isoMonth:Wa,isoDay:31});const u=R_.call(this,s),c=n===u;(Gl(t,Gw(n,u))||Gl(Number(e),Number(c))||Gl(i,a))===1&&s--;for(let _=0;_<100;_++){const w=s-_,S=R_.call(this,w),C=Ly(t,e,S);if(e===(C===S)&&i<=sP.call(this,w,C))return[w,C]}},K(t){const e=M_.call(this,t);return e>M_.call(this,t-1)&&e>M_.call(this,t+1)},U:R_,L:k_,J(t,e){const i=e+t,s=Math.sign(t),n=s<0?-1:0;let a=0;for(let u=e;u!==i;u+=s)a+=k_.call(this,u+n);return a},j:sP,X:M_,P(t,e,i){return eb(bm.call(this,t,e,i))},q:bm,_(t,e,i){if(i){if(e+=i,!Number.isSafeInteger(e))throw new RangeError(bb);if(i<0)for(;e<1;)e+=k_.call(this,--t);else{let s;for(;e>(s=k_.call(this,t));)e-=s,t++}}return[t,e]},year(t){return this.O(t).year},month(t){const{year:e,F:i}=this.O(t),{C:s}=this.B(e);return s[i]+1},day(t){return this.O(t).day}})),ec="numeric",ef=["timeZoneName"],TD={month:ec,day:ec},IS={year:ec,month:ec},CS=Object.assign({},IS,{day:ec}),PS={hour:ec,minute:ec,second:ec},RS=Object.assign({},CS,PS),MY=Object.assign({},RS,{timeZoneName:"short"}),kY=Object.keys(IS),OY=Object.keys(TD),DY=Object.keys(CS),FY=Object.keys(PS),MS=["dateStyle"],NY=kY.concat(MS),BY=OY.concat(MS),kS=DY.concat(MS,["weekday"]),qm=FY.concat(["dayPeriod","timeStyle"]),OS=kS.concat(qm),LY=OS.concat(ef),zY=ef.concat(qm),UY=ef.concat(kS),VY=ef.concat(["day","weekday"],qm),jY=ef.concat(["year","weekday"],qm),$Y={},SD=[Vu(OS,RS),kT],WY=[Vu(LY,MY),kT,0,(t,e)=>{const i=Ar(t.timeZone);if(e&&Ar(e.timeZone)!==i)throw new RangeError(iD);return i}],ED=[Vu(OS,RS,ef),Sr],AD=[Vu(kS,CS,zY),Sr],ID=[Vu(qm,PS,UY),t=>cc(t)/rl],CD=[Vu(NY,IS,VY),Sr,1],PD=[Vu(BY,TD,jY),Sr,1];let dP;function ba(t,e,i,s,n){function a(..._){if(!(this instanceof a))throw new TypeError(aP);gP(this,e(..._))}function u(_,w){return Object.defineProperties(function(...S){return _.call(this,c(this),...S)},IC(w))}function c(_){const w=lr(_);if(!w||w.branding!==t)throw new TypeError(aP);return w}return Object.defineProperties(a.prototype,{...cX(fa(u,i)),...Id(fa(u,s)),...gT("Temporal."+t)}),Object.defineProperties(a,{...Id(n),...IC(t)}),[a,_=>{const w=Object.create(a.prototype);return gP(w,_),w},c]}function RD(t){return t=t.concat("id").sort(),e=>{if(!hX(e,t))throw new TypeError(yK);return e}}function tf(t){if(lr(t)||t.calendar!==void 0||t.timeZone!==void 0)throw new TypeError(cK);return t}function O_(t,e){const i={};for(const s in t)i[s]=({o:n},a)=>{const u=lr(a)||{},{branding:c}=u,_=c===Gd||e.includes(c)?u:yr(a);return n[s](_)};return i}function DS(t){const e={};for(const i in t)e[i]=s=>{const{calendar:n}=s;return(a=n,typeof a=="string"?Hm(a):(u=a,Object.assign(Object.create(oJ),{i:u})))[i](s);var a,u};return e}function wc(){throw new TypeError(uK)}function Xm({calendar:t}){return typeof t=="string"?new $S(t):t}function fP(t,e){if(e=$n(e),ar(t)){const s=lr(t);if(s&&s.branding===Tm)return rs(e),s;const n=OD(t);return $O(kb(n||Ri),!n,t,e)}const i=HX(Hm,t);return rs(e),i}function MD(t,e,i){return s=e.call(t,mr(rr(i))),pO(K0(s));var s}function Z_(t,e=BD){const i=Object.keys(e).sort(),s={};for(const n of i)s[n]=Ai(e[n],t,LK(t[n]));return s}function ks(t,e){return typeof t=="string"?wS(t):Z_(t,e)}function wn(t){return ks(t,r1)}function ea(t){if(ar(t)){const e=lr(t);if(e)switch(e.branding){case vS:return e;case xc:return rr(e.epochNanoseconds)}}return UX(t)}function pP(t,e,i){const s=e.l(ea(i).epochNanoseconds,t);return s?mr(rr(s)):null}function Ws(t){return ar(t)?(lr(t)||{}).timeZone||dJ(t):(e=>JT(KX(Sn(e))))(t)}function zl(t,e){if(ar(t)){const i=lr(t)||{};switch(i.branding){case bS:return rs(e),i;case Qd:return rs(e),ga(i);case xc:return rs(e),XO(wn,i)}return pZ(t,e)}return rs(e),qX(t)}function FS(t){return t===void 0?void 0:zl(t)}function zh(t,e){if(e=$n(e),ar(t)){const s=lr(t);return s&&s.branding===wm?(rs(e),s):jO(Rb(Zm(t)),t,e)}const i=WX(Hm,t);return rs(e),i}function Ul(t,e){if(e=$n(e),ar(t)){const s=lr(t)||{};switch(s.branding){case Qd:return rs(e),s;case Gd:return rs(e),Un({...s,...ma});case xc:return rs(e),HO(wn,s)}return fZ(Mb(Zm(t)),t,e)}const i=$X(t);return rs(e),i}function yr(t,e){if(e=$n(e),ar(t)){const s=lr(t)||{};switch(s.branding){case Gd:return rs(e),s;case Qd:return rs(e),Vn(s);case xc:return rs(e),qO(wn,s)}return VO(Mb(Zm(t)),t,e)}const i=WT(t);return rs(e),i}function kD(t,e,i){return oa(e.call(t,dn(Vn(i,t))))}function va(t){return e=>typeof e=="string"?Hm(e):((i,s)=>{const n=Object.keys(s).sort(),a={};for(const u of n)a[u]=Ai(s[u],i,i[u]);return a})(e,t)}function hn(t){if(ar(t)){const e=lr(t);return e&&e.branding===xS?e:mZ(t)}return XX(t)}function Ap(t){if(t!==void 0){if(ar(t)){const e=lr(t)||{};switch(e.branding){case xc:case Gd:return e;case Qd:return Vn(e)}const i=Zm(t);return{...hZ(Ws,ks,Mb(i),t),calendar:i}}return VX(t)}}function Zm(t){return OD(t)||Ri}function OD(t){const{calendar:e}=t;if(e!==void 0)return nr(e)}function nr(t){return ar(t)?(lr(t)||{}).calendar||IJ(t):(e=>yb(ZX(Sn(e))))(t)}function Uh(t,e){if(e=$n(e),ar(t)){const i=lr(t);if(i&&i.branding===xc)return sb(e),i;const s=Zm(t);return dZ(Ws,ks,Mb(s),s,t,e)}return jX(t,e)}function mP(t){return fa(e=>i=>e(n1(i)),t)}function n1(t){return Jr(t,wn)}function HY(){const t=vu.prototype,e=Object.getOwnPropertyDescriptors(t),i=Object.getOwnPropertyDescriptors(vu),s=function(n,a={}){if(!(this instanceof s))return new s(n,a);WS.set(this,((u,c={})=>{const _=new vu(u,c),w=_.resolvedOptions(),S=w.locale,C=_o(Object.keys(c),w),P=mo(ZY),D=(...j)=>{let L;const H=j.map((te,G)=>{const se=lr(te),ve=(se||{}).branding;if(G&&L&&L!==ve)throw new TypeError(MK);return L=ve,se});return L?P(L)(S,C,...H):[_,...j]};return D.u=_,D})(n,a))};for(const n in e){const a=e[n],u=n.startsWith("format")&&qY(n);typeof a.value=="function"?a.value=n==="constructor"?s:u||XY(n):u&&(a.get=function(){return u.bind(this)})}return i.prototype.value=Object.create(t,e),Object.defineProperties(s,i),s}function qY(t){return function(...e){const i=WS.get(this),[s,...n]=i(...e);return s[t](...n)}}function XY(t){return function(...e){return WS.get(this).u[t](...e)}}function ZY(t){const e=KY[t];if(!e)throw new TypeError(RK(t));return bc(e,mo(KO))}const KY={Instant:SD,PlainDateTime:ED,PlainDate:AD,PlainTime:ID,PlainYearMonth:CD,PlainMonthDay:PD},YY=bc(SD),JY=bc(WY),GY=bc(ED),QY=bc(AD),eJ=bc(ID),tJ=bc(CD),iJ=bc(PD),NS={era:mX,eraYear:F3,year:K0,month:oa,daysInMonth:oa,daysInYear:oa,inLeapYear:NK,monthsInYear:oa},Cb={monthCode:Sn},BS={day:oa},DD={dayOfWeek:oa,dayOfYear:oa,weekOfYear:gX,yearOfWeek:F3,daysInWeek:oa},FD=Object.assign({},NS,Cb,BS,DD),Uy=new WeakMap,lr=Uy.get.bind(Uy),gP=Uy.set.bind(Uy),sJ={...O_(NS,[wm]),...O_(DD,[]),...O_(Cb,[wm,Tm]),...O_(BS,[Tm])},LS=DS(FD),nJ=DS({...NS,...Cb}),rJ=DS({...Cb,...BS}),Km={calendarId:t=>Ar(t.calendar)},oJ=fa((t,e)=>function(i){const{i:s}=this;return t(s[e](dn(Vn(i,s))))},FD),aJ=q0(t=>e=>e[t],hs.concat("sign")),zS=q0((t,e)=>i=>i[ya[e]],vc),ND={epochSeconds:bX,epochMilliseconds:kT,epochMicroseconds:vX,epochNanoseconds:xX},Ym=Ai(M3,new Set(["branding"])),[lJ,kd,cJ]=ba(Tm,Ai(CZ,nr),{...Km,...rJ},{getISOFields:Ym,getCalendar:Xm,with(t,e,i){return kd(vZ(SJ,t,this,tf(e),i))},equals:(t,e)=>sZ(t,fP(e)),toPlainDate(t,e){return dn(jZ(Jm,t,this,e))},toLocaleString(t,e,i){const[s,n]=iJ(e,i,t);return s.format(n)},toString:zC,toJSON:t=>zC(t),valueOf:wc},{from:(t,e)=>kd(fP(t,e))}),BD={getOffsetNanosecondsFor:MD,getPossibleInstantsFor(t,e,i){const s=[...e.call(t,er(Un(i,Ri)))].map(a=>hJ(a).epochNanoseconds),n=s.length;return n>1&&(s.sort(Yr),mO(ko(Mo(s[0],s[n-1])))),s}},r1={getOffsetNanosecondsFor:MD},[uJ,mr,hJ]=ba(vS,TZ,ND,{add:(t,e)=>mr(jC(0,t,hn(e))),subtract:(t,e)=>mr(jC(1,t,hn(e))),until:(t,e,i)=>Fs(JC(0,t,ea(e),i)),since:(t,e,i)=>Fs(JC(1,t,ea(e),i)),round:(t,e)=>mr(TX(t,e)),equals:(t,e)=>GX(t,ea(e)),toZonedDateTime(t,e){const i=mc(e);return bn(oP(t,Ws(i.timeZone),nr(i.calendar)))},toZonedDateTimeISO:(t,e)=>bn(oP(t,Ws(e))),toLocaleString(t,e,i){const[s,n]=YY(e,i,t);return s.format(n)},toString:(t,e)=>DC(Ws,wn,t,e),toJSON:t=>DC(Ws,wn,t),valueOf:wc},{from:t=>mr(ea(t)),fromEpochSeconds:t=>mr(HZ(t)),fromEpochMilliseconds:t=>mr(qZ(t)),fromEpochMicroseconds:t=>mr(XZ(t)),fromEpochNanoseconds:t=>mr(ZZ(t)),compare:(t,e)=>EO(ea(t),ea(e))}),[Pb,TG]=ba("TimeZone",t=>{const e=YX(t);return{branding:"TimeZone",id:e,o:wS(e)}},{id:t=>t.id},{getPossibleInstantsFor:({o:t},e)=>t.getPossibleInstantsFor(Ul(e)).map(i=>mr(rr(i))),getOffsetNanosecondsFor:({o:t},e)=>t.getOffsetNanosecondsFor(ea(e).epochNanoseconds),getOffsetStringFor(t,e){const i=ea(e).epochNanoseconds,s=Z_(this,r1).getOffsetNanosecondsFor(i);return Hd(s)},getPlainDateTimeFor(t,e,i=Ri){const s=ea(e).epochNanoseconds,n=Z_(this,r1).getOffsetNanosecondsFor(s);return er(Un(Fu(s,n),nr(i)))},getInstantFor(t,e,i){const s=Ul(e),n=G3(i),a=Z_(this);return mr(rr(go(a,s,n)))},getNextTransition:({o:t},e)=>pP(1,t,e),getPreviousTransition:({o:t},e)=>pP(-1,t,e),equals(t,e){return!!eS(this,Ws(e))},toString:t=>t.id,toJSON:t=>t.id},{from(t){const e=Ws(t);return typeof e=="string"?new Pb(e):e}}),dJ=RD(Object.keys(BD)),[fJ,$l]=ba(bS,PZ,zS,{getISOFields:Ym,with(t,e,i){return $l(xZ(this,tf(e),i))},add:(t,e)=>$l(XC(0,t,hn(e))),subtract:(t,e)=>$l(XC(1,t,hn(e))),until:(t,e,i)=>Fs(iP(0,t,zl(e),i)),since:(t,e,i)=>Fs(iP(1,t,zl(e),i)),round:(t,e)=>$l(AX(t,e)),equals:(t,e)=>nZ(t,zl(e)),toZonedDateTime:(t,e)=>bn($Z(Ws,yr,ks,t,e)),toPlainDateTime:(t,e)=>er(WZ(t,yr(e))),toLocaleString(t,e,i){const[s,n]=eJ(e,i,t);return s.format(n)},toString:UC,toJSON:t=>UC(t),valueOf:wc},{from:(t,e)=>$l(zl(t,e)),compare:(t,e)=>QT(zl(t),zl(e))}),[pJ,Xl,mJ]=ba(wm,Ai(IZ,nr),{...Km,...nJ},{getISOFields:Ym,getCalendar:Xm,with(t,e,i){return Xl(bZ(TJ,t,this,tf(e),i))},add:(t,e,i)=>Xl(qC(_P,0,t,hn(e),i)),subtract:(t,e,i)=>Xl(qC(_P,1,t,hn(e),i)),until:(t,e,i)=>Fs(tP(yP,0,t,zh(e),i)),since:(t,e,i)=>Fs(tP(yP,1,t,zh(e),i)),equals:(t,e)=>iZ(t,zh(e)),toPlainDate(t,e){return dn(VZ(Jm,t,this,e))},toLocaleString(t,e,i){const[s,n]=tJ(e,i,t);return s.format(n)},toString:LC,toJSON:t=>LC(t),valueOf:wc},{from:(t,e)=>Xl(zh(t,e)),compare:(t,e)=>Yd(zh(t),zh(e))}),[gJ,er]=ba(Qd,Ai(EZ,nr),{...Km,...LS,...zS},{getISOFields:Ym,getCalendar:Xm,with(t,e,i){return er(_Z(Jm,t,this,tf(e),i))},withCalendar:(t,e)=>er(rS(t,nr(e))),withPlainDate:(t,e)=>er(GZ(t,yr(e))),withPlainTime:(t,e)=>er(JZ(t,FS(e))),add:(t,e,i)=>er(WC(Pu,0,t,hn(e),i)),subtract:(t,e,i)=>er(WC(Pu,1,t,hn(e),i)),until:(t,e,i)=>Fs(QC(aa,0,t,Ul(e),i)),since:(t,e,i)=>Fs(QC(aa,1,t,Ul(e),i)),round:(t,e)=>er(EX(t,e)),equals:(t,e)=>eZ(t,Ul(e)),toZonedDateTime:(t,e,i)=>bn(DZ(ks,t,Ws(e),i)),toPlainDate:t=>dn(Vn(t)),toPlainTime:t=>$l(ga(t)),toPlainYearMonth(t){return Xl(FZ(Rb,t,this))},toPlainMonthDay(t){return kd(NZ(kb,t,this))},toLocaleString(t,e,i){const[s,n]=GY(e,i,t);return s.format(n)},toString:NC,toJSON:t=>NC(t),valueOf:wc},{from:(t,e)=>er(Ul(t,e)),compare:(t,e)=>IO(Ul(t),Ul(e))}),[_J,dn,LD]=ba(Gd,Ai(AZ,nr),{...Km,...LS},{getISOFields:Ym,getCalendar:Xm,with(t,e,i){return dn(yZ(Jm,t,this,tf(e),i))},withCalendar:(t,e)=>dn(rS(t,nr(e))),add:(t,e,i)=>dn(HC(Pu,0,t,hn(e),i)),subtract:(t,e,i)=>dn(HC(Pu,1,t,hn(e),i)),until:(t,e,i)=>Fs(eP(aa,0,t,yr(e),i)),since:(t,e,i)=>Fs(eP(aa,1,t,yr(e),i)),equals:(t,e)=>tZ(t,yr(e)),toZonedDateTime(t,e){const i=!ar(e)||e instanceof Pb?{timeZone:e}:e;return bn(BZ(Ws,zl,ks,t,i))},toPlainDateTime:(t,e)=>er(LZ(t,FS(e))),toPlainYearMonth(t){return Xl(zZ(Rb,t,this))},toPlainMonthDay(t){return kd(UZ(kb,t,this))},toLocaleString(t,e,i){const[s,n]=QY(e,i,t);return s.format(n)},toString:BC,toJSON:t=>BC(t),valueOf:wc},{from:(t,e)=>dn(yr(t,e)),compare:(t,e)=>Yd(yr(t),yr(e))}),US={fields(t,e,i){return[...e.call(t,i)]}},zD=Object.assign({dateFromFields(t,e,i,s){return LD(e.call(t,Object.assign(Object.create(null),i),s))}},US),UD=Object.assign({yearMonthFromFields(t,e,i,s){return mJ(e.call(t,Object.assign(Object.create(null),i),s))}},US),VD=Object.assign({monthDayFromFields(t,e,i,s){return cJ(e.call(t,Object.assign(Object.create(null),i),s))}},US),VS={mergeFields(t,e,i,s){return mc(e.call(t,Object.assign(Object.create(null),i),Object.assign(Object.create(null),s)))}},yJ=Object.assign({},zD,VS),bJ=Object.assign({},UD,VS),vJ=Object.assign({},VD,VS),jS={dateAdd(t,e,i,s,n){return LD(e.call(t,dn(Vn(i,t)),Fs(pn(s)),n))}},jD=Object.assign({},jS,{dateUntil(t,e,i,s,n,a){return AJ(e.call(t,dn(Vn(i,t)),dn(Vn(s,t)),Object.assign(Object.create(null),a,{largestUnit:xb[n]})))}}),xJ=Object.assign({},jS,{day:kD}),wJ=Object.assign({},jD,{day:kD}),Rb=va(UD),Mb=va(zD),kb=va(VD),TJ=va(bJ),Jm=va(yJ),SJ=va(vJ),Pu=va(jS),aa=va(jD),_P=va(xJ),yP=va(wJ),[EJ,Fs,AJ]=ba(xS,RZ,{...aJ,blank:LX},{with:(t,e)=>Fs(wZ(t,e)),negated:t=>Fs($T(t)),abs:t=>Fs(BX(t)),add:(t,e,i)=>Fs(ZC(Ap,aa,ks,0,t,hn(e),i)),subtract:(t,e,i)=>Fs(ZC(Ap,aa,ks,1,t,hn(e),i)),round:(t,e)=>Fs(NX(Ap,aa,ks,t,e)),total:(t,e)=>wX(Ap,aa,ks,t,e),toLocaleString(t,e,i){return Intl.DurationFormat?new Intl.DurationFormat(e,i).format(this):Mx(t)},toString:Mx,toJSON:t=>Mx(t),valueOf:wc},{from:t=>Fs(hn(t)),compare:(t,e,i)=>JX(Ap,Pu,ks,hn(t),hn(e),i)}),$D={toString:t=>t.id,toJSON:t=>t.id,...sJ,dateAdd:({id:t,o:e},i,s,n)=>dn(Vn(e.dateAdd(yr(i),hn(s),n),t)),dateUntil:({o:t},e,i,s)=>Fs(pn(t.dateUntil(yr(e),yr(i),yX(s)))),dateFromFields:({id:t,o:e},i,s)=>dn(VO(e,i,s,pX(t))),yearMonthFromFields:({id:t,o:e},i,s)=>Xl(jO(e,i,s,dX(t))),monthDayFromFields:({id:t,o:e},i,s)=>kd($O(e,0,i,s,fX(t))),fields({o:t},e){const i=new Set(_a),s=[];for(const n of e){if(Sn(n),!i.has(n))throw new RangeError(GO(n));i.delete(n),s.push(n)}return t.fields(s)},mergeFields:({o:t},e,i)=>t.mergeFields(CC(RC(e)),CC(RC(i)))},[$S]=ba("Calendar",t=>{const e=uZ(t);return{branding:"Calendar",id:e,o:Hm(e)}},{id:t=>t.id},$D,{from(t){const e=nr(t);return typeof e=="string"?new $S(e):e}}),IJ=RD(Object.keys($D).slice(4)),[CJ,bn]=ba(xc,Ai(SZ,nr,Ws),{...ND,...Km,...mP(LS),...mP(zS),offset:t=>Hd(n1(t).offsetNanoseconds),offsetNanoseconds:t=>n1(t).offsetNanoseconds,timeZoneId:t=>Ar(t.timeZone),hoursInDay:t=>IX(ks,t)},{getISOFields:t=>FX(wn,t),getCalendar:Xm,getTimeZone:({timeZone:t})=>typeof t=="string"?new Pb(t):t,with(t,e,i){return bn(gZ(Jm,ks,t,this,tf(e),i))},withCalendar:(t,e)=>bn(rS(t,nr(e))),withTimeZone:(t,e)=>bn(QZ(t,Ws(e))),withPlainDate:(t,e)=>bn(YZ(ks,t,yr(e))),withPlainTime:(t,e)=>bn(KZ(ks,t,FS(e))),add:(t,e,i)=>bn($C(Pu,ks,0,t,hn(e),i)),subtract:(t,e,i)=>bn($C(Pu,ks,1,t,hn(e),i)),until:(t,e,i)=>Fs(pn(GC(aa,ks,0,t,Uh(e),i))),since:(t,e,i)=>Fs(pn(GC(aa,ks,1,t,Uh(e),i))),round:(t,e)=>bn(SX(ks,t,e)),startOfDay:t=>bn(CX(ks,t)),equals:(t,e)=>QX(t,Uh(e)),toInstant:t=>mr(MZ(t)),toPlainDateTime:t=>er(HO(wn,t)),toPlainDate:t=>dn(qO(wn,t)),toPlainTime:t=>$l(XO(wn,t)),toPlainYearMonth(t){return Xl(kZ(Rb,t,this))},toPlainMonthDay(t){return kd(OZ(kb,t,this))},toLocaleString(t,e,i={}){const[s,n]=JY(e,i,t);return s.format(n)},toString:(t,e)=>FC(wn,t,e),toJSON:t=>FC(wn,t),valueOf:wc},{from:(t,e)=>bn(Uh(t,e)),compare:(t,e)=>AO(Uh(t),Uh(e))}),PJ=Object.defineProperties({},{...gT("Temporal.Now"),...Id({timeZoneId:()=>Dl(),instant:()=>mr(rr(H_())),zonedDateTime:(t,e=Dl())=>bn(Er(H_(),Ws(e),nr(t))),zonedDateTimeISO:(t=Dl())=>bn(Er(H_(),Ws(t),Ri)),plainDateTime:(t,e=Dl())=>er(Un(Sp(wn(Ws(e))),nr(t))),plainDateTimeISO:(t=Dl())=>er(Un(Sp(wn(Ws(t))),Ri)),plainDate:(t,e=Dl())=>dn(Vn(Sp(wn(Ws(e))),nr(t))),plainDateISO:(t=Dl())=>dn(Vn(Sp(wn(Ws(t))),Ri)),plainTimeISO:(t=Dl())=>$l(ga(Sp(wn(Ws(t)))))})}),bP=Object.defineProperties({},{...gT("Temporal"),...Id({PlainYearMonth:pJ,PlainMonthDay:lJ,PlainDate:_J,PlainTime:fJ,PlainDateTime:gJ,ZonedDateTime:CJ,Instant:uJ,Calendar:$S,TimeZone:Pb,Duration:EJ,Now:PJ})}),RJ=HY(),WS=new WeakMap;Object.create(Intl),Id({DateTimeFormat:RJ});const MJ=fc({name:"TimeSlider",components:{},props:{numDays:Number,dailyTotals:{type:Object,required:!0},weeks:{type:Object,required:!0},initial:{type:Object,required:!0},labels:{type:Object,required:!1}},data:()=>({leftside:0,rightside:0,isDraggingDivider:0,isDragHappening:!1,dragStartWidth:100,thumbLeft:100,thumbWidth:0,pctStart:0,pctEnd:1,maxInfections:1,side:"",useInitial:!0}),computed:{},watch:{},mounted(){this.rightside=this.numDays||0,this.updateWeeks();const e=document.getElementById("dailybar").clientWidth;this.thumbLeft=Math.floor(this.initial[0]*e),this.thumbWidth=Math.ceil((this.initial[1]-this.initial[0])*e);const i=new ResizeObserver(n=>{const u=document.getElementById("dailybar").clientWidth;let c=this.useInitial?this.initial[0]:this.pctStart,_=this.useInitial?this.initial[1]:this.pctEnd;this.useInitial=!1,this.thumbLeft=Math.floor(c*u),this.thumbWidth=Math.ceil((_-c)*u)}),s=document.getElementById("dailybar");s&&i.observe(s)},methods:{updateWeeks(){this.maxInfections=Math.max(...this.weeks)},getWeekHeight(t){return Math.floor(100*t/this.maxInfections)},dividerDragStart(t,e){this.isDraggingDivider=t.clientX,this.dragStartWidth=this.thumbLeft,this.side=e},dividerDragEnd(t){this.isDraggingDivider=0,this.side=""},dividerDragging(t){if(!this.isDraggingDivider)return;if(this.side=="left")return this.adjustLeftSide(t);if(this.side=="right")return this.adjustRightSide(t);const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider;this.thumbLeft=Math.max(0,this.dragStartWidth+s),this.thumbLeft=Math.min(this.thumbLeft,i-this.thumbWidth),this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,this.$emit("range",{start:this.pctStart,end:this.pctEnd})},adjustLeftSide(t){const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider,n=this.thumbLeft+s;n<0||n>=this.thumbLeft+this.thumbWidth-16||(this.isDraggingDivider+=s,this.thumbLeft+=s,this.thumbWidth-=s,this.thumbLeft=Math.max(0,this.thumbLeft),this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,console.log(this.pctStart,this.pctEnd),this.$emit("range",{start:this.pctStart,end:this.pctEnd}))},adjustRightSide(t){const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider,n=this.thumbWidth+s;n<16||this.thumbLeft+n>i||(this.thumbWidth+=s,this.isDraggingDivider=t.clientX,this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,console.log(this.pctStart,this.pctEnd),this.$emit("range",{start:this.pctStart,end:this.pctEnd}))},sizerDragStart(t){console.log("dragStart",t),this.isDraggingDivider=t.clientX,this.dragStartWidth=this.thumbLeft},sizerDragEnd(t){this.isDraggingDivider=0},sizerDragging(t){if(!this.isDraggingDivider)return;console.log("sizer",this.isDraggingDivider,t.clientX,this.thumbLeft,this.thumbWidth);const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider;console.log({deltaX:s});let n=s;console.log(n),console.log("oldwidth",this.thumbWidth,"newwidth",this.thumbWidth-n),console.log("oldleft",this.thumbLeft,"newleft",this.thumbLeft+n),this.thumbWidth-=n,this.thumbLeft+=n,this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,this.$emit("range",{start:this.pctStart,end:this.pctEnd})},filterByDate(){}}}),kJ={id:"dailybar"},OJ={class:"bars"},DJ={key:0,class:"labels"};function FJ(t,e,i,s,n,a){return us(),xn("div",{class:"time-slider",onMousemove:e[9]||(e[9]=vn((...u)=>t.dividerDragging&&t.dividerDragging(...u),["stop"])),onMouseup:e[10]||(e[10]=(...u)=>t.dividerDragEnd&&t.dividerDragEnd(...u))},[Ds("div",kJ,[Ds("div",OJ,[(us(!0),xn(ir,null,Hx(t.weeks,u=>(us(),xn("div",{class:"week",style:Ka({height:`${t.getWeekHeight(u)}%`})},null,4))),256))]),t.labels?(us(),xn("div",DJ,[(us(!0),xn(ir,null,Hx(t.labels,u=>(us(),xn("div",{class:"date-label",style:Ka({left:`${u.leftPct}%`})},sa(u.text),5))),256))])):sc("",!0)]),Ds("div",{id:"dragthumb",style:Ka({left:`${t.thumbLeft}px`,width:`${t.thumbWidth}px`}),onMousedown:e[6]||(e[6]=(...u)=>t.dividerDragStart&&t.dividerDragStart(...u)),onMouseup:e[7]||(e[7]=(...u)=>t.dividerDragEnd&&t.dividerDragEnd(...u)),onMousemove:e[8]||(e[8]=vn((...u)=>t.dividerDragging&&t.dividerDragging(...u),["stop"]))},[Ds("div",{id:"dragleftie",onMousedown:e[0]||(e[0]=vn(u=>t.dividerDragStart(u,"left"),["stop"])),onMouseup:e[1]||(e[1]=vn(u=>t.dividerDragEnd(u,"left"),["stop"])),onMousemove:e[2]||(e[2]=vn(u=>t.dividerDragging(u,"left"),["stop"]))},null,32),Ds("div",{id:"dragrightie",onMousedown:e[3]||(e[3]=vn(u=>t.dividerDragStart(u,"right"),["stop"])),onMouseup:e[4]||(e[4]=vn(u=>t.dividerDragEnd(u,"right"),["stop"])),onMousemove:e[5]||(e[5]=vn(u=>t.dividerDragging(u,"right"),["stop"]))},null,32)],36)],32)}const WD=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},NJ=WD(MJ,[["render",FJ],["__scopeId","data-v-04bdd2c0"]]);function BJ(t){return new Worker("/assets/CSVStreamer.worker-DUKFFnIK.js",{name:t==null?void 0:t.name})}const LJ="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/episim/battery",zJ=fc({name:"InfectionMap",components:{TimeSlider:NJ},data:()=>({map:{},allInfections:[],isLoaded:!1,population:[],numInfections:0,statusText:"Loading...",coordinates:new Float64Array(1),view:0,deckOverlay:{},startDate:"",numDays:0,dailyTotals:new Float32Array(0),filterStartDate:0,filterEndDate:0,weeks:[],labels:[],csvStreamer:null,useMeters:!0,radiusSlider:250,range:[20,1e3],path:"",updating:!0}),computed:{},watch:{view(){this.updateLayers()},radiusSlider(){this.updateLayers()},async useMeters(){await this.setupUnits(),this.updateLayers()}},beforeDestroy(){this.csvStreamer&&this.csvStreamer.terminate(),this.allInfections=[],this.coordinates=new Float64Array(1),this.population=[]},mounted(){this.map=null,this.map=new AC.Map({container:"mymap",style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",center:[8,49.9],zoom:7,bearing:0,pitch:50}),this.loadInfections()},methods:{async setupUnits(){this.updating=!0,this.range=this.useMeters?[10,1e3]:[1,30],await this.$nextTick(),this.updating=!1,!this.useMeters&&this.radiusSlider>30&&(this.radiusSlider=30),await this.$nextTick()},filterByDate(t){const e=Math.floor(this.numDays*t.start),i=Math.ceil(this.numDays*t.end);this.filterStartDate=e,this.filterEndDate=i,this.updateLayers()},async loadInfections(){let t=new URLSearchParams(document.location.search);if(this.path=t.get("path")||"",!this.path){this.statusText="Need file path in URL";return}t.get("units")=="pixels"&&(this.useMeters=!1),this.range=this.useMeters?[20,1e3]:[1,30];const i=parseInt(t.get("radius")||"250");this.radiusSlider=i,this.updating=!1,await this.$nextTick();const s=`${LJ}/${this.path}`;console.log({batteryUrl:s});const n=s.lastIndexOf("summaries/"),a=s.substring(0,n)+"metadata.yaml",u=await(await fetch(a)).text(),c=aX.parse(u);this.startDate=c.startDates?c.startDates[0]:"2020-02-25",console.log(this.startDate),this.csvStreamer=new BJ;let _=0,w=0,S=0;this.csvStreamer.onmessage=async C=>{if(C.data.status&&(this.statusText=C.data.status),C.data.error&&(this.statusText=C.data.error),C.data.finished){const P=_/S,D=w/S;this.finishedLoadingInfections(P,D)}if(C.data.data){const P=C.data.data;this.numInfections+=P.length,this.statusText="Reading infections: "+this.numInfections,P.length&&(_+=P[0].home_lon,w+=P[0].home_lat,S+=1);for(const D of P)this.allInfections.push({home_lon:D.home_lon,home_lat:D.home_lat,daysSinceStart:D.daysSinceStart})}},this.csvStreamer.postMessage({url:s,options:{header:!0,dynamicTyping:!0,skipEmptyLines:!0}})},finishedLoadingInfections(t,e){if(this.csvStreamer.terminate(),!this.allInfections.length){this.statusText="ERROR: No infections file found";return}this.setupDailyTotals(),this.isLoaded=!0,this.buildDeckLayer(t,e)},setupDailyTotals(){this.numDays=this.allInfections[this.allInfections.length-1].daysSinceStart||0,this.filterEndDate=this.numDays,this.dailyTotals=new Float32Array(this.numDays+1),this.allInfections.forEach(a=>{this.dailyTotals[a.daysSinceStart]+=1});let t=0;for(let a=0;a96.5&&(this.labels[this.labels.length-1].leftPct=96.5)},buildDeckLayer(t,e){this.statusText="Generating map...",this.deckOverlay=new NH({layers:[]}),this.map.addControl(this.deckOverlay),this.map.addControl(new AC.NavigationControl),t&&e&&this.map.jumpTo({center:[t,e],zoom:9}),this.statusText="Home locations of infected people",this.updateLayers()},updateLayers(){var i;if(!((i=this.deckOverlay)!=null&&i._deck))return;const t=new URLSearchParams(window.location.search);t.set("radius",""+this.radiusSlider),t.set("units",this.useMeters?"meters":"pixels"),history.replaceState({},"","?"+t.toString());const e=[];e.push(new jw({visible:this.view==0,id:"pointlayer-1",data:this.allInfections,getFillColor:[50,0,180],getRadius:1,getPosition:s=>[s.home_lon,s.home_lat],radiusScale:this.radiusSlider,radiusUnits:this.useMeters?"meters":"pixels",stroked:!1,filled:!0,autoHighlight:!0,highlightColor:[255,255,255],opacity:.05,pickable:!1,useDevicePixels:!1,transitions:{},parameters:{depthTest:!1},glOptions:{fp64:!1},extensions:[new $w({filterSize:1})],filterRange:[this.filterStartDate,this.filterEndDate],getFilterValue:s=>s.daysSinceStart})),this.deckOverlay._deck.setProps({layers:e})}}}),UJ=t=>(LB("data-v-4aad93e9"),t=t(),zB(),t),VJ={class:"app"},jJ={class:"button-row"},$J={class:"flex1",style:{margin:"auto 0","line-height":"1.4rem"}},WJ={style:{"font-size":"0.85rem"}},HJ=UJ(()=>Ds("div",{class:"mymap flex1",id:"mymap"},null,-1)),qJ={class:"flex-row",style:{"font-size":"0.8rem",margin:"0.75rem 0 0 auto",gap:"1rem",color:"white"}};function XJ(t,e,i,s,n,a){const u=Uv("time-slider"),c=Uv("o-slider"),_=Uv("o-checkbox");return us(),xn("div",VJ,[Ds("div",jJ,[Ds("p",$J,[Ds("b",null,sa(t.statusText)+sa(t.filterStartDate+t.filterEndDate?`: Day ${t.filterStartDate} - ${t.filterEndDate}`:""),1),Ds("p",WJ,sa(t.path),1)])]),HJ,t.isLoaded?(us(),tc(u,{key:0,class:"time-slider",numDays:t.numDays,dailyTotals:t.dailyTotals,weeks:t.weeks,initial:[0,30/t.numDays],labels:t.labels,onRange:t.filterByDate},null,8,["numDays","dailyTotals","weeks","initial","labels","onRange"])):sc("",!0),Ds("div",qJ,[Ds("p",null,[Ds("b",null,"Radius: "+sa(t.radiusSlider),1)]),t.updating?sc("",!0):(us(),tc(c,{key:0,modelValue:t.radiusSlider,"onUpdate:modelValue":e[0]||(e[0]=w=>t.radiusSlider=w),variant:"warning",tooltip:!1,min:t.range[0],max:t.range[1],style:{width:"10rem",margin:"0.5rem 0",padding:"0 0.5rem"}},null,8,["modelValue","min","max"])),Ys(_,{class:"max-content",modelValue:t.useMeters,"onUpdate:modelValue":e[1]||(e[1]=w=>t.useMeters=w),variant:"warning"},{default:rd(()=>[Em("meters")]),_:1},8,["modelValue"])])])}const ZJ=WD(zJ,[["render",XJ],["__scopeId","data-v-4aad93e9"]]);/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const KJ=t=>t&&typeof t=="object"&&!Array.isArray(t),xu=t=>t!=null,Vh=t=>xu(t)&&t!=="false"&&t!==!1,Qh=t=>xu(t)?t:"";function YJ(t){return Object.assign({},t)}function ja(t,e,i){const s=e.split(".").reduce((n,a)=>typeof n<"u"?n[a]:void 0,t);return typeof s<"u"?s:i}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */Ei({});const o1=(t,e)=>{t.component(e.name,e)};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const HD=Ei({iconPack:"mdi",useHtml5Validation:!0,statusIcon:!0,transformClasses:void 0}),JJ=()=>YJ(wi(HD.value)),Os=(t,e)=>ja(HD.value,t,e);/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function vr(...t){const e=Am();if(!e)throw new Error("defineClasses must be called within a component setup function.");const i=nB(),s=Ei([]);return s.value=t.map((n,a)=>{const u=n[0],c=n[1],_=n[2],w=n[3];function S(){const C=GJ(e,u,c,jx(_)),P=!xu(w)||jx(w);return{[C]:P}}return i.run(()=>{sr(()=>e.proxy.$props[u],()=>{const C=S();s.value[a]=C}),xu(_)&&zn(_)&&sr(_,(C,P)=>{if(C===P)return;const D=S();s.value[a]=D}),xu(w)&&zn(w)&&sr(w,(C,P)=>{if(C===P)return;const D=s.value[a];Object.keys(D).forEach(j=>D[j]=C),s.value[a]=D})}),S()}),h1()&&DP(()=>{i&&i.stop()}),s}function GJ(t,e,i,s=""){var n;const a=Nx(t),u=(n=t.proxy)==null?void 0:n.$options.configField;if(!u)throw new Error("component must define the 'configField' option.");const c=a.override===!0?{}:JJ();let _=ja(c,`${u}.${e}.class`,"")||ja(c,`${u}.${e}`,""),w=ja(a,e,"");if(Array.isArray(w)&&(w=w.join(" ")),typeof w=="function"){const H=Nx(t);w=w(s,H)}else w=vP(w,s);if(Array.isArray(_)&&(_=_.join(" ")),typeof _=="function"){const H=Nx(t);_=_(s,H)}else _=vP(_,s);i.includes("{*}")?i=i.replace(/\{\*\}/g,Qh(s)):i=i+Qh(s);const S=a.override||ja(c,"override",!1),C=ja(c,`${u}.override`,S);let D=`${ja(c,`${u}.${e}.override`,C)?"":i} ${Qh(_)} ${Qh(w)}`.trim().replace(/\s\s+/g," ");const j=ja(c,"transformClasses",void 0),L=ja(c,`${u}.transformClasses`,void 0);return L?D=L(D):j&&(D=j(D)),D}function vP(t,e){return Qh(t).split(" ").filter(i=>i.length>0).map(i=>i+Qh(e)).join(" ")}const Nx=t=>{let e=t.proxy.$props;return e=Object.keys(e).filter(i=>i.endsWith("Props")).map(i=>e[i]).reduce((i,s)=>({...i,...s}),e),e};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const QJ=Symbol("FielData");function eG(){const t=ad(QJ,void 0),e=Lt(()=>{var n;if((n=t==null?void 0:t.value)!=null&&n.fieldVariant){if(typeof t.value.fieldVariant=="string")return t.value.fieldVariant;if(Array.isArray(t.value.fieldVariant)){for(const a in t.value.fieldVariant)if(t.value.fieldVariant[a])return a}}}),i=Lt(()=>{var n;return(n=t.value)!=null&&n.hasMessage?t.value.fieldMessage:""}),s=Lt(()=>Os("statusVariantIcon",{success:"check",danger:"alert-circle",info:"information",warning:"alert"})[e.value]||"");return{parentField:t,statusVariant:e,statusVariantIcon:s,statusMessage:i}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function qa(t){const e=jx(t);return(e==null?void 0:e.$el)??e}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const md=typeof window<"u",qD=typeof window>"u";/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const tG=qD?[]:[HTMLButtonElement,HTMLFieldSetElement,HTMLInputElement,HTMLObjectElement,HTMLOutputElement,HTMLSelectElement,HTMLTextAreaElement];function xP(t){return tG.some(e=>t instanceof e)?t:null}const iG=["disabled","required","pattern","maxlength","minlength","max","min","step"];function sG(t,e,i){const{parentField:s}=eG(),n=Lt(()=>{const H=qa(t);if(!H)return;if(H.getAttribute("data-oruga-input"))return H;const te=H.querySelector("[data-oruga-input]");if(!te){console.warn("useInputHandler: Underlaying Oruga input component not found");return}return te}),a=Lt(()=>{const H=n.value;return H||console.warn("useInputHandler: inputRef contains no element"),H}),u=Ei(!1);function c(){nd(()=>{a.value&&a.value.focus()})}function _(){nd(()=>{a.value&&a.value.click()})}function w(H){u.value=!1,s!=null&&s.value&&s.value.setFocus(!1),e("blur",H),D()}function S(H){u.value=!0,s!=null&&s.value&&s.value.setFocus(!0),e("focus",H)}const C=Ei(!0);function P(H,te){nd(()=>{s!=null&&s.value&&(s.value.props.variant||s.value.setVariant(H),s.value.props.message||s.value.setMessage(te))})}function D(){i.useHtml5Validation&&a.value&&(a.value.validity.valid?(P(null,null),C.value=!0):(j(),C.value=!1))}function j(){const H="danger",te=i.validationMessage||a.value.validationMessage;P(H,te)}function L(H){D();const te=xP(H.target);if(te&&(s!=null&&s.value)&&i.useHtml5Validation){H.preventDefault();let G=!1;if(te.form!=null){const se=te.form.elements;for(let ve=0;ve{C.value||D()};let te=null;sr([n,C,()=>i.useHtml5Validation],G=>{const se=G[0],ve=G[1],Se=G[2];if(te!=null&&(te.takeRecords().length>0&&H(),te.disconnect()),!xu(se)||ve||!Se)return;te==null&&(te=new MutationObserver(H)),te.observe(se,{attributeFilter:iG});let ge=se;for(;ge=ge.parentNode;)ge instanceof HTMLFieldSetElement&&te.observe(ge,{attributeFilter:["disabled"]})},{immediate:!0})}return{input:a,isFocused:u,isValid:C,setFocus:c,doClick:_,onFocus:S,onBlur:w,checkHtml5Validity:D,onInvalid:L}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function nG(t){if(t.style.position==="fixed"||!t)return document.documentElement;let e=!1,i=t.parentElement;for(;!e&&xu(i)&&i!==document.documentElement;){const{overflow:s,overflowY:n}=getComputedStyle(i),{scrollHeight:a,clientHeight:u}=i;if(e=/(auto|scroll)/.test(`${s}${n}`)&&a>u,e)break;i=i.parentElement}return i}const rG=fc({inheritAttrs:!1,__name:"PositionWrapper",props:{teleport:{type:[Boolean,String,Object],required:!0},trigger:{type:Object,default:void 0},position:{type:String,validator:t=>["auto","top","bottom","left","right","top-right","top-left","bottom-left","bottom-right"].indexOf(t)>-1,default:void 0},defaultPosition:{type:String,validator:t=>["top","bottom","left","right"].indexOf(t)>-1,default:"top"},disabled:{type:Boolean,default:!1},disablePositioning:{type:Boolean,default:!0}},emits:["update:position"],setup(t,{emit:e}){const i={top:"bottom",bottom:"top",right:"left",left:"right"},s=t,n=e,a=Lt(()=>typeof s.teleport=="boolean"?"body":s.teleport),u=Lt(()=>typeof s.teleport=="boolean"||!s.teleport?!s.teleport:!1),c=Ei();function _(G){return c.value=G,nd(()=>{j(),P()}),G}const w=s.position,S=Ei(void 0),C=Ei(null);md&&window.ResizeObserver&&(C.value=new window.ResizeObserver(j)),sr(()=>s.disabled,()=>{s.disabled?D():P()},{immediate:!0,flush:"post"}),sr([()=>!!s.trigger,()=>s.disablePositioning,()=>s.disabled],()=>j(),{immediate:!0,flush:"post"}),S1(()=>D());function P(){md&&!S.value&&c.value&&(S.value=nG(qa(c)),S.value&&S.value!==document.documentElement?(S.value.addEventListener("scroll",j,{passive:!0}),window.ResizeObserver&&C.value.observe(S.value)):(document.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j)))}function D(){var G;md&&(window.ResizeObserver&&((G=C.value)==null||G.disconnect()),window.removeEventListener("resize",j),document.removeEventListener("scroll",j),S.value=void 0)}function j(){if(s.disabled)return;let G=s.position;if(w==="auto"&&(G=L(),G!=s.position&&n("update:position",G)),!s.teleport)return;const se=qa(c),ve=qa(s.trigger);if(se&&ve){const Se=ve.getBoundingClientRect();let ge=Se.top+window.scrollY,De=Se.left+window.scrollX;G.includes("bottom")?ge+=ve.clientHeight:G.includes("top")&&(ge-=se.clientHeight),G==="left"?De-=se.clientWidth:G==="right"?De+=ve.clientWidth:G.includes("-right")&&(De+=ve.clientWidth-se.clientWidth),(G==="top"||G==="bottom")&&(De+=ve.clientWidth/2),(G==="left"||G==="right")&&(ge+=ve.clientHeight/2),s.disablePositioning?(se.style.position="relative",se.style.top=`${ge}px`,se.style.left=`${De}px`):(se.style.position="",se.style.top="",se.style.left="")}}function L(){let G=s.defaultPosition;if(!s.trigger||!c.value||!S.value)return G;const se=new DOMRect(S.value.offsetLeft,S.value.offsetTop,S.value.clientWidth,S.value.clientHeight),ve=qa(c).getBoundingClientRect(),Se=qa(s.trigger).getBoundingClientRect(),ge=te(Se),De=te(ve),Fe=yt=>{const Ft=ge[yt],jt=De[i[yt]];return new DOMRect(ve.x+(Ft.x-jt.x),ve.y+(Ft.y-jt.y),ve.width,ve.height)},Be=i[s.defaultPosition],Qe=s.defaultPosition==="top"||s.defaultPosition==="bottom"?"left":"top",He=i[Qe],Xe=[s.defaultPosition,Be,Qe,He];let dt=0;for(const yt of Xe){const Ft=H(se,Fe(yt));Ft>dt&&(dt=Ft,G=yt)}return G}function H(G,se){const ve=Math.max(G.left,se.left),Se=Math.min(G.right,se.right),ge=Math.max(G.top,se.top),De=Math.min(G.bottom,se.bottom);return Math.max(Se-ve,0)*Math.max(De-ge,0)}const te=G=>({top:{x:(G.left+G.right)*.5,y:G.top},bottom:{x:(G.left+G.right)*.5,y:G.bottom},left:{x:G.left,y:(G.top+G.bottom)*.5},right:{x:G.right,y:(G.top+G.bottom)*.5}});return(G,se)=>(us(),tc(_L,{to:a.value,disabled:u.value},[u.value?Tu(G.$slots,"default",{key:0,setContent:_}):(us(),xn("div",x0({key:1},G.$attrs,{style:{position:"absolute",left:"0px",top:"0px"}}),[Tu(G.$slots,"default",{setContent:_})],16))],8,["to","disabled"]))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function XD(t,e,i=document,s){let n;const a=()=>{if(!i)return;const _=qa(i),w=KJ(s)?{...s}:s;setTimeout(()=>{_.addEventListener(t,e,w),n=()=>_.removeEventListener(t,e,w)})};let u;typeof(s==null?void 0:s.trigger)<"u"&&(u=sr(s.trigger,_=>{_?a():c()},{flush:"post"})),s!=null&&s.immediate?a():T1(()=>{(typeof(s==null?void 0:s.trigger)>"u"||s.trigger.value)&&a()});const c=()=>{typeof u=="function"&&u(),typeof n=="function"&&n()};return h1()&&DP(c),c}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function oG(t,e){var i;const s=Am();if(!s)throw new Error("useProviderChild must be called within a component setup function.");const n=(i=s.proxy)==null?void 0:i.$options.configField,a=(e==null?void 0:e.key)||n,u=Ei([]),c=Ei(1),_=Lt(()=>u.value.slice().sort((P,D)=>P.index-D.index));function w(P){const D=u.value.length,j=C(),L={index:D,data:P,identifier:j};return u.value.push(L),L}function S(P){u.value=u.value.filter(D=>D!==P)}function C(){return String(c.value++)}return dR("$o-"+a,{registerItem:w,unregisterItem:S,data:e==null?void 0:e.data}),{childItems:u,sortedItems:_}}function aG(t={needParent:!0}){var e;const i=Am();if(!i)throw new Error("useProviderChild must be called within a component setup function.");const s=(e=i.proxy)==null?void 0:e.$options.configField,n=(t==null?void 0:t.key)||s,a=ad("$o-"+n,void 0),u=t.needParent!==!1,c=t.register!==!1;if(u&&!a)throw new Error(`You should wrap ${i.proxy.$options.name} in a ${n} component`);const _=Ei();return a&&c&&(_.value=a.registerItem(t.data)),E1(()=>{a&&_.value&&a.unregisterItem(_.value)}),{parent:a==null?void 0:a.data,item:_}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function lG(t,e,i={}){if(!window)return;const s=Object.assign({ignore:[]},i),n=c=>s.ignore.some(_=>{if(typeof _=="string")return Array.from(window.document.querySelectorAll(_)).some(w=>w===c.target||c.composedPath().includes(w));{const w=qa(_);return w&&(c.target===w||c.composedPath().includes(w))}});return XD("click",c=>{const _=qa(t);!_||_===c.target||c.composedPath().includes(_)||n(c)||e(c)},window,s)}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const cG=["aria-checked"],uG=["disabled","required","name","autocomplete","value",".indeterminate","true-value","false-value"],hG=fc({isOruga:!0,name:"OCheckbox",configField:"checkbox",inheritAttrs:!1,__name:"Checkbox",props:G_({override:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},variant:{type:String,default:()=>Os("checkbox.variant")},size:{type:String,default:()=>Os("checkbox.size")},label:{type:String,default:void 0},indeterminate:{type:Boolean,default:!1},nativeValue:{type:[String,Number,Boolean,Object],default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},name:{type:String,default:void 0},trueValue:{type:[String,Number,Boolean,Object],default:!0},falseValue:{type:[String,Number,Boolean,Object],default:!1},autocomplete:{type:String,default:()=>Os("checkbox.autocomplete","off")},useHtml5Validation:{type:Boolean,default:()=>Os("useHtml5Validation",!0)},rootClass:{type:[String,Array,Function],default:void 0},disabledClass:{type:[String,Array,Function],default:void 0},checkedClass:{type:[String,Array,Function],default:void 0},inputClass:{type:[String,Array,Function],default:void 0},inputCheckedClass:{type:[String,Array,Function],default:void 0},indeterminateClass:{type:[String,Array,Function],default:void 0},labelClass:{type:[String,Array,Function],default:void 0},sizeClass:{type:[String,Array,Function],default:void 0},variantClass:{type:[String,Array,Function],default:void 0}},{modelValue:{default:void 0},modelModifiers:{},indeterminate:{type:Boolean,default:!1},indeterminateModifiers:{}}),emits:G_(["update:modelValue","input","update:indeterminate","focus","blur","invalid"],["update:modelValue","update:indeterminate"]),setup(t,{expose:e,emit:i}){const s=t,n=i,a=Ei(),{onBlur:u,onFocus:c,onInvalid:_,setFocus:w}=sG(a,n,s),S=Gx(t,"modelValue"),C=Gx(t,"indeterminate"),P=Lt(()=>S.value===s.trueValue||Array.isArray(S.value)&&S.value.includes(s.nativeValue));function D(te){n("input",S.value,te)}const j=vr(["rootClass","o-chk"],["checkedClass","o-chk--checked",null,P],["sizeClass","o-chk--",Lt(()=>s.size),Lt(()=>!!s.size)],["disabledClass","o-chk--disabled",null,Lt(()=>s.disabled)],["variantClass","o-chk--",Lt(()=>s.variant),Lt(()=>!!s.variant)]),L=vr(["inputClass","o-chk__input"],["inputCheckedClass","o-chk__input--checked",null,P],["indeterminateClass","o-chk__input--indeterminate",null,C]),H=vr(["labelClass","o-chk__label"]);return e({focus:w,value:S}),(te,G)=>(us(),xn("label",{ref:"label",class:Nn(Pi(j)),"data-oruga":"checkbox",role:"checkbox","aria-checked":P.value,onClick:G[5]||(G[5]=vn((...se)=>Pi(w)&&Pi(w)(...se),["stop"])),onKeydown:G[6]||(G[6]=eu(vn((...se)=>Pi(w)&&Pi(w)(...se),["prevent"]),["enter"]))},[eR(Ds("input",x0(te.$attrs,{ref_key:"inputRef",ref:a,"onUpdate:modelValue":G[0]||(G[0]=se=>S.value=se),type:"checkbox","data-oruga-input":"checkbox",class:Pi(L),disabled:t.disabled,required:t.required,name:t.name,autocomplete:t.autocomplete,value:t.nativeValue,".indeterminate":t.indeterminate,"true-value":t.trueValue,"false-value":t.falseValue,onClick:G[1]||(G[1]=vn(()=>{},["stop"])),onBlur:G[2]||(G[2]=(...se)=>Pi(u)&&Pi(u)(...se)),onFocus:G[3]||(G[3]=(...se)=>Pi(c)&&Pi(c)(...se)),onInvalid:G[4]||(G[4]=(...se)=>Pi(_)&&Pi(_)(...se)),onInput:D}),null,48,uG),[[_4,S.value]]),t.label||te.$slots.default?(us(),xn("span",{key:0,class:Nn(Pi(H))},[Tu(te.$slots,"default",{},()=>[Em(sa(t.label),1)])],2)):sc("",!0)],42,cG))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const dG={install(t){o1(t,hG)}};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const fG=fc({isOruga:!0,name:"OTooltip",configField:"tooltip",__name:"Tooltip",props:G_({override:{type:Boolean,default:void 0},active:{type:Boolean,default:!1},label:{type:String,default:void 0},variant:{type:String,default:()=>Os("tooltip.variant")},position:{type:String,default:()=>Os("tooltip.position","auto"),validator:t=>["auto","top","bottom","left","right","top-right","top-left","bottom-left","bottom-right"].indexOf(t)>-1},always:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},animation:{type:String,default:()=>Os("tooltip.animation","fade")},multiline:{type:Boolean,default:!1},triggerTag:{type:[String,Object,Function],default:()=>Os("tooltip.triggerTag","div")},triggers:{type:Array,default:()=>Os("tooltip.triggers",["hover"]),validator:t=>t.filter(e=>["click","hover","contextmenu","focus"].indexOf(e)>-1).length===t.length},delay:{type:Number,default:void 0},closeable:{type:[Array,Boolean],default:()=>Os("tooltip.closeable",["escape","outside","content"])},teleport:{type:[Boolean,String,Object],default:()=>Os("dropdown.teleport",!1)},rootClass:{type:[String,Array,Function],default:void 0},teleportClass:{type:[String,Array,Function],default:void 0},contentClass:{type:[String,Array,Function],default:void 0},positionClass:{type:[String,Array,Function],default:void 0},triggerClass:{type:[String,Array,Function],default:void 0},multilineClass:{type:[String,Array,Function],default:void 0},alwaysClass:{type:[String,Array,Function],default:void 0},variantClass:{type:[String,Array,Function],default:void 0},arrowClass:{type:[String,Array,Function],default:void 0},arrowPositionClass:{type:[String,Array,Function],default:void 0}},{active:{type:Boolean,default:!1},activeModifiers:{}}),emits:G_(["update:active","close","open"],["update:active"]),setup(t,{emit:e}){const i=t,s=e,n=Gx(t,"active");sr(n,De=>{s(De?"open":"close")});const a=Ei(),u=Ei(i.position);sr(()=>i.position,De=>u.value=De);const c=Ei(),_=Ei(),w=Ei([]);sr(n,De=>{De&&md?setTimeout(()=>{S.value.indexOf("outside")>=0&&w.value.push(lG(c,C,{ignore:[_],immediate:!0,passive:!0})),S.value.indexOf("escape")>=0&&w.value.push(XD("keyup",P,document,{immediate:!0}))}):De||(w.value.forEach(Fe=>Fe()),w.value.length=0)});const S=Lt(()=>typeof i.closeable=="boolean"?i.closeable?["escape","outside","content"]:[]:i.closeable);function C(){!n.value||i.always||S.value.indexOf("outside")<0||(n.value=!1)}function P(De){if(n.value&&(De.key==="Escape"||De.key==="Esc")){if(S.value.indexOf("escape")<0)return;n.value=!1}}function D(){i.triggers.indexOf("click")<0||nd(()=>setTimeout(()=>te()))}function j(De){i.triggers.indexOf("contextmenu")<0||(De.preventDefault(),te())}function L(){i.triggers.indexOf("focus")<0||te()}function H(){i.triggers.indexOf("hover")<0||te()}function te(){i.disabled||(i.delay?a.value=setTimeout(()=>{n.value=!0,a.value=null},i.delay):n.value=!0)}function G(){S.value.indexOf("content")<0||(n.value=!i.closeable,a.value&&i.closeable&&clearTimeout(a.value))}const se=vr(["rootClass","o-tip"],["teleportClass","o-tip--teleport",null,Lt(()=>!!i.teleport)]),ve=vr(["triggerClass","o-tip__trigger"]),Se=vr(["arrowClass","o-tip__arrow"],["arrowPositionClass","o-tip__arrow--",u,Lt(()=>!!u.value)],["variantArrowClass","o-tip__arrow--",Lt(()=>i.variant),Lt(()=>!!i.variant)]),ge=vr(["contentClass","o-tip__content"],["positionClass","o-tip__content--",u,Lt(()=>!!u.value)],["variantClass","o-tip__content--",Lt(()=>i.variant),Lt(()=>!!i.variant)],["multilineClass","o-tip__content--multiline",null,Lt(()=>i.multiline)],["alwaysClass","o-tip__content--always",null,Lt(()=>i.always)]);return(De,Fe)=>(us(),xn("div",{class:Nn(Pi(se)),"data-oruga":"tooltip"},[Ys(rG,{position:u.value,"onUpdate:position":Fe[0]||(Fe[0]=Be=>u.value=Be),teleport:t.teleport,class:Nn(Pi(se)),trigger:_.value,"default-position":"top",disabled:!n.value},{default:rd(({setContent:Be})=>[Ys(M1,{name:t.animation},{default:rd(()=>[eR(Ds("div",{ref:Qe=>c.value=Be(Qe),class:Nn(Pi(ge))},[Ds("span",{class:Nn(Pi(Se))},null,2),Tu(De.$slots,"content",{},()=>[Em(sa(t.label),1)])],2),[[i4,n.value||t.always&&!t.disabled]])]),_:2},1032,["name"])]),_:3},8,["position","teleport","class","trigger","disabled"]),(us(),tc(QB(t.triggerTag),{ref_key:"triggerRef",ref:_,class:Nn(Pi(ve)),"aria-haspopup":"true",onClick:D,onContextmenu:j,onMouseenter:H,onFocusCapture:L,onBlurCapture:G,onMouseleave:G},{default:rd(()=>[Tu(De.$slots,"default",{active:n.value})]),_:3},40,["class"]))],2))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const pG=["tabindex","aria-label","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled","onKeydown"],mG={key:0},wP=fc({isOruga:!0,name:"OSliderThumb",configField:"slider",inheritAttrs:!1,__name:"SliderThumb",props:{sliderProps:{type:Object,required:!0},modelValue:{type:Number,required:!0},sliderSize:{type:Function,required:!0},thumbWrapperClasses:{type:Array,required:!0},thumbClasses:{type:Array,required:!0}},emits:["update:modelValue","change","dragstart","dragend"],setup(t,{expose:e,emit:i}){const s=t,n=i,a=Lt(()=>s.sliderProps),u=Ei(!1),c=Ei(!1),_=Ei(0),w=Ei(0),S=Ei(null),C=Ei(s.modelValue),P=Lt(()=>a.value.tooltip),D=Lt(()=>a.value.tooltipAlways),j=Lt(()=>a.value.disabled),L=Lt(()=>a.value.max),H=Lt(()=>a.value.min),te=Lt(()=>a.value.step),G=Lt(()=>a.value.indicator),se=Lt(()=>a.value.ariaLabel),ve=Lt(()=>{const Jt=[H.value,L.value,te.value].map(pi=>{const mi=(""+pi).split(".")[1];return mi?mi.length:0});return Math.max(...Jt)}),Se=Lt(()=>a.value.tooltipVariant?a.value.tooltipVariant:a.value.variant),ge=Lt(()=>`${(s.modelValue-H.value)/(L.value-H.value)*100}%`),De=Lt(()=>({left:ge.value})),Fe=Lt(()=>typeof a.value.customFormatter<"u"?a.value.customFormatter(s.modelValue):a.value.format==="percent"?new Intl.NumberFormat(a.value.locale,{style:"percent"}).format((s.modelValue-H.value)/(L.value-H.value)):new Intl.NumberFormat(a.value.locale).format(s.modelValue));function Be(){u.value=!0}function Qe(){u.value=!1}function He(Jt){j.value||(Jt.preventDefault(),jt(Jt),md&&(document.addEventListener("mousemove",kt),document.addEventListener("touchmove",kt),document.addEventListener("mouseup",Yt),document.addEventListener("touchend",Yt),document.addEventListener("contextmenu",Yt)))}function Xe(){j.value||s.modelValue===H.value||(S.value=parseFloat(ge.value)-te.value/(L.value-H.value)*100,bi(S.value),n("change"))}function dt(){j.value||s.modelValue===L.value||(S.value=parseFloat(ge.value)+te.value/(L.value-H.value)*100,bi(S.value),n("change"))}function yt(){j.value||s.modelValue===H.value||(S.value=0,bi(S.value),n("change"))}function Ft(){j.value||s.modelValue===L.value||(S.value=100,bi(S.value),n("change"))}function jt(Jt){c.value=!0,n("dragstart"),Jt.type==="touchstart"&&(Jt.clientX=Jt.touches[0].clientX),_.value=Jt.clientX,w.value=parseFloat(ge.value),S.value=w.value}function kt(Jt){if(c.value){Jt.type==="touchmove"&&(Jt.clientX=Jt.touches[0].clientX);const pi=(Jt.clientX-_.value)/s.sliderSize()*100;S.value=w.value+pi,bi(S.value)}}function Yt(){c.value=!1,n("dragend"),s.modelValue!==C.value&&n("change"),bi(S.value),md&&(document.removeEventListener("mousemove",kt),document.removeEventListener("touchmove",kt),document.removeEventListener("mouseup",Yt),document.removeEventListener("touchend",Yt),document.removeEventListener("contextmenu",Yt))}function bi(Jt){if(Jt===null||isNaN(Jt))return;Jt<0?Jt=0:Jt>100&&(Jt=100);const pi=100/((L.value-H.value)/te.value);let Hs=Math.round(Jt/pi)*pi/100*(L.value-H.value)+H.value;Hs=parseFloat(Hs.toFixed(ve.value)),n("update:modelValue",Hs),!c.value&&Hs!==C.value&&(C.value=Hs)}return e({setPosition:bi}),(Jt,pi)=>(us(),xn("div",{class:Nn(t.thumbWrapperClasses),style:Ka(De.value),"data-oruga":"slider-thumb"},[Ys(fG,{label:Fe.value,variant:Se.value,disabled:j.value||!P.value,always:D.value||c.value||u.value},{default:rd(()=>[Ds("div",x0(Jt.$attrs,{class:t.thumbClasses,tabindex:j.value?null:0,role:"slider","aria-label":se.value,"aria-valuenow":t.modelValue,"aria-valuemin":H.value,"aria-valuemax":L.value,"aria-disabled":j.value,"aria-orientation":"horizontal",onMousedown:He,onTouchstartPassive:He,onFocus:Be,onBlur:Qe,onKeydown:[eu(vn(Xe,["prevent"]),["left"]),eu(vn(dt,["prevent"]),["right"]),eu(vn(Xe,["prevent"]),["down"]),eu(vn(dt,["prevent"]),["up"]),eu(vn(yt,["prevent"]),["home"]),eu(vn(Ft,["prevent"]),["end"])]}),[G.value?(us(),xn("span",mG,sa(Fe.value),1)):sc("",!0)],16,pG)]),_:1},8,["label","variant","disabled","always"])],6))}}),ZD=fc({isOruga:!0,name:"OSliderTick",configField:"slider",__name:"SliderTick",props:{override:{type:Boolean,default:void 0},value:{type:Number,required:!0},label:{type:String,default:void 0},tickClass:{type:[String,Function,Array],default:void 0},tickHiddenClass:{type:[String,Function,Array],default:void 0},tickLabelClass:{type:[String,Function,Array],default:void 0}},setup(t){const e=t,{parent:i}=aG(),s=Lt(()=>{const _=(e.value-i.value.min)/(i.value.max-i.value.min)*100;return _>=0&&_<=100?_:0}),n=Lt(()=>e.value===i.value.min||e.value===i.value.max),a=Lt(()=>({left:s.value+"%"})),u=vr(["tickClass","o-slide__tick"],["tickHiddenClass","o-slide__tick--hidden",null,n]),c=vr(["tickLabelClass","o-slide__tick-label"]);return(_,w)=>(us(),xn("div",{class:Nn(Pi(u)),style:Ka(a.value),"data-oruga":"slider-tick"},[_.$slots.default?(us(),xn("span",{key:0,class:Nn(Pi(c))},[Tu(_.$slots,"default",{},()=>[Em(sa(t.label),1)])],2)):sc("",!0)],6))}}),gG=fc({isOruga:!0,name:"OSlider",configField:"slider",__name:"Slider",props:{override:{type:Boolean,default:void 0},modelValue:{default:void 0},range:{},min:{default:0},max:{default:100},step:{default:1},variant:{default:()=>Os("slider.variant")},size:{default:()=>Os("slider.size")},ticks:{type:Boolean,default:!1},tooltip:{type:Boolean,default:()=>Os("slider.tooltip",!0)},tooltipVariant:{default:()=>Os("slider.tooltipVariant")},tooltipAlways:{type:Boolean,default:!1},rounded:{type:Boolean,default:()=>Os("slider.rounded",!1)},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},customFormatter:{type:Function,default:void 0},biggerSliderFocus:{type:Boolean,default:!1},indicator:{type:Boolean,default:!1},format:{default:()=>Os("slider.format","raw")},locale:{default:()=>Os("locale")},ariaLabel:{default:()=>Os("slider.ariaLabel")},rootClass:{},sizeClass:{},trackClass:{},fillClass:{},thumbRoundedClass:{},thumbDraggingClass:{},disabledClass:{},thumbWrapperClass:{},thumbClass:{},variantClass:{},tickClass:{},tickHiddenClass:{},tickLabelClass:{},thumbWrapperDraggingClass:{}},emits:["update:modelValue","change","dragging","dragstart","dragend"],setup(t,{expose:e,emit:i}){const s=t,n=i,a=Ei(),u=Ei(),c=Ei(),_=Lt(()=>({max:s.max,min:s.min}));oG(void 0,{data:_});const w=Ei(null),S=Ei(null),C=Ei(!1),P=Ei(),D=Ei(),j=Lt(()=>Math.min(w.value,S.value)),L=Lt(()=>Math.max(w.value,S.value)),H=Lt(()=>Vh(s.range)?[j.value,L.value]:w.value||0);sr([w,S],()=>{Vh(s.range)&&(P.value=w.value>S.value),(!s.lazy||!C.value)&&n("update:modelValue",H.value),C.value&&n("dragging",H.value)}),sr([()=>s.min,()=>s.max,()=>s.modelValue],()=>te(s.modelValue),{immediate:!0});function te(Ft){if(!(s.min>s.max))if(Array.isArray(Ft)){const jt=typeof Ft[0]!="number"||isNaN(Ft[0])?s.min:Math.min(Math.max(s.min,Ft[0]),s.max),kt=typeof Ft[1]!="number"||isNaN(Ft[1])?s.max:Math.max(Math.min(s.max,Ft[1]),s.min);w.value=P.value?kt:jt,S.value=P.value?jt:kt}else w.value=isNaN(Ft)?s.min:Math.min(s.max,Math.max(s.min,Ft)),S.value=null}const G=Lt(()=>{if(!s.ticks||s.min>s.max||s.step===0)return[];const Ft=[];for(let jt=s.min+s.step;jtVh(s.range)?`${100*(L.value-j.value)/(s.max-s.min)}%`:`${100*(w.value-s.min)/(s.max-s.min)}%`),ve=Lt(()=>Vh(s.range)?`${100*(j.value-s.min)/(s.max-s.min)}%`:"0%"),Se=Lt(()=>({width:se.value,left:ve.value}));function ge(){return a.value.getBoundingClientRect().width}function De(Ft){if(s.disabled||D.value)return;const jt=a.value.getBoundingClientRect().left,kt=(Ft.clientX-jt)/ge()*100,Yt=s.min+kt*(s.max-s.min)/100,bi=Math.abs(Yt-w.value);if(Vh(s.range)){const Jt=Math.abs(Yt-S.value);if(bi<=Jt){if(biD.value=!1),C.value=!1,n("dragend"),s.lazy&&n("update:modelValue",H.value)}const Qe=vr(["rootClass","o-slide"],["sizeClass","o-slide--",Lt(()=>s.size),Lt(()=>!!s.size)],["disabledClass","o-slide--disabled",null,Lt(()=>s.disabled)]),He=vr(["trackClass","o-slide__track"]),Xe=vr(["fillClass","o-slide__fill"],["variantClass","o-slide__fill--",Lt(()=>s.variant),Lt(()=>!!s.variant)]),dt=vr(["thumbClass","o-slide__thumb"],["thumbDraggingClass","o-slide__thumb--dragging",null,C],["thumbRoundedClass","o-slide__thumb--rounded",null,Lt(()=>s.rounded)]),yt=vr(["thumbWrapperClass","o-slide__thumb-wrapper"],["thumbWrapperDraggingClass","o-slide__thumb-wrapper--dragging",null,C]);return e({value:H}),(Ft,jt)=>(us(),xn("div",{class:Nn(Pi(Qe)),"data-oruga":"slider",onClick:De},[Ds("div",{ref_key:"sliderRef",ref:a,class:Nn(Pi(He))},[Ds("div",{class:Nn(Pi(Xe)),style:Ka(Se.value)},null,6),Ft.ticks?(us(!0),xn(ir,{key:0},Hx(G.value,(kt,Yt)=>(us(),tc(ZD,{key:Yt,value:kt,"tick-class":Ft.tickClass,"tick-hidden-class":Ft.tickHiddenClass,"tick-label-class":Ft.tickLabelClass},null,8,["value","tick-class","tick-hidden-class","tick-label-class"]))),128)):sc("",!0),Tu(Ft.$slots,"default"),Ys(wP,{ref_key:"thumbStartRef",ref:u,modelValue:w.value,"onUpdate:modelValue":jt[0]||(jt[0]=kt=>w.value=kt),"slider-props":s,"slider-size":ge,"thumb-classes":Pi(dt),"thumb-wrapper-classes":Pi(yt),onChange:jt[1]||(jt[1]=kt=>n("change",H.value)),onDragstart:Fe,onDragend:Be},null,8,["modelValue","thumb-classes","thumb-wrapper-classes"]),Pi(Vh)(s.range)?(us(),tc(wP,{key:1,ref_key:"thumbEndRef",ref:c,modelValue:S.value,"onUpdate:modelValue":jt[2]||(jt[2]=kt=>S.value=kt),"slider-props":s,"slider-size":ge,"thumb-classes":Pi(dt),"thumb-wrapper-classes":Pi(yt),onChange:jt[3]||(jt[3]=kt=>n("change",H.value)),onDragstart:Fe,onDragend:Be},null,8,["modelValue","thumb-classes","thumb-wrapper-classes"])):sc("",!0)],2)],2))}}),_G={install(t){o1(t,gG),o1(t,ZD)}};S4(ZJ).use(dG).use(_G).mount("#app"); +`}),staticAttributes:p,staticUniforms:E}}class kc{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(r,f,p,g,y,E,C,M,O){this.context=r;let N=this.boundPaintVertexBuffers.length!==g.length;for(let B=0;!N&&B({u_matrix:b,u_texture:0,u_ele_delta:r,u_fog_matrix:f,u_fog_color:p?p.properties.get("fog-color"):c.aM.white,u_fog_ground_blend:p?p.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:p?p.calculateFogBlendOpacity(g):0,u_horizon_color:p?p.properties.get("horizon-color"):c.aM.white,u_horizon_fog_blend:p?p.properties.get("horizon-fog-blend"):1});function X(b){const r=[];for(let f=0;f({u_depth:new c.aH(Re,$e.u_depth),u_terrain:new c.aH(Re,$e.u_terrain),u_terrain_dim:new c.aI(Re,$e.u_terrain_dim),u_terrain_matrix:new c.aJ(Re,$e.u_terrain_matrix),u_terrain_unpack:new c.aK(Re,$e.u_terrain_unpack),u_terrain_exaggeration:new c.aI(Re,$e.u_terrain_exaggeration)}))(r,Ee),this.binderUniforms=p?p.getUniforms(r,Ee):[]}draw(r,f,p,g,y,E,C,M,O,N,B,H,J,te,ae,he,de,_e){const re=r.gl;if(this.failedToCreate)return;if(r.program.set(this.program),r.setDepthMode(p),r.setStencilMode(g),r.setColorMode(y),r.setCullFace(E),M){r.activeTexture.set(re.TEXTURE2),re.bindTexture(re.TEXTURE_2D,M.depthTexture),r.activeTexture.set(re.TEXTURE3),re.bindTexture(re.TEXTURE_2D,M.texture);for(const Ee in this.terrainUniforms)this.terrainUniforms[Ee].set(M[Ee])}for(const Ee in this.fixedUniforms)this.fixedUniforms[Ee].set(C[Ee]);ae&&ae.setUniforms(r,this.binderUniforms,J,{zoom:te});let xe=0;switch(f){case re.LINES:xe=2;break;case re.TRIANGLES:xe=3;break;case re.LINE_STRIP:xe=1}for(const Ee of H.get()){const Re=Ee.vaos||(Ee.vaos={});(Re[O]||(Re[O]=new kc)).bind(r,this,N,ae?ae.getPaintVertexBuffers():[],B,Ee.vertexOffset,he,de,_e),re.drawElements(f,Ee.primitiveLength*xe,re.UNSIGNED_SHORT,Ee.primitiveOffset*xe*2)}}}function me(b,r,f){const p=1/Qt(f,1,r.transform.tileZoom),g=Math.pow(2,f.tileID.overscaledZ),y=f.tileSize*Math.pow(2,r.transform.tileZoom)/g,E=y*(f.tileID.canonical.x+f.tileID.wrap*g),C=y*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[p,b.fromScale,b.toScale],u_fade:b.t,u_pixel_coord_upper:[E>>16,C>>16],u_pixel_coord_lower:[65535&E,65535&C]}}const Be=(b,r,f,p)=>{const g=r.style.light,y=g.properties.get("position"),E=[y.x,y.y,y.z],C=function(){var O=new c.A(9);return c.A!=Float32Array&&(O[1]=0,O[2]=0,O[3]=0,O[5]=0,O[6]=0,O[7]=0),O[0]=1,O[4]=1,O[8]=1,O}();g.properties.get("anchor")==="viewport"&&function(O,N){var B=Math.sin(N),H=Math.cos(N);O[0]=H,O[1]=B,O[2]=0,O[3]=-B,O[4]=H,O[5]=0,O[6]=0,O[7]=0,O[8]=1}(C,-r.transform.angle),function(O,N,B){var H=N[0],J=N[1],te=N[2];O[0]=H*B[0]+J*B[3]+te*B[6],O[1]=H*B[1]+J*B[4]+te*B[7],O[2]=H*B[2]+J*B[5]+te*B[8]}(E,E,C);const M=g.properties.get("color");return{u_matrix:b,u_lightpos:E,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[M.r,M.g,M.b],u_vertical_gradient:+f,u_opacity:p}},tt=(b,r,f,p,g,y,E)=>c.e(Be(b,r,f,p),me(y,r,E),{u_height_factor:-Math.pow(2,g.overscaledZ)/E.tileSize/8}),vt=b=>({u_matrix:b}),ii=(b,r,f,p)=>c.e(vt(b),me(f,r,p)),Ts=(b,r)=>({u_matrix:b,u_world:r}),Ss=(b,r,f,p,g)=>c.e(ii(b,r,f,p),{u_world:g}),qs=(b,r,f,p)=>{const g=b.transform;let y,E;if(p.paint.get("circle-pitch-alignment")==="map"){const C=Qt(f,1,g.zoom);y=!0,E=[C,C]}else y=!1,E=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(p.paint.get("circle-pitch-scale")==="map"),u_matrix:b.translatePosMatrix(r.posMatrix,f,p.paint.get("circle-translate"),p.paint.get("circle-translate-anchor")),u_pitch_with_map:+y,u_device_pixel_ratio:b.pixelRatio,u_extrude_scale:E}},Ns=(b,r,f)=>({u_matrix:b,u_inv_matrix:r,u_camera_to_center_distance:f.cameraToCenterDistance,u_viewport_size:[f.width,f.height]}),Dc=(b,r,f=1)=>({u_matrix:b,u_color:r,u_overlay:0,u_overlay_scale:f}),Pn=b=>({u_matrix:b}),Mn=(b,r,f,p)=>({u_matrix:b,u_extrude_scale:Qt(r,1,f),u_intensity:p}),ih=(b,r,f,p)=>{const g=c.H();c.aP(g,0,b.width,b.height,0,0,1);const y=b.context.gl;return{u_matrix:g,u_world:[y.drawingBufferWidth,y.drawingBufferHeight],u_image:f,u_color_ramp:p,u_opacity:r.paint.get("heatmap-opacity")}};function sh(b,r){const f=Math.pow(2,r.canonical.z),p=r.canonical.y;return[new c.Z(0,p/f).toLngLat().lat,new c.Z(0,(p+1)/f).toLngLat().lat]}const nh=(b,r,f,p)=>{const g=b.transform;return{u_matrix:hm(b,r,f,p),u_ratio:1/Qt(r,1,g.zoom),u_device_pixel_ratio:b.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},cm=(b,r,f,p,g)=>c.e(nh(b,r,f,g),{u_image:0,u_image_height:p}),hl=(b,r,f,p,g)=>{const y=b.transform,E=um(r,y);return{u_matrix:hm(b,r,f,g),u_texsize:r.imageAtlasTexture.size,u_ratio:1/Qt(r,1,y.zoom),u_device_pixel_ratio:b.pixelRatio,u_image:0,u_scale:[E,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Mb=(b,r,f,p,g,y)=>{const E=b.lineAtlas,C=um(r,b.transform),M=f.layout.get("line-cap")==="round",O=E.getDash(p.from,M),N=E.getDash(p.to,M),B=O.width*g.fromScale,H=N.width*g.toScale;return c.e(nh(b,r,f,y),{u_patternscale_a:[C/B,-O.height/2],u_patternscale_b:[C/H,-N.height/2],u_sdfgamma:E.width/(256*Math.min(B,H)*b.pixelRatio)/2,u_image:0,u_tex_y_a:O.y,u_tex_y_b:N.y,u_mix:g.t})};function um(b,r){return 1/Qt(b,1,r.tileZoom)}function hm(b,r,f,p){return b.translatePosMatrix(p?p.posMatrix:r.tileID.posMatrix,r,f.paint.get("line-translate"),f.paint.get("line-translate-anchor"))}const Rb=(b,r,f,p,g)=>{return{u_matrix:b,u_tl_parent:r,u_scale_parent:f,u_buffer_scale:1,u_fade_t:p.mix,u_opacity:p.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(E=g.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(y=g.paint.get("raster-contrast"),y>0?1/(1-y):1+y),u_spin_weights:kb(g.paint.get("raster-hue-rotate"))};var y,E};function kb(b){b*=Math.PI/180;const r=Math.sin(b),f=Math.cos(b);return[(2*f+1)/3,(-Math.sqrt(3)*r-f+1)/3,(Math.sqrt(3)*r-f+1)/3]}const fm=(b,r,f,p,g,y,E,C,M,O,N,B,H,J)=>{const te=E.transform;return{u_is_size_zoom_constant:+(b==="constant"||b==="source"),u_is_size_feature_constant:+(b==="constant"||b==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:te.width/te.height,u_fade_change:E.options.fadeDuration?E.symbolFadeChange:1,u_matrix:C,u_label_plane_matrix:M,u_coord_matrix:O,u_is_text:+B,u_pitch_with_map:+p,u_is_along_line:g,u_is_variable_anchor:y,u_texsize:H,u_texture:0,u_translation:N,u_pitched_scale:J}},Fc=(b,r,f,p,g,y,E,C,M,O,N,B,H,J,te)=>{const ae=E.transform;return c.e(fm(b,r,f,p,g,y,E,C,M,O,N,B,H,te),{u_gamma_scale:p?Math.cos(ae._pitch)*ae.cameraToCenterDistance:1,u_device_pixel_ratio:E.pixelRatio,u_is_halo:+J})},vd=(b,r,f,p,g,y,E,C,M,O,N,B,H,J)=>c.e(Fc(b,r,f,p,g,y,E,C,M,O,N,!0,B,!0,J),{u_texsize_icon:H,u_texture_icon:1}),rh=(b,r,f)=>({u_matrix:b,u_opacity:r,u_color:f}),xd=(b,r,f,p,g,y)=>c.e(function(E,C,M,O){const N=M.imageManager.getPattern(E.from.toString()),B=M.imageManager.getPattern(E.to.toString()),{width:H,height:J}=M.imageManager.getPixelSize(),te=Math.pow(2,O.tileID.overscaledZ),ae=O.tileSize*Math.pow(2,M.transform.tileZoom)/te,he=ae*(O.tileID.canonical.x+O.tileID.wrap*te),de=ae*O.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:N.tl,u_pattern_br_a:N.br,u_pattern_tl_b:B.tl,u_pattern_br_b:B.br,u_texsize:[H,J],u_mix:C.t,u_pattern_size_a:N.displaySize,u_pattern_size_b:B.displaySize,u_scale_a:C.fromScale,u_scale_b:C.toScale,u_tile_units_to_pixels:1/Qt(O,1,M.transform.tileZoom),u_pixel_coord_upper:[he>>16,de>>16],u_pixel_coord_lower:[65535&he,65535&de]}}(p,y,f,g),{u_matrix:b,u_opacity:r}),wd={fillExtrusion:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_lightpos:new c.aN(b,r.u_lightpos),u_lightintensity:new c.aI(b,r.u_lightintensity),u_lightcolor:new c.aN(b,r.u_lightcolor),u_vertical_gradient:new c.aI(b,r.u_vertical_gradient),u_opacity:new c.aI(b,r.u_opacity)}),fillExtrusionPattern:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_lightpos:new c.aN(b,r.u_lightpos),u_lightintensity:new c.aI(b,r.u_lightintensity),u_lightcolor:new c.aN(b,r.u_lightcolor),u_vertical_gradient:new c.aI(b,r.u_vertical_gradient),u_height_factor:new c.aI(b,r.u_height_factor),u_image:new c.aH(b,r.u_image),u_texsize:new c.aO(b,r.u_texsize),u_pixel_coord_upper:new c.aO(b,r.u_pixel_coord_upper),u_pixel_coord_lower:new c.aO(b,r.u_pixel_coord_lower),u_scale:new c.aN(b,r.u_scale),u_fade:new c.aI(b,r.u_fade),u_opacity:new c.aI(b,r.u_opacity)}),fill:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix)}),fillPattern:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_image:new c.aH(b,r.u_image),u_texsize:new c.aO(b,r.u_texsize),u_pixel_coord_upper:new c.aO(b,r.u_pixel_coord_upper),u_pixel_coord_lower:new c.aO(b,r.u_pixel_coord_lower),u_scale:new c.aN(b,r.u_scale),u_fade:new c.aI(b,r.u_fade)}),fillOutline:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_world:new c.aO(b,r.u_world)}),fillOutlinePattern:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_world:new c.aO(b,r.u_world),u_image:new c.aH(b,r.u_image),u_texsize:new c.aO(b,r.u_texsize),u_pixel_coord_upper:new c.aO(b,r.u_pixel_coord_upper),u_pixel_coord_lower:new c.aO(b,r.u_pixel_coord_lower),u_scale:new c.aN(b,r.u_scale),u_fade:new c.aI(b,r.u_fade)}),circle:(b,r)=>({u_camera_to_center_distance:new c.aI(b,r.u_camera_to_center_distance),u_scale_with_map:new c.aH(b,r.u_scale_with_map),u_pitch_with_map:new c.aH(b,r.u_pitch_with_map),u_extrude_scale:new c.aO(b,r.u_extrude_scale),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_matrix:new c.aJ(b,r.u_matrix)}),collisionBox:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_pixel_extrude_scale:new c.aO(b,r.u_pixel_extrude_scale)}),collisionCircle:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_inv_matrix:new c.aJ(b,r.u_inv_matrix),u_camera_to_center_distance:new c.aI(b,r.u_camera_to_center_distance),u_viewport_size:new c.aO(b,r.u_viewport_size)}),debug:(b,r)=>({u_color:new c.aL(b,r.u_color),u_matrix:new c.aJ(b,r.u_matrix),u_overlay:new c.aH(b,r.u_overlay),u_overlay_scale:new c.aI(b,r.u_overlay_scale)}),clippingMask:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix)}),heatmap:(b,r)=>({u_extrude_scale:new c.aI(b,r.u_extrude_scale),u_intensity:new c.aI(b,r.u_intensity),u_matrix:new c.aJ(b,r.u_matrix)}),heatmapTexture:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_world:new c.aO(b,r.u_world),u_image:new c.aH(b,r.u_image),u_color_ramp:new c.aH(b,r.u_color_ramp),u_opacity:new c.aI(b,r.u_opacity)}),hillshade:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_image:new c.aH(b,r.u_image),u_latrange:new c.aO(b,r.u_latrange),u_light:new c.aO(b,r.u_light),u_shadow:new c.aL(b,r.u_shadow),u_highlight:new c.aL(b,r.u_highlight),u_accent:new c.aL(b,r.u_accent)}),hillshadePrepare:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_image:new c.aH(b,r.u_image),u_dimension:new c.aO(b,r.u_dimension),u_zoom:new c.aI(b,r.u_zoom),u_unpack:new c.aK(b,r.u_unpack)}),line:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_ratio:new c.aI(b,r.u_ratio),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_units_to_pixels:new c.aO(b,r.u_units_to_pixels)}),lineGradient:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_ratio:new c.aI(b,r.u_ratio),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_units_to_pixels:new c.aO(b,r.u_units_to_pixels),u_image:new c.aH(b,r.u_image),u_image_height:new c.aI(b,r.u_image_height)}),linePattern:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_texsize:new c.aO(b,r.u_texsize),u_ratio:new c.aI(b,r.u_ratio),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_image:new c.aH(b,r.u_image),u_units_to_pixels:new c.aO(b,r.u_units_to_pixels),u_scale:new c.aN(b,r.u_scale),u_fade:new c.aI(b,r.u_fade)}),lineSDF:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_ratio:new c.aI(b,r.u_ratio),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_units_to_pixels:new c.aO(b,r.u_units_to_pixels),u_patternscale_a:new c.aO(b,r.u_patternscale_a),u_patternscale_b:new c.aO(b,r.u_patternscale_b),u_sdfgamma:new c.aI(b,r.u_sdfgamma),u_image:new c.aH(b,r.u_image),u_tex_y_a:new c.aI(b,r.u_tex_y_a),u_tex_y_b:new c.aI(b,r.u_tex_y_b),u_mix:new c.aI(b,r.u_mix)}),raster:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_tl_parent:new c.aO(b,r.u_tl_parent),u_scale_parent:new c.aI(b,r.u_scale_parent),u_buffer_scale:new c.aI(b,r.u_buffer_scale),u_fade_t:new c.aI(b,r.u_fade_t),u_opacity:new c.aI(b,r.u_opacity),u_image0:new c.aH(b,r.u_image0),u_image1:new c.aH(b,r.u_image1),u_brightness_low:new c.aI(b,r.u_brightness_low),u_brightness_high:new c.aI(b,r.u_brightness_high),u_saturation_factor:new c.aI(b,r.u_saturation_factor),u_contrast_factor:new c.aI(b,r.u_contrast_factor),u_spin_weights:new c.aN(b,r.u_spin_weights)}),symbolIcon:(b,r)=>({u_is_size_zoom_constant:new c.aH(b,r.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aH(b,r.u_is_size_feature_constant),u_size_t:new c.aI(b,r.u_size_t),u_size:new c.aI(b,r.u_size),u_camera_to_center_distance:new c.aI(b,r.u_camera_to_center_distance),u_pitch:new c.aI(b,r.u_pitch),u_rotate_symbol:new c.aH(b,r.u_rotate_symbol),u_aspect_ratio:new c.aI(b,r.u_aspect_ratio),u_fade_change:new c.aI(b,r.u_fade_change),u_matrix:new c.aJ(b,r.u_matrix),u_label_plane_matrix:new c.aJ(b,r.u_label_plane_matrix),u_coord_matrix:new c.aJ(b,r.u_coord_matrix),u_is_text:new c.aH(b,r.u_is_text),u_pitch_with_map:new c.aH(b,r.u_pitch_with_map),u_is_along_line:new c.aH(b,r.u_is_along_line),u_is_variable_anchor:new c.aH(b,r.u_is_variable_anchor),u_texsize:new c.aO(b,r.u_texsize),u_texture:new c.aH(b,r.u_texture),u_translation:new c.aO(b,r.u_translation),u_pitched_scale:new c.aI(b,r.u_pitched_scale)}),symbolSDF:(b,r)=>({u_is_size_zoom_constant:new c.aH(b,r.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aH(b,r.u_is_size_feature_constant),u_size_t:new c.aI(b,r.u_size_t),u_size:new c.aI(b,r.u_size),u_camera_to_center_distance:new c.aI(b,r.u_camera_to_center_distance),u_pitch:new c.aI(b,r.u_pitch),u_rotate_symbol:new c.aH(b,r.u_rotate_symbol),u_aspect_ratio:new c.aI(b,r.u_aspect_ratio),u_fade_change:new c.aI(b,r.u_fade_change),u_matrix:new c.aJ(b,r.u_matrix),u_label_plane_matrix:new c.aJ(b,r.u_label_plane_matrix),u_coord_matrix:new c.aJ(b,r.u_coord_matrix),u_is_text:new c.aH(b,r.u_is_text),u_pitch_with_map:new c.aH(b,r.u_pitch_with_map),u_is_along_line:new c.aH(b,r.u_is_along_line),u_is_variable_anchor:new c.aH(b,r.u_is_variable_anchor),u_texsize:new c.aO(b,r.u_texsize),u_texture:new c.aH(b,r.u_texture),u_gamma_scale:new c.aI(b,r.u_gamma_scale),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_is_halo:new c.aH(b,r.u_is_halo),u_translation:new c.aO(b,r.u_translation),u_pitched_scale:new c.aI(b,r.u_pitched_scale)}),symbolTextAndIcon:(b,r)=>({u_is_size_zoom_constant:new c.aH(b,r.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aH(b,r.u_is_size_feature_constant),u_size_t:new c.aI(b,r.u_size_t),u_size:new c.aI(b,r.u_size),u_camera_to_center_distance:new c.aI(b,r.u_camera_to_center_distance),u_pitch:new c.aI(b,r.u_pitch),u_rotate_symbol:new c.aH(b,r.u_rotate_symbol),u_aspect_ratio:new c.aI(b,r.u_aspect_ratio),u_fade_change:new c.aI(b,r.u_fade_change),u_matrix:new c.aJ(b,r.u_matrix),u_label_plane_matrix:new c.aJ(b,r.u_label_plane_matrix),u_coord_matrix:new c.aJ(b,r.u_coord_matrix),u_is_text:new c.aH(b,r.u_is_text),u_pitch_with_map:new c.aH(b,r.u_pitch_with_map),u_is_along_line:new c.aH(b,r.u_is_along_line),u_is_variable_anchor:new c.aH(b,r.u_is_variable_anchor),u_texsize:new c.aO(b,r.u_texsize),u_texsize_icon:new c.aO(b,r.u_texsize_icon),u_texture:new c.aH(b,r.u_texture),u_texture_icon:new c.aH(b,r.u_texture_icon),u_gamma_scale:new c.aI(b,r.u_gamma_scale),u_device_pixel_ratio:new c.aI(b,r.u_device_pixel_ratio),u_is_halo:new c.aH(b,r.u_is_halo),u_translation:new c.aO(b,r.u_translation),u_pitched_scale:new c.aI(b,r.u_pitched_scale)}),background:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_opacity:new c.aI(b,r.u_opacity),u_color:new c.aL(b,r.u_color)}),backgroundPattern:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_opacity:new c.aI(b,r.u_opacity),u_image:new c.aH(b,r.u_image),u_pattern_tl_a:new c.aO(b,r.u_pattern_tl_a),u_pattern_br_a:new c.aO(b,r.u_pattern_br_a),u_pattern_tl_b:new c.aO(b,r.u_pattern_tl_b),u_pattern_br_b:new c.aO(b,r.u_pattern_br_b),u_texsize:new c.aO(b,r.u_texsize),u_mix:new c.aI(b,r.u_mix),u_pattern_size_a:new c.aO(b,r.u_pattern_size_a),u_pattern_size_b:new c.aO(b,r.u_pattern_size_b),u_scale_a:new c.aI(b,r.u_scale_a),u_scale_b:new c.aI(b,r.u_scale_b),u_pixel_coord_upper:new c.aO(b,r.u_pixel_coord_upper),u_pixel_coord_lower:new c.aO(b,r.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aI(b,r.u_tile_units_to_pixels)}),terrain:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_texture:new c.aH(b,r.u_texture),u_ele_delta:new c.aI(b,r.u_ele_delta),u_fog_matrix:new c.aJ(b,r.u_fog_matrix),u_fog_color:new c.aL(b,r.u_fog_color),u_fog_ground_blend:new c.aI(b,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.aI(b,r.u_fog_ground_blend_opacity),u_horizon_color:new c.aL(b,r.u_horizon_color),u_horizon_fog_blend:new c.aI(b,r.u_horizon_fog_blend)}),terrainDepth:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_ele_delta:new c.aI(b,r.u_ele_delta)}),terrainCoords:(b,r)=>({u_matrix:new c.aJ(b,r.u_matrix),u_texture:new c.aH(b,r.u_texture),u_terrain_coords_id:new c.aI(b,r.u_terrain_coords_id),u_ele_delta:new c.aI(b,r.u_ele_delta)}),sky:(b,r)=>({u_sky_color:new c.aL(b,r.u_sky_color),u_horizon_color:new c.aL(b,r.u_horizon_color),u_horizon:new c.aI(b,r.u_horizon),u_sky_horizon_blend:new c.aI(b,r.u_sky_horizon_blend)})};class oo{constructor(r,f,p){this.context=r;const g=r.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),r.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(r){const f=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,r.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ob={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Td{constructor(r,f,p,g){this.length=f.length,this.attributes=p,this.itemSize=f.bytesPerElement,this.dynamicDraw=g,this.context=r;const y=r.gl;this.buffer=y.createBuffer(),r.bindVertexBuffer.set(this.buffer),y.bufferData(y.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(r){if(r.length!==this.length)throw new Error(`Length of new data is ${r.length}, which doesn't match current length of ${this.length}`);const f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,r.arrayBuffer)}enableAttributes(r,f){for(let p=0;p0){const Re=c.H();c.aQ(Re,re.placementInvProjMatrix,b.transform.glCoordMatrix),c.aQ(Re,Re,re.placementViewportMatrix),M.push({circleArray:Ee,circleOffset:N,transform:_e.posMatrix,invTransform:Re,coord:_e}),O+=Ee.length/4,N=O}xe&&C.draw(y,E.LINES,ei.disabled,Ni.disabled,b.colorModeForRenderPass(),Si.disabled,{u_matrix:_e.posMatrix,u_pixel_extrude_scale:[1/(B=b.transform).width,1/B.height]},b.style.map.terrain&&b.style.map.terrain.getTerrainData(_e),f.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,null,b.transform.zoom,null,null,xe.collisionVertexBuffer)}var B;if(!g||!M.length)return;const H=b.useProgram("collisionCircle"),J=new c.aR;J.resize(4*O),J._trim();let te=0;for(const de of M)for(let _e=0;_e=0&&(de[re.associatedIconIndex]={shiftedAnchor:zt,angle:Ui})}else Pt(re.numGlyphs,ae)}if(O){he.clear();const _e=b.icon.placedSymbolArray;for(let re=0;re<_e.length;re++){const xe=_e.get(re);if(xe.hidden)Pt(xe.numGlyphs,he);else{const Ee=de[re];if(Ee)for(let Re=0;Reb.style.map.terrain.getElevation(ot,Rl,kl):null,za=f.layout.get("text-rotation-alignment")==="map";Y(St,ot.posMatrix,b,g,Pl,Ml,de,O,za,ae,ot.toUnwrapped(),te.width,te.height,yr,oi)}const br=ot.posMatrix,vr=g&&st||sp,Wo=_e||vr?Lc:Pl,zr=Ph,Xs=dt&&f.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let nn;nn=dt?St.iconsInText?vd(zt.kind,si,re,de,_e,vr,b,br,Wo,zr,yr,tn,mn,mt):Fc(zt.kind,si,re,de,_e,vr,b,br,Wo,zr,yr,g,tn,!0,mt):fm(zt.kind,si,re,de,_e,vr,b,br,Wo,zr,yr,g,tn,mt);const Jn={program:Yt,buffers:Ht,uniformValues:nn,atlasTexture:Lr,atlasTextureIcon:sn,atlasInterpolation:ji,atlasInterpolationIcon:Rn,isSDF:dt,hasHalo:Xs};if(Ee&&St.canOverlap){Re=!0;const oi=Ht.segments.get();for(const za of oi)ut.push({segments:new c.a0([za]),sortKey:za.sortKey,state:Jn,terrainData:Vi})}else ut.push({segments:Ht.segments,sortKey:0,state:Jn,terrainData:Vi})}Re&&ut.sort((ot,rt)=>ot.sortKey-rt.sortKey);for(const ot of ut){const rt=ot.state;if(H.activeTexture.set(J.TEXTURE0),rt.atlasTexture.bind(rt.atlasInterpolation,J.CLAMP_TO_EDGE),rt.atlasTextureIcon&&(H.activeTexture.set(J.TEXTURE1),rt.atlasTextureIcon&&rt.atlasTextureIcon.bind(rt.atlasInterpolationIcon,J.CLAMP_TO_EDGE)),rt.isSDF){const St=rt.uniformValues;rt.hasHalo&&(St.u_is_halo=1,Od(rt.buffers,ot.segments,f,b,rt.program,$e,N,B,St,ot.terrainData)),St.u_is_halo=0}Od(rt.buffers,ot.segments,f,b,rt.program,$e,N,B,rt.uniformValues,ot.terrainData)}}function Od(b,r,f,p,g,y,E,C,M,O){const N=p.context;g.draw(N,N.gl.TRIANGLES,y,E,C,Si.disabled,M,O,f.id,b.layoutVertexBuffer,b.indexBuffer,r,f.paint,p.transform.zoom,b.programConfigurations.get(f.id),b.dynamicLayoutVertexBuffer,b.opacityVertexBuffer)}function Dd(b,r,f,p){const g=b.context,y=g.gl,E=Ni.disabled,C=new ds([y.ONE,y.ONE],c.aM.transparent,[!0,!0,!0,!0]),M=r.getBucket(f);if(!M)return;const O=p.key;let N=f.heatmapFbos.get(O);N||(N=zc(g,r.tileSize,r.tileSize),f.heatmapFbos.set(O,N)),g.bindFramebuffer.set(N.framebuffer),g.viewport.set([0,0,r.tileSize,r.tileSize]),g.clear({color:c.aM.transparent});const B=M.programConfigurations.get(f.id),H=b.useProgram("heatmap",B),J=b.style.map.terrain.getTerrainData(p);H.draw(g,y.TRIANGLES,ei.disabled,E,C,Si.disabled,Mn(p.posMatrix,r,b.transform.zoom,f.paint.get("heatmap-intensity")),J,f.id,M.layoutVertexBuffer,M.indexBuffer,M.segments,f.paint,b.transform.zoom,B)}function Fa(b,r,f){const p=b.context,g=p.gl;p.setColorMode(b.colorModeForRenderPass());const y=Uc(p,r),E=f.key,C=r.heatmapFbos.get(E);C&&(p.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,C.colorAttachment.get()),p.activeTexture.set(g.TEXTURE1),y.bind(g.LINEAR,g.CLAMP_TO_EDGE),b.useProgram("heatmapTexture").draw(p,g.TRIANGLES,ei.disabled,Ni.disabled,b.colorModeForRenderPass(),Si.disabled,ih(b,r,0,1),null,r.id,b.rasterBoundsBuffer,b.quadTriangleIndexBuffer,b.rasterBoundsSegments,r.paint,b.transform.zoom),C.destroy(),r.heatmapFbos.delete(E))}function zc(b,r,f){var p,g;const y=b.gl,E=y.createTexture();y.bindTexture(y.TEXTURE_2D,E),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_S,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_WRAP_T,y.CLAMP_TO_EDGE),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,y.LINEAR),y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,y.LINEAR);const C=(p=b.HALF_FLOAT)!==null&&p!==void 0?p:y.UNSIGNED_BYTE,M=(g=b.RGBA16F)!==null&&g!==void 0?g:y.RGBA;y.texImage2D(y.TEXTURE_2D,0,M,r,f,0,y.RGBA,C,null);const O=b.createFramebuffer(r,f,!1,!1);return O.colorAttachment.set(E),O}function Uc(b,r){return r.colorRampTexture||(r.colorRampTexture=new Xe(b,r.colorRamp,b.gl.RGBA)),r.colorRampTexture}function pl(b,r,f,p,g){if(!f||!p||!p.imageAtlas)return;const y=p.imageAtlas.patternPositions;let E=y[f.to.toString()],C=y[f.from.toString()];if(!E&&C&&(E=C),!C&&E&&(C=E),!E||!C){const M=g.getPaintProperty(r);E=y[M],C=y[M]}E&&C&&b.setConstantPatternPositions(E,C)}function Vc(b,r,f,p,g,y,E){const C=b.context.gl,M="fill-pattern",O=f.paint.get(M),N=O&&O.constantOr(1),B=f.getCrossfadeParameters();let H,J,te,ae,he;E?(J=N&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",H=C.LINES):(J=N?"fillPattern":"fill",H=C.TRIANGLES);const de=O.constantOr(null);for(const _e of p){const re=r.getTile(_e);if(N&&!re.patternsLoaded())continue;const xe=re.getBucket(f);if(!xe)continue;const Ee=xe.programConfigurations.get(f.id),Re=b.useProgram(J,Ee),$e=b.style.map.terrain&&b.style.map.terrain.getTerrainData(_e);N&&(b.context.activeTexture.set(C.TEXTURE0),re.imageAtlasTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),Ee.updatePaintBuffers(B)),pl(Ee,M,de,re,f);const st=$e?_e:null,ut=b.translatePosMatrix(st?st.posMatrix:_e.posMatrix,re,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor"));if(E){ae=xe.indexBuffer2,he=xe.segments2;const mt=[C.drawingBufferWidth,C.drawingBufferHeight];te=J==="fillOutlinePattern"&&N?Ss(ut,b,B,re,mt):Ts(ut,mt)}else ae=xe.indexBuffer,he=xe.segments,te=N?ii(ut,b,B,re):vt(ut);Re.draw(b.context,H,g,b.stencilModeForClipping(_e),y,Si.disabled,te,$e,f.id,xe.layoutVertexBuffer,ae,he,f.paint,b.transform.zoom,Ee)}}function hh(b,r,f,p,g,y,E){const C=b.context,M=C.gl,O="fill-extrusion-pattern",N=f.paint.get(O),B=N.constantOr(1),H=f.getCrossfadeParameters(),J=f.paint.get("fill-extrusion-opacity"),te=N.constantOr(null);for(const ae of p){const he=r.getTile(ae),de=he.getBucket(f);if(!de)continue;const _e=b.style.map.terrain&&b.style.map.terrain.getTerrainData(ae),re=de.programConfigurations.get(f.id),xe=b.useProgram(B?"fillExtrusionPattern":"fillExtrusion",re);B&&(b.context.activeTexture.set(M.TEXTURE0),he.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),re.updatePaintBuffers(H)),pl(re,O,te,he,f);const Ee=b.translatePosMatrix(ae.posMatrix,he,f.paint.get("fill-extrusion-translate"),f.paint.get("fill-extrusion-translate-anchor")),Re=f.paint.get("fill-extrusion-vertical-gradient"),$e=B?tt(Ee,b,Re,J,ae,H,he):Be(Ee,b,Re,J);xe.draw(C,C.gl.TRIANGLES,g,y,E,Si.backCCW,$e,_e,f.id,de.layoutVertexBuffer,de.indexBuffer,de.segments,f.paint,b.transform.zoom,re,b.style.map.terrain&&de.centroidVertexBuffer)}}function gl(b,r,f,p,g,y,E){const C=b.context,M=C.gl,O=f.fbo;if(!O)return;const N=b.useProgram("hillshade"),B=b.style.map.terrain&&b.style.map.terrain.getTerrainData(r);C.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,O.colorAttachment.get()),N.draw(C,M.TRIANGLES,g,y,E,Si.disabled,((H,J,te,ae)=>{const he=te.paint.get("hillshade-shadow-color"),de=te.paint.get("hillshade-highlight-color"),_e=te.paint.get("hillshade-accent-color");let re=te.paint.get("hillshade-illumination-direction")*(Math.PI/180);te.paint.get("hillshade-illumination-anchor")==="viewport"&&(re-=H.transform.angle);const xe=!H.options.moving;return{u_matrix:ae?ae.posMatrix:H.transform.calculatePosMatrix(J.tileID.toUnwrapped(),xe),u_image:0,u_latrange:sh(0,J.tileID),u_light:[te.paint.get("hillshade-exaggeration"),re],u_shadow:he,u_highlight:de,u_accent:_e}})(b,f,p,B?r:null),B,p.id,b.rasterBoundsBuffer,b.quadTriangleIndexBuffer,b.rasterBoundsSegments)}function ml(b,r,f,p,g,y){const E=b.context,C=E.gl,M=r.dem;if(M&&M.data){const O=M.dim,N=M.stride,B=M.getPixels();if(E.activeTexture.set(C.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||b.getTileTexture(N),r.demTexture){const J=r.demTexture;J.update(B,{premultiply:!1}),J.bind(C.NEAREST,C.CLAMP_TO_EDGE)}else r.demTexture=new Xe(E,B,C.RGBA,{premultiply:!1}),r.demTexture.bind(C.NEAREST,C.CLAMP_TO_EDGE);E.activeTexture.set(C.TEXTURE0);let H=r.fbo;if(!H){const J=new Xe(E,{width:O,height:O,data:null},C.RGBA);J.bind(C.LINEAR,C.CLAMP_TO_EDGE),H=r.fbo=E.createFramebuffer(O,O,!0,!1),H.colorAttachment.set(J.texture)}E.bindFramebuffer.set(H.framebuffer),E.viewport.set([0,0,O,O]),b.useProgram("hillshadePrepare").draw(E,C.TRIANGLES,p,g,y,Si.disabled,((J,te)=>{const ae=te.stride,he=c.H();return c.aP(he,0,c.X,-c.X,0,0,1),c.J(he,he,[0,-c.X,0]),{u_matrix:he,u_image:1,u_dimension:[ae,ae],u_zoom:J.overscaledZ,u_unpack:te.getUnpackVector()}})(r.tileID,M),null,f.id,b.rasterBoundsBuffer,b.quadTriangleIndexBuffer,b.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function Em(b,r,f,p,g,y){const E=p.paint.get("raster-fade-duration");if(!y&&E>0){const C=A.now(),M=(C-b.timeAdded)/E,O=r?(C-r.timeAdded)/E:-1,N=f.getSource(),B=g.coveringZoomLevel({tileSize:N.tileSize,roundZoom:N.roundZoom}),H=!r||Math.abs(r.tileID.overscaledZ-B)>Math.abs(b.tileID.overscaledZ-B),J=H&&b.refreshedUponExpiration?1:c.ac(H?M:1-O,0,1);return b.refreshedUponExpiration&&M>=1&&(b.refreshedUponExpiration=!1),r?{opacity:1,mix:1-J}:{opacity:J,mix:0}}return{opacity:1,mix:0}}const Fd=new c.aM(1,0,0,1),fi=new c.aM(0,1,0,1),fh=new c.aM(0,0,1,1),$b=new c.aM(1,0,1,1),Am=new c.aM(0,1,1,1);function _l(b,r,f,p){dh(b,0,r+f/2,b.transform.width,f,p)}function Im(b,r,f,p){dh(b,r-f/2,0,f,b.transform.height,p)}function dh(b,r,f,p,g,y){const E=b.context,C=E.gl;C.enable(C.SCISSOR_TEST),C.scissor(r*b.pixelRatio,f*b.pixelRatio,p*b.pixelRatio,g*b.pixelRatio),E.clear({color:y}),C.disable(C.SCISSOR_TEST)}function Cm(b,r,f){const p=b.context,g=p.gl,y=f.posMatrix,E=b.useProgram("debug"),C=ei.disabled,M=Ni.disabled,O=b.colorModeForRenderPass(),N="$debug",B=b.style.map.terrain&&b.style.map.terrain.getTerrainData(f);p.activeTexture.set(g.TEXTURE0);const H=r.getTileByID(f.key).latestRawTileData,J=Math.floor((H&&H.byteLength||0)/1024),te=r.getTile(f).tileSize,ae=512/Math.min(te,512)*(f.overscaledZ/b.transform.zoom)*.5;let he=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(he+=` => ${f.overscaledZ}`),function(de,_e){de.initDebugOverlayCanvas();const re=de.debugOverlayCanvas,xe=de.context.gl,Ee=de.debugOverlayCanvas.getContext("2d");Ee.clearRect(0,0,re.width,re.height),Ee.shadowColor="white",Ee.shadowBlur=2,Ee.lineWidth=1.5,Ee.strokeStyle="white",Ee.textBaseline="top",Ee.font="bold 36px Open Sans, sans-serif",Ee.fillText(_e,5,5),Ee.strokeText(_e,5,5),de.debugOverlayTexture.update(re),de.debugOverlayTexture.bind(xe.LINEAR,xe.CLAMP_TO_EDGE)}(b,`${he} ${J}kB`),E.draw(p,g.TRIANGLES,C,M,ds.alphaBlended,Si.disabled,Dc(y,c.aM.transparent,ae),null,N,b.debugBuffer,b.quadTriangleIndexBuffer,b.debugSegments),E.draw(p,g.LINE_STRIP,C,M,O,Si.disabled,Dc(y,c.aM.red),B,N,b.debugBuffer,b.tileBorderIndexBuffer,b.debugSegments)}function Pm(b,r,f){const p=b.context,g=p.gl,y=b.colorModeForRenderPass(),E=new ei(g.LEQUAL,ei.ReadWrite,b.depthRangeFor3D),C=b.useProgram("terrain"),M=r.getTerrainMesh();p.bindFramebuffer.set(null),p.viewport.set([0,0,b.width,b.height]);for(const O of f){const N=b.renderToTexture.getTexture(O),B=r.getTerrainData(O.tileID);p.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,N.texture);const H=b.transform.calculatePosMatrix(O.tileID.toUnwrapped()),J=r.getMeshFrameDelta(b.transform.zoom),te=b.transform.calculateFogMatrix(O.tileID.toUnwrapped()),ae=Oc(H,J,te,b.style.sky,b.transform.pitch);C.draw(p,g.TRIANGLES,E,Ni.disabled,y,Si.backCCW,ae,B,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}}class ph{constructor(r,f,p){this.vertexBuffer=r,this.indexBuffer=f,this.segments=p}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class gh{constructor(r,f){this.context=new jb(r),this.transform=f,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=kt.maxUnderzooming+kt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Pa}resize(r,f,p){if(this.width=Math.floor(r*p),this.height=Math.floor(f*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const r=this.context,f=new c.aX;f.emplaceBack(0,0),f.emplaceBack(c.X,0),f.emplaceBack(0,c.X),f.emplaceBack(c.X,c.X),this.tileExtentBuffer=r.createVertexBuffer(f,ro.members),this.tileExtentSegments=c.a0.simpleSegment(0,0,4,2);const p=new c.aX;p.emplaceBack(0,0),p.emplaceBack(c.X,0),p.emplaceBack(0,c.X),p.emplaceBack(c.X,c.X),this.debugBuffer=r.createVertexBuffer(p,ro.members),this.debugSegments=c.a0.simpleSegment(0,0,4,5);const g=new c.$;g.emplaceBack(0,0,0,0),g.emplaceBack(c.X,0,c.X,0),g.emplaceBack(0,c.X,0,c.X),g.emplaceBack(c.X,c.X,c.X,c.X),this.rasterBoundsBuffer=r.createVertexBuffer(g,Qe.members),this.rasterBoundsSegments=c.a0.simpleSegment(0,0,4,2);const y=new c.aX;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(y,ro.members),this.viewportSegments=c.a0.simpleSegment(0,0,4,2);const E=new c.aZ;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=r.createIndexBuffer(E);const C=new c.aY;C.emplaceBack(0,1,2),C.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(C);const M=this.context.gl;this.stencilClearMode=new Ni({func:M.ALWAYS,mask:0},0,255,M.ZERO,M.ZERO,M.ZERO)}clearStencil(){const r=this.context,f=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=c.H();c.aP(p,0,this.width,this.height,0,0,1),c.K(p,p,[f.drawingBufferWidth,f.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(r,f.TRIANGLES,ei.disabled,this.stencilClearMode,ds.disabled,Si.disabled,Pn(p),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(r,f){if(this.currentStencilSource===r.source||!r.isTileClipped()||!f||!f.length)return;this.currentStencilSource=r.source;const p=this.context,g=p.gl;this.nextStencilID+f.length>256&&this.clearStencil(),p.setColorMode(ds.disabled),p.setDepthMode(ei.disabled);const y=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of f){const C=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,M=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);y.draw(p,g.TRIANGLES,ei.disabled,new Ni({func:g.ALWAYS,mask:0},C,255,g.KEEP,g.KEEP,g.REPLACE),ds.disabled,Si.disabled,Pn(E.posMatrix),M,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,f=this.context.gl;return new Ni({func:f.NOTEQUAL,mask:255},r,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(r){const f=this.context.gl;return new Ni({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(r){const f=this.context.gl,p=r.sort((E,C)=>C.overscaledZ-E.overscaledZ),g=p[p.length-1].overscaledZ,y=p[0].overscaledZ-g+1;if(y>1){this.currentStencilSource=void 0,this.nextStencilID+y>256&&this.clearStencil();const E={};for(let C=0;C({u_sky_color:de.properties.get("sky-color"),u_horizon_color:de.properties.get("horizon-color"),u_horizon:(_e.height/2+_e.getHorizon())*re,u_sky_horizon_blend:de.properties.get("sky-horizon-blend")*_e.height/2*re}))(O,M.style.map.transform,M.pixelRatio),J=new ei(B.LEQUAL,ei.ReadWrite,[0,1]),te=Ni.disabled,ae=M.colorModeForRenderPass(),he=M.useProgram("sky");if(!O.mesh){const de=new c.aX;de.emplaceBack(-1,-1),de.emplaceBack(1,-1),de.emplaceBack(1,1),de.emplaceBack(-1,1);const _e=new c.aY;_e.emplaceBack(0,1,2),_e.emplaceBack(0,2,3),O.mesh=new ph(N.createVertexBuffer(de,ro.members),N.createIndexBuffer(_e),c.a0.simpleSegment(0,0,de.length,_e.length))}he.draw(N,B.TRIANGLES,J,te,ae,Si.disabled,H,void 0,"sky",O.mesh.vertexBuffer,O.mesh.indexBuffer,O.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=f.showOverdrawInspector,this.depthRangeFor3D=[0,1-(r._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=p.length-1;this.currentLayer>=0;this.currentLayer--){const M=this.style._layers[p[this.currentLayer]],O=g[M.source],N=y[M.source];this._renderTileClippingMasks(M,N),this.renderLayer(this,O,M,N)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerhe.source&&!he.isHidden(N)?[O.sourceCaches[he.source]]:[]),J=H.filter(he=>he.getSource().type==="vector"),te=H.filter(he=>he.getSource().type!=="vector"),ae=he=>{(!B||B.getSource().maxzoomae(he)),B||te.forEach(he=>ae(he)),B}(this.style,this.transform.zoom);M&&function(O,N,B){for(let H=0;H0),g&&(c.b0(f,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(y,E){const C=y.context,M=C.gl,O=ds.unblended,N=new ei(M.LEQUAL,ei.ReadWrite,[0,1]),B=E.getTerrainMesh(),H=E.sourceCache.getRenderableTiles(),J=y.useProgram("terrainDepth");C.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),C.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),C.clear({color:c.aM.transparent,depth:1});for(const te of H){const ae=E.getTerrainData(te.tileID),he={u_matrix:y.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};J.draw(C,M.TRIANGLES,N,Ni.disabled,O,Si.backCCW,he,ae,"terrain",B.vertexBuffer,B.indexBuffer,B.segments)}C.bindFramebuffer.set(null),C.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain),function(y,E){const C=y.context,M=C.gl,O=ds.unblended,N=new ei(M.LEQUAL,ei.ReadWrite,[0,1]),B=E.getTerrainMesh(),H=E.getCoordsTexture(),J=E.sourceCache.getRenderableTiles(),te=y.useProgram("terrainCoords");C.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),C.viewport.set([0,0,y.width/devicePixelRatio,y.height/devicePixelRatio]),C.clear({color:c.aM.transparent,depth:1}),E.coordsIndex=[];for(const ae of J){const he=E.getTerrainData(ae.tileID);C.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,H.texture);const de={u_matrix:y.transform.calculatePosMatrix(ae.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(y.transform.zoom)};te.draw(C,M.TRIANGLES,N,Ni.disabled,O,Si.backCCW,de,he,"terrain",B.vertexBuffer,B.indexBuffer,B.segments),E.coordsIndex.push(ae.tileID.key)}C.bindFramebuffer.set(null),C.viewport.set([0,0,y.width,y.height])}(this,this.style.map.terrain))}renderLayer(r,f,p,g){if(!p.isHidden(this.transform.zoom)&&(p.type==="background"||p.type==="custom"||(g||[]).length))switch(this.id=p.id,p.type){case"symbol":(function(y,E,C,M,O){if(y.renderPass!=="translucent")return;const N=Ni.disabled,B=y.colorModeForRenderPass();(C._unevaluatedLayout.hasValue("text-variable-anchor")||C._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(H,J,te,ae,he,de,_e,re,xe){const Ee=J.transform,Re=so(),$e=he==="map",st=de==="map";for(const ut of H){const mt=ae.getTile(ut),ot=mt.getBucket(te);if(!ot||!ot.text||!ot.text.segments.get().length)continue;const rt=c.ag(ot.textSizeData,Ee.zoom),St=Qt(mt,1,J.transform.zoom),Ht=Fr(ut.posMatrix,st,$e,J.transform,St),lt=te.layout.get("icon-text-fit")!=="none"&&ot.hasIconData();if(rt){const dt=Math.pow(2,Ee.zoom-mt.tileID.overscaledZ),zt=J.style.map.terrain?(Yt,si)=>J.style.map.terrain.getElevation(ut,Yt,si):null,Ui=Re.translatePosition(Ee,mt,_e,re);dl(ot,$e,st,xe,Ee,Ht,ut.posMatrix,dt,rt,lt,Re,Ui,ut.toUnwrapped(),zt)}}}(M,y,C,E,C.layout.get("text-rotation-alignment"),C.layout.get("text-pitch-alignment"),C.paint.get("text-translate"),C.paint.get("text-translate-anchor"),O),C.paint.get("icon-opacity").constantOr(1)!==0&&kd(y,E,C,M,!1,C.paint.get("icon-translate"),C.paint.get("icon-translate-anchor"),C.layout.get("icon-rotation-alignment"),C.layout.get("icon-pitch-alignment"),C.layout.get("icon-keep-upright"),N,B),C.paint.get("text-opacity").constantOr(1)!==0&&kd(y,E,C,M,!0,C.paint.get("text-translate"),C.paint.get("text-translate-anchor"),C.layout.get("text-rotation-alignment"),C.layout.get("text-pitch-alignment"),C.layout.get("text-keep-upright"),N,B),E.map.showCollisionBoxes&&(Bc(y,E,C,M,!0),Bc(y,E,C,M,!1))})(r,f,p,g,this.style.placement.variableOffsets);break;case"circle":(function(y,E,C,M){if(y.renderPass!=="translucent")return;const O=C.paint.get("circle-opacity"),N=C.paint.get("circle-stroke-width"),B=C.paint.get("circle-stroke-opacity"),H=!C.layout.get("circle-sort-key").isConstant();if(O.constantOr(1)===0&&(N.constantOr(1)===0||B.constantOr(1)===0))return;const J=y.context,te=J.gl,ae=y.depthModeForSublayer(0,ei.ReadOnly),he=Ni.disabled,de=y.colorModeForRenderPass(),_e=[];for(let re=0;rere.sortKey-xe.sortKey);for(const re of _e){const{programConfiguration:xe,program:Ee,layoutVertexBuffer:Re,indexBuffer:$e,uniformValues:st,terrainData:ut}=re.state;Ee.draw(J,te.TRIANGLES,ae,he,de,Si.disabled,st,ut,C.id,Re,$e,re.segments,C.paint,y.transform.zoom,xe)}})(r,f,p,g);break;case"heatmap":(function(y,E,C,M){if(C.paint.get("heatmap-opacity")===0)return;const O=y.context;if(y.style.map.terrain){for(const N of M){const B=E.getTile(N);E.hasRenderableParent(N)||(y.renderPass==="offscreen"?Dd(y,B,C,N):y.renderPass==="translucent"&&Fa(y,C,N))}O.viewport.set([0,0,y.width,y.height])}else y.renderPass==="offscreen"?function(N,B,H,J){const te=N.context,ae=te.gl,he=Ni.disabled,de=new ds([ae.ONE,ae.ONE],c.aM.transparent,[!0,!0,!0,!0]);(function(_e,re,xe){const Ee=_e.gl;_e.activeTexture.set(Ee.TEXTURE1),_e.viewport.set([0,0,re.width/4,re.height/4]);let Re=xe.heatmapFbos.get(c.aU);Re?(Ee.bindTexture(Ee.TEXTURE_2D,Re.colorAttachment.get()),_e.bindFramebuffer.set(Re.framebuffer)):(Re=zc(_e,re.width/4,re.height/4),xe.heatmapFbos.set(c.aU,Re))})(te,N,H),te.clear({color:c.aM.transparent});for(let _e=0;_e20&&N.texParameterf(N.TEXTURE_2D,O.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,O.extTextureFilterAnisotropicMax);const ot=y.style.map.terrain&&y.style.map.terrain.getTerrainData(_e),rt=ot?_e:null,St=rt?rt.posMatrix:y.transform.calculatePosMatrix(_e.toUnwrapped(),de),Ht=Rb(St,ut||[0,0],st||1,$e,C);B instanceof Mt?H.draw(O,N.TRIANGLES,re,Ni.disabled,J,Si.disabled,Ht,ot,C.id,B.boundsBuffer,y.quadTriangleIndexBuffer,B.boundsSegments):H.draw(O,N.TRIANGLES,re,te[_e.overscaledZ],J,Si.disabled,Ht,ot,C.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments)}})(r,f,p,g);break;case"background":(function(y,E,C,M){const O=C.paint.get("background-color"),N=C.paint.get("background-opacity");if(N===0)return;const B=y.context,H=B.gl,J=y.transform,te=J.tileSize,ae=C.paint.get("background-pattern");if(y.isPatternMissing(ae))return;const he=!ae&&O.a===1&&N===1&&y.opaquePassEnabledForLayer()?"opaque":"translucent";if(y.renderPass!==he)return;const de=Ni.disabled,_e=y.depthModeForSublayer(0,he==="opaque"?ei.ReadWrite:ei.ReadOnly),re=y.colorModeForRenderPass(),xe=y.useProgram(ae?"backgroundPattern":"background"),Ee=M||J.coveringTiles({tileSize:te,terrain:y.style.map.terrain});ae&&(B.activeTexture.set(H.TEXTURE0),y.imageManager.bind(y.context));const Re=C.getCrossfadeParameters();for(const $e of Ee){const st=M?$e.posMatrix:y.transform.calculatePosMatrix($e.toUnwrapped()),ut=ae?xd(st,N,y,ae,{tileID:$e,tileSize:te},Re):rh(st,N,O),mt=y.style.map.terrain&&y.style.map.terrain.getTerrainData($e);xe.draw(B,H.TRIANGLES,_e,de,re,Si.disabled,ut,mt,C.id,y.tileExtentBuffer,y.quadTriangleIndexBuffer,y.tileExtentSegments)}})(r,0,p,g);break;case"custom":(function(y,E,C){const M=y.context,O=C.implementation;if(y.renderPass==="offscreen"){const N=O.prerender;N&&(y.setCustomLayerDefaults(),M.setColorMode(y.colorModeForRenderPass()),N.call(O,M.gl,y.transform.customLayerMatrix()),M.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),M.setColorMode(y.colorModeForRenderPass()),M.setStencilMode(Ni.disabled);const N=O.renderingMode==="3d"?new ei(y.context.gl.LEQUAL,ei.ReadWrite,y.depthRangeFor3D):y.depthModeForSublayer(0,ei.ReadOnly);M.setDepthMode(N),O.render(M.gl,y.transform.customLayerMatrix(),{farZ:y.transform.farZ,nearZ:y.transform.nearZ,fov:y.transform._fov,modelViewProjectionMatrix:y.transform.modelViewProjectionMatrix,projectionMatrix:y.transform.projectionMatrix}),M.setDirty(),y.setBaseState(),M.bindFramebuffer.set(null)}})(r,0,p)}}translatePosMatrix(r,f,p,g,y){if(!p[0]&&!p[1])return r;const E=y?g==="map"?this.transform.angle:0:g==="viewport"?-this.transform.angle:0;if(E){const O=Math.sin(E),N=Math.cos(E);p=[p[0]*N-p[1]*O,p[0]*O+p[1]*N]}const C=[y?p[0]:Qt(f,p[0],this.transform.zoom),y?p[1]:Qt(f,p[1],this.transform.zoom),0],M=new Float32Array(16);return c.J(M,r,C),M}saveTileTexture(r){const f=this._tileTextures[r.size[0]];f?f.push(r):this._tileTextures[r.size[0]]=[r]}getTileTexture(r){const f=this._tileTextures[r];return f&&f.length>0?f.pop():null}isPatternMissing(r){if(!r)return!1;if(!r.from||!r.to)return!0;const f=this.imageManager.getPattern(r.from.toString()),p=this.imageManager.getPattern(r.to.toString());return!f||!p}useProgram(r,f){this.cache=this.cache||{};const p=r+(f?f.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[p]||(this.cache[p]=new Q(this.context,pr[r],f,wd[r],this._showOverdrawInspector,this.style.map.terrain)),this.cache[p]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Xe(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:r,drawingBufferHeight:f}=this.context.gl;return this.width!==r||this.height!==f}}class yl{constructor(r,f){this.points=r,this.planes=f}static fromInvProjectionMatrix(r,f,p){const g=Math.pow(2,p),y=[[-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(C=>{const M=1/(C=c.af([],C,r))[3]/f*g;return c.b1(C,C,[M,M,1/C[3],M])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(C=>{const M=function(H,J){var te=J[0],ae=J[1],he=J[2],de=te*te+ae*ae+he*he;return de>0&&(de=1/Math.sqrt(de)),H[0]=J[0]*de,H[1]=J[1]*de,H[2]=J[2]*de,H}([],function(H,J,te){var ae=J[0],he=J[1],de=J[2],_e=te[0],re=te[1],xe=te[2];return H[0]=he*xe-de*re,H[1]=de*_e-ae*xe,H[2]=ae*re-he*_e,H}([],Fe([],y[C[0]],y[C[1]]),Fe([],y[C[2]],y[C[1]]))),O=-((N=M)[0]*(B=y[C[1]])[0]+N[1]*B[1]+N[2]*B[2]);var N,B;return M.concat(O)});return new yl(y,E)}}class bl{constructor(r,f){this.min=r,this.max=f,this.center=function(p,g,y){return p[0]=.5*g[0],p[1]=.5*g[1],p[2]=.5*g[2],p}([],function(p,g,y){return p[0]=g[0]+y[0],p[1]=g[1]+y[1],p[2]=g[2]+y[2],p}([],this.min,this.max))}quadrant(r){const f=[r%2==0,r<2],p=Se(this.min),g=Se(this.max);for(let y=0;y=0&&E++;if(E===0)return 0;E!==f.length&&(p=!1)}if(p)return 2;for(let g=0;g<3;g++){let y=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let C=0;Cthis.max[g]-this.min[g])return 0}return 1}}class vl{constructor(r=0,f=0,p=0,g=0){if(isNaN(r)||r<0||isNaN(f)||f<0||isNaN(p)||p<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=f,this.left=p,this.right=g}interpolate(r,f,p){return f.top!=null&&r.top!=null&&(this.top=c.y.number(r.top,f.top,p)),f.bottom!=null&&r.bottom!=null&&(this.bottom=c.y.number(r.bottom,f.bottom,p)),f.left!=null&&r.left!=null&&(this.left=c.y.number(r.left,f.left,p)),f.right!=null&&r.right!=null&&(this.right=c.y.number(r.right,f.right,p)),this}getCenter(r,f){const p=c.ac((this.left+r-this.right)/2,0,r),g=c.ac((this.top+f-this.bottom)/2,0,f);return new c.P(p,g)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new vl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Nd=85.051129;class xl{constructor(r,f,p,g,y){this.tileSize=512,this._renderWorldCopies=y===void 0||!!y,this._minZoom=r||0,this._maxZoom=f||22,this._minPitch=p??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const r=new xl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return r.apply(this),r}apply(r){this.tileSize=r.tileSize,this.latRange=r.latRange,this.lngRange=r.lngRange,this.width=r.width,this.height=r.height,this._center=r._center,this._elevation=r._elevation,this.minElevationForCurrentTile=r.minElevationForCurrentTile,this.zoom=r.zoom,this.angle=r.angle,this._fov=r._fov,this._pitch=r._pitch,this._unmodified=r._unmodified,this._edgeInsets=r._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(r){this._minZoom!==r&&(this._minZoom=r,this.zoom=Math.max(this.zoom,r))}get maxZoom(){return this._maxZoom}set maxZoom(r){this._maxZoom!==r&&(this._maxZoom=r,this.zoom=Math.min(this.zoom,r))}get minPitch(){return this._minPitch}set minPitch(r){this._minPitch!==r&&(this._minPitch=r,this.pitch=Math.max(this.pitch,r))}get maxPitch(){return this._maxPitch}set maxPitch(r){this._maxPitch!==r&&(this._maxPitch=r,this.pitch=Math.min(this.pitch,r))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(r){r===void 0?r=!0:r===null&&(r=!1),this._renderWorldCopies=r}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(r){const f=-c.b3(r,-180,180)*Math.PI/180;this.angle!==f&&(this._unmodified=!1,this.angle=f,this._calcMatrices(),this.rotationMatrix=function(){var p=new c.A(4);return c.A!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}(),function(p,g,y){var E=g[0],C=g[1],M=g[2],O=g[3],N=Math.sin(y),B=Math.cos(y);p[0]=E*B+M*N,p[1]=C*B+O*N,p[2]=E*-N+M*B,p[3]=C*-N+O*B}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(r){const f=c.ac(r,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(r){r=Math.max(.01,Math.min(60,r)),this._fov!==r&&(this._unmodified=!1,this._fov=r/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(r){const f=Math.min(Math.max(r,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this.tileZoom=Math.max(0,Math.floor(f)),this.scale=this.zoomScale(f),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(r){r.lat===this._center.lat&&r.lng===this._center.lng||(this._unmodified=!1,this._center=r,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(r){r!==this._elevation&&(this._elevation=r,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(r){this._edgeInsets.equals(r)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,r,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(r){return this._edgeInsets.equals(r)}interpolatePadding(r,f,p){this._unmodified=!1,this._edgeInsets.interpolate(r,f,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(r){const f=(r.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/r.tileSize));return Math.max(0,f)}getVisibleUnwrappedCoordinates(r){const f=[new c.b4(0,r)];if(this._renderWorldCopies){const p=this.pointCoordinate(new c.P(0,0)),g=this.pointCoordinate(new c.P(this.width,0)),y=this.pointCoordinate(new c.P(this.width,this.height)),E=this.pointCoordinate(new c.P(0,this.height)),C=Math.floor(Math.min(p.x,g.x,y.x,E.x)),M=Math.floor(Math.max(p.x,g.x,y.x,E.x)),O=1;for(let N=C-O;N<=M+O;N++)N!==0&&f.push(new c.b4(N,r))}return f}coveringTiles(r){var f,p;let g=this.coveringZoomLevel(r);const y=g;if(r.minzoom!==void 0&&gr.maxzoom&&(g=r.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),C=c.Z.fromLngLat(this.center),M=Math.pow(2,g),O=[M*E.x,M*E.y,0],N=[M*C.x,M*C.y,0],B=yl.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,g);let H=r.minzoom||0;!r.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(H=g);const J=r.terrain?2/Math.min(this.tileSize,r.tileSize)*this.tileSize:3,te=re=>({aabb:new bl([re*M,0,0],[(re+1)*M,M,0]),zoom:0,x:0,y:0,wrap:re,fullyVisible:!1}),ae=[],he=[],de=g,_e=r.reparseOverscaled?y:g;if(this._renderWorldCopies)for(let re=1;re<=3;re++)ae.push(te(-re)),ae.push(te(re));for(ae.push(te(0));ae.length>0;){const re=ae.pop(),xe=re.x,Ee=re.y;let Re=re.fullyVisible;if(!Re){const ot=re.aabb.intersects(B);if(ot===0)continue;Re=ot===2}const $e=r.terrain?O:N,st=re.aabb.distanceX($e),ut=re.aabb.distanceY($e),mt=Math.max(Math.abs(st),Math.abs(ut));if(re.zoom===de||mt>J+(1<=H){const ot=de-re.zoom,rt=O[0]-.5-(xe<>1),Ht=re.zoom+1;let lt=re.aabb.quadrant(ot);if(r.terrain){const dt=new c.S(Ht,re.wrap,Ht,rt,St),zt=r.terrain.getMinMaxElevation(dt),Ui=(f=zt.minElevation)!==null&&f!==void 0?f:this.elevation,Yt=(p=zt.maxElevation)!==null&&p!==void 0?p:this.elevation;lt=new bl([lt.min[0],lt.min[1],Ui],[lt.max[0],lt.max[1],Yt])}ae.push({aabb:lt,zoom:Ht,x:rt,y:St,wrap:re.wrap,fullyVisible:Re})}}return he.sort((re,xe)=>re.distanceSq-xe.distanceSq).map(re=>re.tileID)}resize(r,f){this.width=r,this.height=f,this.pixelsToGLUnits=[2/r,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(r){return Math.pow(2,r)}scaleZoom(r){return Math.log(r)/Math.LN2}project(r){const f=c.ac(r.lat,-85.051129,Nd);return new c.P(c.O(r.lng)*this.worldSize,c.Q(f)*this.worldSize)}unproject(r){return new c.Z(r.x/this.worldSize,r.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(r){const f=this.elevation,p=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,g=this.pointLocation(this.centerPoint,r),y=r.getElevationForLngLatZoom(g,this.tileZoom);if(!(this.elevation-y))return;const E=p+f-y,C=Math.cos(this._pitch)*this.cameraToCenterDistance/E/c.b5(1,g.lat),M=this.scaleZoom(C/this.tileSize);this._elevation=y,this._center=g,this.zoom=M}setLocationAtPoint(r,f){const p=this.pointCoordinate(f),g=this.pointCoordinate(this.centerPoint),y=this.locationCoordinate(r),E=new c.Z(y.x-(p.x-g.x),y.y-(p.y-g.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(r,f){return f?this.coordinatePoint(this.locationCoordinate(r),f.getElevationForLngLatZoom(r,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(r))}pointLocation(r,f){return this.coordinateLocation(this.pointCoordinate(r,f))}locationCoordinate(r){return c.Z.fromLngLat(r)}coordinateLocation(r){return r&&r.toLngLat()}pointCoordinate(r,f){if(f){const H=f.pointCoordinate(r);if(H!=null)return H}const p=[r.x,r.y,0,1],g=[r.x,r.y,1,1];c.af(p,p,this.pixelMatrixInverse),c.af(g,g,this.pixelMatrixInverse);const y=p[3],E=g[3],C=p[1]/y,M=g[1]/E,O=p[2]/y,N=g[2]/E,B=O===N?0:(0-O)/(N-O);return new c.Z(c.y.number(p[0]/y,g[0]/E,B)/this.worldSize,c.y.number(C,M,B)/this.worldSize)}coordinatePoint(r,f=0,p=this.pixelMatrix){const g=[r.x*this.worldSize,r.y*this.worldSize,f,1];return c.af(g,g,p),new c.P(g[0]/g[3],g[1]/g[3])}getBounds(){const r=Math.max(0,this.height/2-this.getHorizon());return new ce().extend(this.pointLocation(new c.P(0,r))).extend(this.pointLocation(new c.P(this.width,r))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ce([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(r){r?(this.lngRange=[r.getWest(),r.getEast()],this.latRange=[r.getSouth(),r.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Nd])}calculateTileMatrix(r){const f=r.canonical,p=this.worldSize/this.zoomScale(f.z),g=f.x+Math.pow(2,f.z)*r.wrap,y=c.an(new Float64Array(16));return c.J(y,y,[g*p,f.y*p,0]),c.K(y,y,[p/c.X,p/c.X,1]),y}calculatePosMatrix(r,f=!1){const p=r.key,g=f?this._alignedPosMatrixCache:this._posMatrixCache;if(g[p])return g[p];const y=this.calculateTileMatrix(r);return c.L(y,f?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,y),g[p]=new Float32Array(y),g[p]}calculateFogMatrix(r){const f=r.key,p=this._fogMatrixCache;if(p[f])return p[f];const g=this.calculateTileMatrix(r);return c.L(g,this.fogMatrix,g),p[f]=new Float32Array(g),p[f]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(r,f){f=c.ac(+f,this.minZoom,this.maxZoom);const p={center:new c.N(r.lng,r.lat),zoom:f};let g=this.lngRange;if(!this._renderWorldCopies&&g===null){const re=179.9999999999;g=[-re,re]}const y=this.tileSize*this.zoomScale(p.zoom);let E=0,C=y,M=0,O=y,N=0,B=0;const{x:H,y:J}=this.size;if(this.latRange){const re=this.latRange;E=c.Q(re[1])*y,C=c.Q(re[0])*y,C-EC&&(de=C-re)}if(g){const re=(M+O)/2;let xe=te;this._renderWorldCopies&&(xe=c.b3(te,re-y/2,re+y/2));const Ee=H/2;xe-EeO&&(he=O-Ee)}if(he!==void 0||de!==void 0){const re=new c.P(he??te,de??ae);p.center=this.unproject.call({worldSize:y},re).wrap()}return p}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const r=this._unmodified,{center:f,zoom:p}=this.getConstrained(this.center,this.zoom);this.center=f,this.zoom=p,this._unmodified=r,this._constraining=!1}_calcMatrices(){if(!this.height)return;const r=this.centerOffset,f=this.point.x,p=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b5(1,this.center.lat)*this.worldSize;let g=c.an(new Float64Array(16));c.K(g,g,[this.width/2,-this.height/2,1]),c.J(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=c.an(new Float64Array(16)),c.K(g,g,[1,-1,1]),c.J(g,g,[-1,-1,0]),c.K(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const y=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),C=y-E*this._pixelPerMeter/Math.cos(this._pitch),M=E<0?C:y,O=Math.PI/2+this._pitch,N=this._fov*(.5+r.y/this.height),B=Math.sin(N)*M/Math.sin(c.ac(Math.PI-O-N,.01,Math.PI-.01)),H=this.getHorizon(),J=2*Math.atan(H/this.cameraToCenterDistance)*(.5+r.y/(2*H)),te=Math.sin(J)*M/Math.sin(c.ac(Math.PI-O-J,.01,Math.PI-.01)),ae=Math.min(B,te);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*ae+M),this.nearZ=this.height/50,g=new Float64Array(16),c.b6(g,this._fov,this.width/this.height,this.nearZ,this.farZ),g[8]=2*-r.x/this.width,g[9]=2*r.y/this.height,this.projectionMatrix=c.ae(g),c.K(g,g,[1,-1,1]),c.J(g,g,[0,0,-this.cameraToCenterDistance]),c.b7(g,g,this._pitch),c.ad(g,g,this.angle),c.J(g,g,[-f,-p,0]),this.mercatorMatrix=c.K([],g,[this.worldSize,this.worldSize,this.worldSize]),c.K(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.L(new Float64Array(16),this.labelPlaneMatrix,g),c.J(g,g,[0,0,-this.elevation]),this.modelViewProjectionMatrix=g,this.invModelViewProjectionMatrix=c.as([],g),this.fogMatrix=new Float64Array(16),c.b6(this.fogMatrix,this._fov,this.width/this.height,y,this.farZ),this.fogMatrix[8]=2*-r.x/this.width,this.fogMatrix[9]=2*r.y/this.height,c.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),c.b7(this.fogMatrix,this.fogMatrix,this._pitch),c.ad(this.fogMatrix,this.fogMatrix,this.angle),c.J(this.fogMatrix,this.fogMatrix,[-f,-p,0]),c.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),c.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=c.L(new Float64Array(16),this.labelPlaneMatrix,g);const he=this.width%2/2,de=this.height%2/2,_e=Math.cos(this.angle),re=Math.sin(this.angle),xe=f-Math.round(f)+_e*he+re*de,Ee=p-Math.round(p)+_e*de+re*he,Re=new Float64Array(g);if(c.J(Re,Re,[xe>.5?xe-1:xe,Ee>.5?Ee-1:Ee,0]),this.alignedModelViewProjectionMatrix=Re,g=c.as(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const r=this.pointCoordinate(new c.P(0,0)),f=[r.x*this.worldSize,r.y*this.worldSize,0,1];return c.af(f,f,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const r=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,r))}getCameraQueryGeometry(r){const f=this.getCameraPoint();if(r.length===1)return[r[0],f];{let p=f.x,g=f.y,y=f.x,E=f.y;for(const C of r)p=Math.min(p,C.x),g=Math.min(g,C.y),y=Math.max(y,C.x),E=Math.max(E,C.y);return[new c.P(p,g),new c.P(y,g),new c.P(y,E),new c.P(p,E),new c.P(p,g)]}}lngLatToCameraDepth(r,f){const p=this.locationCoordinate(r),g=[p.x*this.worldSize,p.y*this.worldSize,f,1];return c.af(g,g,this.modelViewProjectionMatrix),g[2]/g[3]}}function jc(b,r){let f,p=!1,g=null,y=null;const E=()=>{g=null,p&&(b.apply(y,f),g=setTimeout(E,r),p=!1)};return(...C)=>(p=!0,y=this,f=C,g||E(),g)}class mh{constructor(r){this._getCurrentHash=()=>{const f=window.location.hash.replace("#","");if(this._hashName){let p;return f.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(p=g)}),(p&&p[1]||"").split("/")}return f.split("/")},this._onHashChange=()=>{const f=this._getCurrentHash();if(f.length>=3&&!f.some(p=>isNaN(p))){const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:p,pitch:+(f[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const f=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,f)},this._removeHash=()=>{const f=this._getCurrentHash();if(f.length===0)return;const p=f.join("/");let g=p;g.split("&").length>0&&(g=g.split("&")[0]),this._hashName&&(g=`${this._hashName}=${p}`);let y=window.location.hash.replace(g,"");y.startsWith("#&")?y=y.slice(0,1)+y.slice(2):y==="#"&&(y="");let E=window.location.href.replace(/(#.+)?$/,y);E=E.replace("&&","&"),window.history.replaceState(window.history.state,null,E)},this._updateHash=jc(this._updateHashUnthrottled,300),this._hashName=r&&encodeURIComponent(r)}addTo(r){return this._map=r,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(r){const f=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,g=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),y=Math.pow(10,g),E=Math.round(f.lng*y)/y,C=Math.round(f.lat*y)/y,M=this._map.getBearing(),O=this._map.getPitch();let N="";if(N+=r?`/${E}/${C}/${p}`:`${p}/${C}/${E}`,(M||O)&&(N+="/"+Math.round(10*M)/10),O&&(N+=`/${Math.round(O)}`),this._hashName){const B=this._hashName;let H=!1;const J=window.location.hash.slice(1).split("&").map(te=>{const ae=te.split("=")[0];return ae===B?(H=!0,`${ae}=${N}`):te}).filter(te=>te);return H||J.push(`${B}=${N}`),`#${J.join("&")}`}return`#${N}`}}const _h={linearity:.3,easing:c.b8(0,0,.3,1)},Bd=c.e({deceleration:2500,maxSpeed:1400},_h),Hb=c.e({deceleration:20,maxSpeed:1400},_h),Mm=c.e({deceleration:1e3,maxSpeed:360},_h),yh=c.e({deceleration:1e3,maxSpeed:90},_h);class Ld{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:A.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,f=A.now();for(;r.length>0&&f-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const f={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:y}of this._inertiaBuffer)f.zoom+=y.zoomDelta||0,f.bearing+=y.bearingDelta||0,f.pitch+=y.pitchDelta||0,y.panDelta&&f.pan._add(y.panDelta),y.around&&(f.around=y.around),y.pinchAround&&(f.pinchAround=y.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(f.pan.mag()){const y=Hc(f.pan.mag(),p,c.e({},Bd,r||{}));g.offset=f.pan.mult(y.amount/f.pan.mag()),g.center=this._map.transform.center,$c(g,y)}if(f.zoom){const y=Hc(f.zoom,p,Hb);g.zoom=this._map.transform.zoom+y.amount,$c(g,y)}if(f.bearing){const y=Hc(f.bearing,p,Mm);g.bearing=this._map.transform.bearing+c.ac(y.amount,-179,179),$c(g,y)}if(f.pitch){const y=Hc(f.pitch,p,yh);g.pitch=this._map.transform.pitch+y.amount,$c(g,y)}if(g.zoom||g.bearing){const y=f.pinchAround===void 0?f.around:f.pinchAround;g.around=y?this._map.unproject(y):this._map.getCenter()}return this.clear(),c.e(g,{noMoveStart:!0})}}function $c(b,r){(!b.duration||b.durationf.unproject(M)),C=y.reduce((M,O,N,B)=>M.add(O.div(B.length)),new c.P(0,0));super(r,{points:y,point:C,lngLats:E,lngLat:f.unproject(C),originalEvent:p}),this._defaultPrevented=!1}}class Rm extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,f,p){super(r,{originalEvent:p}),this._defaultPrevented=!1}}class km{constructor(r,f){this._map=r,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(r){return this._firePreventable(new Rm(r.type,this._map,r))}mousedown(r,f){return this._mousedownPos=f,this._firePreventable(new en(r.type,this._map,r))}mouseup(r){this._map.fire(new en(r.type,this._map,r))}click(r,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new en(r.type,this._map,r))}dblclick(r){return this._firePreventable(new en(r.type,this._map,r))}mouseover(r){this._map.fire(new en(r.type,this._map,r))}mouseout(r){this._map.fire(new en(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Na(r.type,this._map,r))}touchmove(r){this._map.fire(new Na(r.type,this._map,r))}touchend(r){this._map.fire(new Na(r.type,this._map,r))}touchcancel(r){this._map.fire(new Na(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ps{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(r){this._map.fire(new en(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new en("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._ignoreContextMenu||this._map.fire(new en(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nr{constructor(r){this._map=r}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(r){return this.transform.pointLocation(c.P.convert(r),this._map.terrain)}}class Yn{constructor(r,f){this._map=r,this._tr=new Nr(r),this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,f){this.isEnabled()&&r.shiftKey&&r.button===0&&(P.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(r,f){if(!this._active)return;const p=f;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)y.fitScreenCoordinates(p,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",r)}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(P.remove(this._box),this._box=null),P.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(r,f){return this._map.fire(new c.k(r,{originalEvent:f}))}}function Wc(b,r){if(b.length!==r.length)throw new Error(`The number of touches and points are not equal - touches ${b.length}, points ${r.length}`);const f={};for(let p=0;pthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=r.timeStamp),p.length===this.numTouches&&(this.centroid=function(g){const y=new c.P(0,0);for(const E of g)y._add(E);return y.div(g.length)}(f),this.touches=Wc(p,f)))}touchmove(r,f,p){if(this.aborted||!this.centroid)return;const g=Wc(p,f);for(const y in this.touches){const E=g[y];(!E||E.dist(this.touches[y])>30)&&(this.aborted=!0)}}touchend(r,f,p){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class bh{constructor(r){this.singleTap=new zd(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(r,f,p){this.singleTap.touchstart(r,f,p)}touchmove(r,f,p){this.singleTap.touchmove(r,f,p)}touchend(r,f,p){const g=this.singleTap.touchend(r,f,p);if(g){const y=r.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(g)<30;if(y&&E||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class wl{constructor(r){this._tr=new Nr(r),this._zoomIn=new bh({numTouches:1,numTaps:2}),this._zoomOut=new bh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,f,p){this._zoomIn.touchstart(r,f,p),this._zoomOut.touchstart(r,f,p)}touchmove(r,f,p){this._zoomIn.touchmove(r,f,p),this._zoomOut.touchmove(r,f,p)}touchend(r,f,p){const g=this._zoomIn.touchend(r,f,p),y=this._zoomOut.touchend(r,f,p),E=this._tr;return g?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(g)},{originalEvent:r})}):y?(this._active=!0,r.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(y)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ao{constructor(r){this._enabled=!!r.enable,this._moveStateManager=r.moveStateManager,this._clickTolerance=r.clickTolerance||1,this._moveFunction=r.move,this._activateOnStart=!!r.activateOnStart,r.assignEvents(this),this.reset()}reset(r){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(r)}_move(...r){const f=this._moveFunction(...r);if(f.bearingDelta||f.pitchDelta||f.around||f.panDelta)return this._active=!0,f}dragStart(r,f){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(r)&&(this._moveStateManager.startMove(r),this._lastPoint=f.length?f[0]:f,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(r,f){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(r.preventDefault(),!this._moveStateManager.isValidMoveEvent(r))return void this.reset(r);const g=f.length?f[0]:f;return!this._moved&&g.dist(p){b.mousedown=b.dragStart,b.mousemoveWindow=b.dragMove,b.mouseup=b.dragEnd,b.contextmenu=r=>{r.preventDefault()}},jd=({enable:b,clickTolerance:r,bearingDegreesPerPixelMoved:f=.8})=>{const p=new vh({checkCorrectEvent:g=>P.mouseButton(g)===0&&g.ctrlKey||P.mouseButton(g)===2});return new Ao({clickTolerance:r,move:(g,y)=>({bearingDelta:(y.x-g.x)*f}),moveStateManager:p,enable:b,assignEvents:xh})},$d=({enable:b,clickTolerance:r,pitchDegreesPerPixelMoved:f=-.5})=>{const p=new vh({checkCorrectEvent:g=>P.mouseButton(g)===0&&g.ctrlKey||P.mouseButton(g)===2});return new Ao({clickTolerance:r,move:(g,y)=>({pitchDelta:(y.y-g.y)*f}),moveStateManager:p,enable:b,assignEvents:xh})};class Ba{constructor(r,f){this._clickTolerance=r.clickTolerance||1,this._map=f,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(r){return r<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(r,f,p){return this._calculateTransform(r,f,p)}touchmove(r,f,p){if(this._active){if(!this._shouldBePrevented(p.length))return r.preventDefault(),this._calculateTransform(r,f,p);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",r)}}touchend(r,f,p){this._calculateTransform(r,f,p),this._active&&this._shouldBePrevented(p.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,f,p){p.length>0&&(this._active=!0);const g=Wc(p,f),y=new c.P(0,0),E=new c.P(0,0);let C=0;for(const O in g){const N=g[O],B=this._touches[O];B&&(y._add(N),E._add(N.sub(B)),C++,g[O]=N)}if(this._touches=g,this._shouldBePrevented(C)||!E.mag())return;const M=E.div(C);return this._sum._add(M),this._sum.mag()Math.abs(b.x)}class Tl extends wh{constructor(r){super(),this._currentTouchCount=0,this._map=r}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(r,f,p){super.touchstart(r,f,p),this._currentTouchCount=p.length}_start(r){this._lastPoints=r,Th(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,f,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=r[0].sub(this._lastPoints[0]),y=r[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,y,p.timeStamp),this._valid?(this._lastPoints=r,this._active=!0,{pitchDelta:(g.y+y.y)/2*-.5}):void 0}gestureBeginsVertically(r,f,p){if(this._valid!==void 0)return this._valid;const g=r.mag()>=2,y=f.mag()>=2;if(!g&&!y)return;if(!g||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const E=r.y>0==f.y>0;return Th(r)&&Th(f)&&E}}const Om={panStep:100,bearingStep:15,pitchStep:10};class mr{constructor(r){this._tr=new Nr(r);const f=Om;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let f=0,p=0,g=0,y=0,E=0;switch(r.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:r.shiftKey?p=-1:(r.preventDefault(),y=-1);break;case 39:r.shiftKey?p=1:(r.preventDefault(),y=1);break;case 38:r.shiftKey?g=1:(r.preventDefault(),E=-1);break;case 40:r.shiftKey?g=-1:(r.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(p=0,g=0),{cameraAnimation:C=>{const M=this._tr;C.easeTo({duration:300,easeId:"keyboardHandler",easing:ao,zoom:f?Math.round(M.zoom)+f*(r.shiftKey?2:1):M.zoom,bearing:M.bearing+p*this._bearingStep,pitch:M.pitch+g*this._pitchStep,offset:[-y*this._panStep,-E*this._panStep],center:M.center},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function ao(b){return b*(2-b)}const Zd=4.000244140625;class Br{constructor(r,f){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=r,this._tr=new Nr(r),this._triggerRenderFrame=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(r){return!!this._map.cooperativeGestures.isEnabled()&&!(r.ctrlKey||this._map.cooperativeGestures.isBypassed(r))}wheel(r){if(!this.isEnabled())return;if(this._shouldBePrevented(r))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",r);let f=r.deltaMode===WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const p=A.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,f!==0&&f%Zd==0?this._type="wheel":f!==0&&Math.abs(f)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(g*f)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),r.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=r,this._delta-=f,this._active||this._start(r)),r.preventDefault()}_start(r){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const f=P.mousePos(this._map.getCanvas(),r),p=this._tr;this._around=f.y>p.transform.height/2-p.transform.getHorizon()?c.N.convert(this._aroundCenter?p.center:p.unproject(f)):c.N.convert(p.center),this._aroundPoint=p.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._tr.transform;if(this._delta!==0){const M=this._type==="wheel"&&Math.abs(this._delta)>Zd?this._wheelZoomRate:this._defaultZoomRate;let O=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&O!==0&&(O=1/O);const N=typeof this._targetZoom=="number"?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(N*O))),this._type==="wheel"&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:r.zoom,p=this._startZoom,g=this._easing;let y,E=!1;const C=A.now()-this._lastWheelEventTime;if(this._type==="wheel"&&p&&g&&C){const M=Math.min(C/200,1),O=g(M);y=c.y.number(p,f,O),M<1?this._frameId||(this._frameId=!0):E=!0}else y=f,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:y-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let f=c.b9;if(this._prevEase){const p=this._prevEase,g=(A.now()-p.start)/p.duration,y=p.easing(g+.01)-p.easing(g),E=.27/Math.sqrt(y*y+1e-4)*.01,C=Math.sqrt(.0729-E*E);f=c.b8(E,C,.25,1)}return this._prevEase={start:A.now(),duration:r,easing:f},f}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class La{constructor(r,f){this._clickZoom=r,this._tapZoom=f}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Wb{constructor(r){this._tr=new Nr(r),this.reset()}reset(){this._active=!1}dblclick(r,f){return r.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(r.shiftKey?-1:1),around:this._tr.unproject(f)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qb{constructor(){this._tap=new bh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(r,f,p){if(!this._swipePoint)if(this._tapTime){const g=f[0],y=r.timeStamp-this._tapTime<500,E=this._tapPoint.dist(g)<30;y&&E?p.length>0&&(this._swipePoint=g,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(r,f,p)}touchmove(r,f,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const g=f[0],y=g.y-this._swipePoint.y;return this._swipePoint=g,r.preventDefault(),this._active=!0,{zoomDelta:y/128}}}else this._tap.touchmove(r,f,p)}touchend(r,f,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const g=this._tap.touchend(r,f,p);g&&(this._tapTime=r.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dm{constructor(r,f,p){this._el=r,this._mousePan=f,this._touchPan=p}enable(r){this._inertiaOptions=r||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Fm{constructor(r,f,p){this._pitchWithRotate=r.pitchWithRotate,this._mouseRotate=f,this._mousePitch=p}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Yd{constructor(r,f,p,g){this._el=r,this._touchZoom=f,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Sl{constructor(r,f){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=r,this._options=f,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const r=this._map.getCanvasContainer();r.classList.add("maplibregl-cooperative-gestures"),this._container=P.create("div","maplibregl-cooperative-gesture-screen",r);let f=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(f=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=f,this._container.appendChild(g);const y=document.createElement("div");y.className="maplibregl-mobile-message",y.textContent=p,this._container.appendChild(y),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(P.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(r){return r[this._bypassKey]}notifyGestureBlocked(r,f){this._enabled&&(this._map.fire(new c.k("cooperativegestureprevented",{gestureType:r,originalEvent:f})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const _r=b=>b.zoom||b.drag||b.pitch||b.rotate;class bt extends c.k{}function Sh(b){return b.panDelta&&b.panDelta.mag()||b.zoomDelta||b.bearingDelta||b.pitchDelta}class Kd{constructor(r,f){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,y)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=g.type==="renderFrame"?void 0:g,C={needsRenderFrame:!1},M={},O={},N=g.touches,B=N?this._getMapTouches(N):void 0,H=B?P.touchPos(this._map.getCanvas(),B):P.mousePos(this._map.getCanvas(),g);for(const{handlerName:ae,handler:he,allowed:de}of this._handlers){if(!he.isEnabled())continue;let _e;this._blockedByActive(O,de,ae)?he.reset():he[y||g.type]&&(_e=he[y||g.type](g,H,B),this.mergeHandlerResult(C,M,_e,ae,E),_e&&_e.needsRenderFrame&&this._triggerRenderFrame()),(_e||he.isActive())&&(O[ae]=he)}const J={};for(const ae in this._previousActiveHandlers)O[ae]||(J[ae]=E);this._previousActiveHandlers=O,(Object.keys(J).length||Sh(C))&&(this._changes.push([C,M,J]),this._triggerRenderFrame()),(Object.keys(O).length||Sh(C))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:te}=C;te&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],te(this._map))},this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ld(r),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,y,E]of this._listeners)P.addEventListener(g,y,g===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[r,f,p]of this._listeners)P.removeEventListener(r,f,r===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(r){const f=this._map,p=f.getCanvasContainer();this._add("mapEvent",new km(f,r));const g=f.boxZoom=new Yn(f,r);this._add("boxZoom",g),r.interactive&&r.boxZoom&&g.enable();const y=f.cooperativeGestures=new Sl(f,r.cooperativeGestures);this._add("cooperativeGestures",y),r.cooperativeGestures&&y.enable();const E=new wl(f),C=new Wb(f);f.doubleClickZoom=new La(C,E),this._add("tapZoom",E),this._add("clickZoom",C),r.interactive&&r.doubleClickZoom&&f.doubleClickZoom.enable();const M=new qb;this._add("tapDragZoom",M);const O=f.touchPitch=new Tl(f);this._add("touchPitch",O),r.interactive&&r.touchPitch&&f.touchPitch.enable(r.touchPitch);const N=jd(r),B=$d(r);f.dragRotate=new Fm(r,N,B),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",B,["mouseRotate"]),r.interactive&&r.dragRotate&&f.dragRotate.enable();const H=(({enable:_e,clickTolerance:re})=>{const xe=new vh({checkCorrectEvent:Ee=>P.mouseButton(Ee)===0&&!Ee.ctrlKey});return new Ao({clickTolerance:re,move:(Ee,Re)=>({around:Re,panDelta:Re.sub(Ee)}),activateOnStart:!0,moveStateManager:xe,enable:_e,assignEvents:xh})})(r),J=new Ba(r,f);f.dragPan=new Dm(p,H,J),this._add("mousePan",H),this._add("touchPan",J,["touchZoom","touchRotate"]),r.interactive&&r.dragPan&&f.dragPan.enable(r.dragPan);const te=new Xd,ae=new Wd;f.touchZoomRotate=new Yd(p,ae,te,M),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),r.interactive&&r.touchZoomRotate&&f.touchZoomRotate.enable(r.touchZoomRotate);const he=f.scrollZoom=new Br(f,()=>this._triggerRenderFrame());this._add("scrollZoom",he,["mousePan"]),r.interactive&&r.scrollZoom&&f.scrollZoom.enable(r.scrollZoom);const de=f.keyboard=new mr(f);this._add("keyboard",de),r.interactive&&r.keyboard&&f.keyboard.enable(),this._add("blockableMapEvent",new ps(f))}_add(r,f,p){this._handlers.push({handlerName:r,handler:f,allowed:p}),this._handlersById[r]=f}stop(r){if(!this._updatingCamera){for(const{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!_r(this._eventsInProgress)||this.isZooming()}_blockedByActive(r,f,p){for(const g in r)if(g!==p&&(!f||f.indexOf(g)<0))return!0;return!1}_getMapTouches(r){const f=[];for(const p of r)this._el.contains(p.target)&&f.push(p);return f}mergeHandlerResult(r,f,p,g,y){if(!p)return;c.e(r,p);const E={handlerName:g,originalEvent:p.originalEvent||y};p.zoomDelta!==void 0&&(f.zoom=E),p.panDelta!==void 0&&(f.drag=E),p.pitchDelta!==void 0&&(f.pitch=E),p.bearingDelta!==void 0&&(f.rotate=E)}_applyChanges(){const r={},f={},p={};for(const[g,y,E]of this._changes)g.panDelta&&(r.panDelta=(r.panDelta||new c.P(0,0))._add(g.panDelta)),g.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(r.around=g.around),g.pinchAround!==void 0&&(r.pinchAround=g.pinchAround),g.noInertia&&(r.noInertia=g.noInertia),c.e(f,y),c.e(p,E);this._updateMapTransform(r,f,p),this._changes=[]}_updateMapTransform(r,f,p){const g=this._map,y=g._getTransformForUpdate(),E=g.terrain;if(!(Sh(r)||E&&this._terrainMovement))return this._fireEvents(f,p,!0);let{panDelta:C,zoomDelta:M,bearingDelta:O,pitchDelta:N,around:B,pinchAround:H}=r;H!==void 0&&(B=H),g._stop(!0),B=B||g.transform.centerPoint;const J=y.pointLocation(C?B.sub(C):B);O&&(y.bearing+=O),N&&(y.pitch+=N),M&&(y.zoom+=M),E?this._terrainMovement||!f.drag&&!f.zoom?f.drag&&this._terrainMovement?y.center=y.pointLocation(y.centerPoint.sub(C)):y.setLocationAtPoint(J,B):(this._terrainMovement=!0,this._map._elevationFreeze=!0,y.setLocationAtPoint(J,B)):y.setLocationAtPoint(J,B),g._applyUpdatedTransform(y),this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(f,p,!0)}_fireEvents(r,f,p){const g=_r(this._eventsInProgress),y=_r(r),E={};for(const B in r){const{originalEvent:H}=r[B];this._eventsInProgress[B]||(E[`${B}start`]=H),this._eventsInProgress[B]=r[B]}!g&&y&&this._fireEvent("movestart",y.originalEvent);for(const B in E)this._fireEvent(B,E[B]);y&&this._fireEvent("move",y.originalEvent);for(const B in r){const{originalEvent:H}=r[B];this._fireEvent(B,H)}const C={};let M;for(const B in this._eventsInProgress){const{handlerName:H,originalEvent:J}=this._eventsInProgress[B];this._handlersById[H].isActive()||(delete this._eventsInProgress[B],M=f[H]||J,C[`${B}end`]=M)}for(const B in C)this._fireEvent(B,C[B]);const O=_r(this._eventsInProgress),N=(g||y)&&!O;if(N&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const B=this._map._getTransformForUpdate();B.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(B)}if(p&&N){this._updatingCamera=!0;const B=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),H=J=>J!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new bt("renderFrame",{timeStamp:r})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Nm extends c.E{constructor(r,f){super(),this._renderFrameCallback=()=>{const p=Math.min((A.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=f.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.N(this.transform.center.lng,this.transform.center.lat)}setCenter(r,f){return this.jumpTo({center:r},f)}panBy(r,f,p){return r=c.P.convert(r).mult(-1),this.panTo(this.transform.center,c.e({offset:r},f),p)}panTo(r,f,p){return this.easeTo(c.e({center:r},f),p)}getZoom(){return this.transform.zoom}setZoom(r,f){return this.jumpTo({zoom:r},f),this}zoomTo(r,f,p){return this.easeTo(c.e({zoom:r},f),p)}zoomIn(r,f){return this.zoomTo(this.getZoom()+1,r,f),this}zoomOut(r,f){return this.zoomTo(this.getZoom()-1,r,f),this}getBearing(){return this.transform.bearing}setBearing(r,f){return this.jumpTo({bearing:r},f),this}getPadding(){return this.transform.padding}setPadding(r,f){return this.jumpTo({padding:r},f),this}rotateTo(r,f,p){return this.easeTo(c.e({bearing:r},f),p)}resetNorth(r,f){return this.rotateTo(0,c.e({duration:1e3},r),f),this}resetNorthPitch(r,f){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},r),f),this}snapToNorth(r,f){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=c.y.number(y,he,$e)),this._rotating&&(g.bearing=c.y.number(E,O,$e)),this._pitching&&(g.pitch=c.y.number(C,N,$e)),this._padding&&(g.interpolatePadding(M,B,$e),J=g.centerPoint.add(H)),this.terrain&&!r.freezeElevation&&this._updateElevation($e),xe)g.setLocationAtPoint(xe,Ee);else{const st=g.zoomScale(g.zoom-y),ut=he>y?Math.min(2,re):Math.max(.5,re),mt=Math.pow(ut,1-$e),ot=g.unproject(de.add(_e.mult($e*mt)).mult(st));g.setLocationAtPoint(g.renderWorldCopies?ot.wrap():ot,J)}this._applyUpdatedTransform(g),this._fireMoveEvents(f)},$e=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(f,$e)},r),this}_prepareEase(r,f,p={}){this._moving=!0,f||p.moving||this.fire(new c.k("movestart",r)),this._zooming&&!p.zooming&&this.fire(new c.k("zoomstart",r)),this._rotating&&!p.rotating&&this.fire(new c.k("rotatestart",r)),this._pitching&&!p.pitching&&this.fire(new c.k("pitchstart",r))}_prepareElevation(r){this._elevationCenter=r,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(r){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const f=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(r<1&&f!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=r*(p-(f-(p*r+this._elevationStart))/(1-r)),this._elevationTarget=f}this.transform.elevation=c.y.number(this._elevationStart,this._elevationTarget,r)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(r){const f=r.getCameraPosition(),p=this.terrain.getElevationForLngLatZoom(f.lngLat,r.zoom);if(f.altitudethis._elevateCameraIfInsideTerrain(g)),this.transformCameraUpdate&&f.push(g=>this.transformCameraUpdate(g)),!f.length)return;const p=r.clone();for(const g of f){const y=p.clone(),{center:E,zoom:C,pitch:M,bearing:O,elevation:N}=g(y);E&&(y.center=E),C!==void 0&&(y.zoom=C),M!==void 0&&(y.pitch=M),O!==void 0&&(y.bearing=O),N!==void 0&&(y.elevation=N),p.apply(y)}this.transform.apply(p)}_fireMoveEvents(r){this.fire(new c.k("move",r)),this._zooming&&this.fire(new c.k("zoom",r)),this._rotating&&this.fire(new c.k("rotate",r)),this._pitching&&this.fire(new c.k("pitch",r))}_afterEase(r,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId;const p=this._zooming,g=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new c.k("zoomend",r)),g&&this.fire(new c.k("rotateend",r)),y&&this.fire(new c.k("pitchend",r)),this.fire(new c.k("moveend",r))}flyTo(r,f){var p;if(!r.essential&&A.prefersReducedMotion){const dt=c.M(r,["center","zoom","bearing","pitch","around"]);return this.jumpTo(dt,f)}this.stop(),r=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.b9},r);const g=this._getTransformForUpdate(),y=g.zoom,E=g.bearing,C=g.pitch,M=g.padding,O="bearing"in r?this._normalizeBearing(r.bearing,E):E,N="pitch"in r?+r.pitch:C,B="padding"in r?r.padding:g.padding,H=c.P.convert(r.offset);let J=g.centerPoint.add(H);const te=g.pointLocation(J),{center:ae,zoom:he}=g.getConstrained(c.N.convert(r.center||te),(p=r.zoom)!==null&&p!==void 0?p:y);this._normalizeCenter(ae,g);const de=g.zoomScale(he-y),_e=g.project(te),re=g.project(ae).sub(_e);let xe=r.curve;const Ee=Math.max(g.width,g.height),Re=Ee/de,$e=re.mag();if("minZoom"in r){const dt=c.ac(Math.min(r.minZoom,y,he),g.minZoom,g.maxZoom),zt=Ee/g.zoomScale(dt-y);xe=Math.sqrt(zt/$e*2)}const st=xe*xe;function ut(dt){const zt=(Re*Re-Ee*Ee+(dt?-1:1)*st*st*$e*$e)/(2*(dt?Re:Ee)*st*$e);return Math.log(Math.sqrt(zt*zt+1)-zt)}function mt(dt){return(Math.exp(dt)-Math.exp(-dt))/2}function ot(dt){return(Math.exp(dt)+Math.exp(-dt))/2}const rt=ut(!1);let St=function(dt){return ot(rt)/ot(rt+xe*dt)},Ht=function(dt){return Ee*((ot(rt)*(mt(zt=rt+xe*dt)/ot(zt))-mt(rt))/st)/$e;var zt},lt=(ut(!0)-rt)/xe;if(Math.abs($e)<1e-6||!isFinite(lt)){if(Math.abs(Ee-Re)<1e-6)return this.easeTo(r,f);const dt=Re0,St=zt=>Math.exp(dt*xe*zt)}return r.duration="duration"in r?+r.duration:1e3*lt/("screenSpeed"in r?+r.screenSpeed/xe:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0),this._zooming=!0,this._rotating=E!==O,this._pitching=N!==C,this._padding=!g.isPaddingEqual(B),this._prepareEase(f,!1),this.terrain&&this._prepareElevation(ae),this._ease(dt=>{const zt=dt*lt,Ui=1/St(zt);g.zoom=dt===1?he:y+g.scaleZoom(Ui),this._rotating&&(g.bearing=c.y.number(E,O,dt)),this._pitching&&(g.pitch=c.y.number(C,N,dt)),this._padding&&(g.interpolatePadding(M,B,dt),J=g.centerPoint.add(H)),this.terrain&&!r.freezeElevation&&this._updateElevation(dt);const Yt=dt===1?ae:g.unproject(_e.add(re.mult(Ht(zt))).mult(Ui));g.setLocationAtPoint(g.renderWorldCopies?Yt.wrap():Yt,J),this._applyUpdatedTransform(g),this._fireMoveEvents(f)},()=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(f)},r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,f){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const g=this._onEaseEnd;delete this._onEaseEnd,g.call(this,f)}return r||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(r,f,p){p.animate===!1||p.duration===0?(r(1),f()):(this._easeStart=A.now(),this._easeOptions=p,this._onEaseFrame=r,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(r,f){r=c.b3(r,-180,180);const p=Math.abs(r-f);return Math.abs(r-360-f)180?-360:p<-180?360:0}queryTerrainElevation(r){return this.terrain?this.terrain.getElevationForLngLatZoom(c.N.convert(r),this.transform.tileZoom)-this.transform.elevation:null}}const El={compact:!0,customAttribution:'MapLibre'};class Al{constructor(r=El){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=f=>{!f||f.sourceDataType!=="metadata"&&f.sourceDataType!=="visibility"&&f.dataType!=="style"&&f.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=r}getDefaultPosition(){return"bottom-right"}onAdd(r){return this._map=r,this._compact=this.options.compact,this._container=P.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=P.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=P.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){P.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(r,f){const p=this._map._getUIString(`AttributionControl.${f}`);r.title=p,r.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let r=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=r.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&r.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const f=this._map.style.sourceCaches;for(const g in f){const y=f[g];if(y.used||y.usedForTerrain){const E=y.getSource();E.attribution&&r.indexOf(E.attribution)<0&&r.push(E.attribution)}}r=r.filter(g=>String(g).trim()),r.sort((g,y)=>g.length-y.length),r=r.filter((g,y)=>{for(let E=y+1;E=0)return!1;return!0});const p=r.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,r.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Jd{constructor(r={}){this._updateCompact=()=>{const f=this._container.children;if(f.length){const p=f[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=r}getDefaultPosition(){return"bottom-left"}onAdd(r){this._map=r,this._compact=this.options&&this.options.compact,this._container=P.create("div","maplibregl-ctrl");const f=P.create("a","maplibregl-ctrl-logo");return f.target="_blank",f.rel="noopener nofollow",f.href="https://maplibre.org/",f.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),f.setAttribute("rel","noopener nofollow"),this._container.appendChild(f),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){P.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ri{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const f=++this._id;return this._queue.push({callback:r,id:f,cancelled:!1}),f}remove(r){const f=this._currentlyRunning,p=f?this._queue.concat(f):this._queue;for(const g of p)if(g.id===r)return void(g.cancelled=!0)}run(r=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const f=this._currentlyRunning=this._queue;this._queue=[];for(const p of f)if(!p.cancelled&&(p.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Gd=c.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Xb extends c.E{constructor(r){super(),this.sourceCache=r,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,r.usedForTerrain=!0,r.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(r,f){this.sourceCache.update(r,f),this._renderableTilesKeys=[];const p={};for(const g of r.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f}))p[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),c.aP(g.posMatrix,0,c.X,0,c.X,0,1),this._tiles[g.key]=new Gi(g,this.tileSize));for(const g in this._tiles)p[g]||delete this._tiles[g]}freeRtt(r){for(const f in this._tiles){const p=this._tiles[f];(!r||p.tileID.equals(r)||p.tileID.isChildOf(r)||r.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(r=>this.getTileByID(r))}getTileByID(r){return this._tiles[r]}getTerrainCoords(r){const f={};for(const p of this._renderableTilesKeys){const g=this._tiles[p].tileID;if(g.canonical.equals(r.canonical)){const y=r.clone();y.posMatrix=new Float64Array(16),c.aP(y.posMatrix,0,c.X,0,c.X,0,1),f[p]=y}else if(g.canonical.isChildOf(r.canonical)){const y=r.clone();y.posMatrix=new Float64Array(16);const E=g.canonical.z-r.canonical.z,C=g.canonical.x-(g.canonical.x>>E<>E<>E;c.aP(y.posMatrix,0,O,0,O,0,1),c.J(y.posMatrix,y.posMatrix,[-C*O,-M*O,0]),f[p]=y}else if(r.canonical.isChildOf(g.canonical)){const y=r.clone();y.posMatrix=new Float64Array(16);const E=r.canonical.z-g.canonical.z,C=r.canonical.x-(r.canonical.x>>E<>E<>E;c.aP(y.posMatrix,0,c.X,0,c.X,0,1),c.J(y.posMatrix,y.posMatrix,[C*O,M*O,0]),c.K(y.posMatrix,y.posMatrix,[1/2**E,1/2**E,0]),f[p]=y}}return f}getSourceTile(r,f){const p=this.sourceCache._source;let g=r.overscaledZ-this.deltaZoom;if(g>p.maxzoom&&(g=p.maxzoom),g=p.minzoom&&(!y||!y.dem);)y=this.sourceCache.getTileByID(r.scaledTo(g--).key);return y}tilesAfterTime(r=Date.now()){return Object.values(this._tiles).filter(f=>f.timeAdded>=r)}}class Qd{constructor(r,f,p){this.painter=r,this.sourceCache=new Xb(f),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(r,f,p,g=c.X){var y;if(!(f>=0&&f=0&&pr.canonical.z&&(r.canonical.z>=g?y=r.canonical.z-g:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=r.canonical.x-(r.canonical.x>>y<>y<>8<<4|y>>8,f[E+3]=0;const p=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),g=new Xe(r,p,r.gl.RGBA,{premultiply:!1});return g.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(r){this.painter.maybeDrawDepthAndCoords(!0);const f=new Uint8Array(4),p=this.painter.context,g=p.gl,y=Math.round(r.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(r.y*this.painter.pixelRatio/devicePixelRatio),C=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(y,C-E-1,1,1,g.RGBA,g.UNSIGNED_BYTE,f),p.bindFramebuffer.set(null);const M=f[0]+(f[2]>>4<<8),O=f[1]+((15&f[2])<<8),N=this.coordsIndex[255-f[3]],B=N&&this.sourceCache.getTileByID(N);if(!B)return null;const H=this._coordsTextureSize,J=(1<r.id!==f),this._recentlyUsed.push(r.id)}stampObject(r){r.stamp=++this._stamp}getOrCreateFreeObject(){for(const f of this._recentlyUsed)if(!this._objects[f].inUse)return this._objects[f];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const r=this._createObject(this._objects.length);return this._objects.push(r),r}freeObject(r){r.inUse=!1}freeAllObjects(){for(const r of this._objects)this.freeObject(r)}isFull(){return!(this._objects.length!r.inUse)===!1}}const Il={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Bm{constructor(r,f){this.painter=r,this.terrain=f,this.pool=new Zb(r.context,30,f.sourceCache.tileSize*f.qualityFactor)}destruct(){this.pool.destruct()}getTexture(r){return this.pool.getObjectForId(r.rtt[this._stacks.length-1].id).texture}prepareForRender(r,f){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=r._order.filter(p=>!r._layers[p].isHidden(f)),this._coordsDescendingInv={};for(const p in r.sourceCaches){this._coordsDescendingInv[p]={};const g=r.sourceCaches[p].getVisibleCoordinates();for(const y of g){const E=this.terrain.sourceCache.getTerrainCoords(y);for(const C in E)this._coordsDescendingInv[p][C]||(this._coordsDescendingInv[p][C]=[]),this._coordsDescendingInv[p][C].push(E[C])}}this._coordsDescendingInvStr={};for(const p of r._order){const g=r._layers[p],y=g.source;if(Il[g.type]&&!this._coordsDescendingInvStr[y]){this._coordsDescendingInvStr[y]={};for(const E in this._coordsDescendingInv[y])this._coordsDescendingInvStr[y][E]=this._coordsDescendingInv[y][E].map(C=>C.key).sort().join()}}for(const p of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const y=this._coordsDescendingInvStr[g][p.tileID.key];y&&y!==p.rttCoords[g]&&(p.rtt=[])}}renderLayer(r){if(r.isHidden(this.painter.transform.zoom))return!1;const f=r.type,p=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===r.id;if(Il[f]&&(this._prevType&&Il[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(r.id),!g))return!0;if(Il[this._prevType]||Il[f]&&g){this._prevType=f;const y=this._stacks.length-1,E=this._stacks[y]||[];for(const C of this._renderableTiles){if(this.pool.isFull()&&(Pm(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(C),C.rtt[y]){const O=this.pool.getObjectForId(C.rtt[y].id);if(O.stamp===C.rtt[y].stamp){this.pool.useObject(O);continue}}const M=this.pool.getOrCreateFreeObject();this.pool.useObject(M),this.pool.stampObject(M),C.rtt[y]={id:M.id,stamp:M.stamp},p.context.bindFramebuffer.set(M.fbo.framebuffer),p.context.clear({color:c.aM.transparent,stencil:0}),p.currentStencilSource=void 0;for(let O=0;O{b.touchstart=b.dragStart,b.touchmoveWindow=b.dragMove,b.touchend=b.dragEnd},Kb={showCompass:!0,showZoom:!0,visualizePitch:!1};class Jb{constructor(r,f,p=!1){this.mousedown=E=>{this.startMouse(c.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),P.mousePos(this.element,E)),P.addEventListener(window,"mousemove",this.mousemove),P.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,P.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=P.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),P.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=P.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const g=r.dragRotate._mouseRotate.getClickTolerance(),y=r.dragRotate._mousePitch.getClickTolerance();this.element=f,this.mouseRotate=jd({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:C,bearingDegreesPerPixelMoved:M=.8})=>{const O=new Vd;return new Ao({clickTolerance:C,move:(N,B)=>({bearingDelta:(B.x-N.x)*M}),moveStateManager:O,enable:E,assignEvents:tp})})({clickTolerance:g,enable:!0}),this.map=r,p&&(this.mousePitch=$d({clickTolerance:y,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:C,pitchDegreesPerPixelMoved:M=-.5})=>{const O=new Vd;return new Ao({clickTolerance:C,move:(N,B)=>({pitchDelta:(B.y-N.y)*M}),moveStateManager:O,enable:E,assignEvents:tp})})({clickTolerance:y,enable:!0})),P.addEventListener(f,"mousedown",this.mousedown),P.addEventListener(f,"touchstart",this.touchstart,{passive:!1}),P.addEventListener(f,"touchcancel",this.reset)}startMouse(r,f){this.mouseRotate.dragStart(r,f),this.mousePitch&&this.mousePitch.dragStart(r,f),P.disableDrag()}startTouch(r,f){this.touchRotate.dragStart(r,f),this.touchPitch&&this.touchPitch.dragStart(r,f),P.disableDrag()}moveMouse(r,f){const p=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(r,f)||{};if(g&&p.setBearing(p.getBearing()+g),this.mousePitch){const{pitchDelta:y}=this.mousePitch.dragMove(r,f)||{};y&&p.setPitch(p.getPitch()+y)}}moveTouch(r,f){const p=this.map,{bearingDelta:g}=this.touchRotate.dragMove(r,f)||{};if(g&&p.setBearing(p.getBearing()+g),this.touchPitch){const{pitchDelta:y}=this.touchPitch.dragMove(r,f)||{};y&&p.setPitch(p.getPitch()+y)}}off(){const r=this.element;P.removeEventListener(r,"mousedown",this.mousedown),P.removeEventListener(r,"touchstart",this.touchstart,{passive:!1}),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend),P.removeEventListener(r,"touchcancel",this.reset),this.offTemp()}offTemp(){P.enableDrag(),P.removeEventListener(window,"mousemove",this.mousemove),P.removeEventListener(window,"mouseup",this.mouseup),P.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),P.removeEventListener(window,"touchend",this.touchend)}}let Kn;function zi(b,r,f){const p=new c.N(b.lng,b.lat);if(b=new c.N(b.lng,b.lat),r){const g=new c.N(b.lng-360,b.lat),y=new c.N(b.lng+360,b.lat),E=f.locationPoint(b).distSqr(r);f.locationPoint(g).distSqr(r)180;){const g=f.locationPoint(b);if(g.x>=0&&g.y>=0&&g.x<=f.width&&g.y<=f.height)break;b.lng>f.center.lng?b.lng-=360:b.lng+=360}return b.lng!==p.lng&&f.locationPoint(b).y>f.height/2-f.getHorizon()?b:p}const Cl={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 Eh(b,r,f){const p=b.classList;for(const g in Cl)p.remove(`maplibregl-${f}-anchor-${g}`);p.add(`maplibregl-${f}-anchor-${r}`)}class Ah extends c.E{constructor(r){if(super(),this._onKeyPress=f=>{const p=f.code,g=f.charCode||f.keyCode;p!=="Space"&&p!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=f=>{const p=f.originalEvent.target,g=this._element;this._popup&&(p===g||g.contains(p))&&this.togglePopup()},this._update=f=>{var p;if(!this._map)return;const g=this._map.loaded()&&!this._map.isMoving();((f==null?void 0:f.type)==="terrain"||(f==null?void 0:f.type)==="render"&&!g)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?zi(this._lngLat,this._flatPos,this._map.transform):(p=this._lngLat)===null||p===void 0?void 0:p.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let y="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?y=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(y=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||f&&f.type!=="moveend"||(this._pos=this._pos.round()),P.setTransform(this._element,`${Cl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${y}`),A.frameAsync(new AbortController).then(()=>{this._updateOpacity(f&&f.type==="moveend")}).catch(()=>{})},this._onMove=f=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=f.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=f.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=f=>{this._element.contains(f.originalEvent.target)&&(f.preventDefault(),this._positionDelta=f.point.sub(this._pos).add(this._offset),this._pointerdownPos=f.point,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))},this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._subpixelPositioning=r&&r.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment!=="auto"?r.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(r==null?void 0:r.opacity,r==null?void 0:r.opacityWhenCovered),r&&r.element)this._element=r.element,this._offset=c.P.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=P.create("div");const f=P.createNS("http://www.w3.org/2000/svg","svg"),p=41,g=27;f.setAttributeNS(null,"display","block"),f.setAttributeNS(null,"height",`${p}px`),f.setAttributeNS(null,"width",`${g}px`),f.setAttributeNS(null,"viewBox",`0 0 ${g} ${p}`);const y=P.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"stroke","none"),y.setAttributeNS(null,"stroke-width","1"),y.setAttributeNS(null,"fill","none"),y.setAttributeNS(null,"fill-rule","evenodd");const E=P.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const C=P.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"transform","translate(3.0, 29.0)"),C.setAttributeNS(null,"fill","#000000");const M=[{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"}];for(const de of M){const _e=P.createNS("http://www.w3.org/2000/svg","ellipse");_e.setAttributeNS(null,"opacity","0.04"),_e.setAttributeNS(null,"cx","10.5"),_e.setAttributeNS(null,"cy","5.80029008"),_e.setAttributeNS(null,"rx",de.rx),_e.setAttributeNS(null,"ry",de.ry),C.appendChild(_e)}const O=P.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);const N=P.createNS("http://www.w3.org/2000/svg","path");N.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"),O.appendChild(N);const B=P.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"fill","#000000");const H=P.createNS("http://www.w3.org/2000/svg","path");H.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"),B.appendChild(H);const J=P.createNS("http://www.w3.org/2000/svg","g");J.setAttributeNS(null,"transform","translate(6.0, 7.0)"),J.setAttributeNS(null,"fill","#FFFFFF");const te=P.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ae=P.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");const he=P.createNS("http://www.w3.org/2000/svg","circle");he.setAttributeNS(null,"fill","#FFFFFF"),he.setAttributeNS(null,"cx","5.5"),he.setAttributeNS(null,"cy","5.5"),he.setAttributeNS(null,"r","5.4999962"),te.appendChild(ae),te.appendChild(he),E.appendChild(C),E.appendChild(O),E.appendChild(B),E.appendChild(J),E.appendChild(te),f.appendChild(E),f.setAttributeNS(null,"height",p*this._scale+"px"),f.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(f),this._offset=c.P.convert(r&&r.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",f=>{f.preventDefault()}),this._element.addEventListener("mousedown",f=>{f.preventDefault()}),Eh(this._element,this._anchor,"marker"),r&&r.className)for(const f of r.className.split(" "))this._element.classList.add(f);this._popup=null}addTo(r){return this.remove(),this._map=r,this._element.setAttribute("aria-label",r._getUIString("Marker.Title")),r.getCanvasContainer().appendChild(this._element),r.on("move",this._update),r.on("moveend",this._update),r.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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),P.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(r){return this._lngLat=c.N.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const g=Math.abs(13.5)/Math.SQRT2;r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(r){return this._subpixelPositioning=r,this}getPopup(){return this._popup}togglePopup(){const r=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:r?(r.isOpen()?r.remove():(r.setLngLat(this._lngLat),r.addTo(this._map)),this):this}_updateOpacity(r=!1){var f,p;if(!(!((f=this._map)===null||f===void 0)&&f.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(r)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const g=this._map,y=g.terrain.depthAtPoint(this._pos),E=g.terrain.getElevationForLngLatZoom(this._lngLat,g.transform.tileZoom);if(g.transform.lngLatToCameraDepth(this._lngLat,E)-y<.006)return void(this._element.style.opacity=this._opacity);const C=-this._offset.y/g.transform._pixelPerMeter,M=Math.sin(g.getPitch()*Math.PI/180)*C,O=g.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),N=g.transform.lngLatToCameraDepth(this._lngLat,E+M)-O>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&N&&this._popup.remove(),this._element.style.opacity=N?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(r){return this._offset=c.P.convert(r),this._update(),this}addClassName(r){this._element.classList.add(r)}removeClassName(r){this._element.classList.remove(r)}toggleClassName(r){return this._element.classList.toggle(r)}setDraggable(r){return this._draggable=!!r,this._map&&(r?(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}isDraggable(){return this._draggable}setRotation(r){return this._rotation=r||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(r){return this._rotationAlignment=r||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(r){return this._pitchAlignment=r&&r!=="auto"?r:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(r,f){return r===void 0&&f===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),r!==void 0&&(this._opacity=r),f!==void 0&&(this._opacityWhenCovered=f),this._map&&this._updateOpacity(!0),this}}const zm={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Xc=0,Zc=!1;const lo={maxWidth:100,unit:"metric"};function Yc(b,r,f){const p=f&&f.maxWidth||100,g=b._container.clientHeight/2,y=b.unproject([0,g]),E=b.unproject([p,g]),C=y.distanceTo(E);if(f&&f.unit==="imperial"){const M=3.2808*C;M>5280?Tt(r,p,M/5280,b._getUIString("ScaleControl.Miles")):Tt(r,p,M,b._getUIString("ScaleControl.Feet"))}else f&&f.unit==="nautical"?Tt(r,p,C/1852,b._getUIString("ScaleControl.NauticalMiles")):C>=1e3?Tt(r,p,C/1e3,b._getUIString("ScaleControl.Kilometers")):Tt(r,p,C,b._getUIString("ScaleControl.Meters"))}function Tt(b,r,f,p){const g=function(y){const E=Math.pow(10,`${Math.floor(y)}`.length-1);let C=y/E;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:C>=1?1:function(M){const O=Math.pow(10,Math.ceil(-Math.log(M)/Math.LN10));return Math.round(M*O)/O}(C),E*C}(f);b.style.width=r*(g/f)+"px",b.innerHTML=`${g} ${p}`}const Ft={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Ih=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ch(b){if(b){if(typeof b=="number"){const r=Math.round(Math.abs(b)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,b),"top-left":new c.P(r,r),"top-right":new c.P(-r,r),bottom:new c.P(0,-b),"bottom-left":new c.P(r,-r),"bottom-right":new c.P(-r,-r),left:new c.P(b,0),right:new c.P(-b,0)}}if(b instanceof c.P||Array.isArray(b)){const r=c.P.convert(b);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:c.P.convert(b.center||[0,0]),top:c.P.convert(b.top||[0,0]),"top-left":c.P.convert(b["top-left"]||[0,0]),"top-right":c.P.convert(b["top-right"]||[0,0]),bottom:c.P.convert(b.bottom||[0,0]),"bottom-left":c.P.convert(b["bottom-left"]||[0,0]),"bottom-right":c.P.convert(b["bottom-right"]||[0,0]),left:c.P.convert(b.left||[0,0]),right:c.P.convert(b.right||[0,0])}}return Ch(new c.P(0,0))}const ip=_;u.AJAXError=c.bh,u.Evented=c.E,u.LngLat=c.N,u.MercatorCoordinate=c.Z,u.Point=c.P,u.addProtocol=c.bi,u.config=c.a,u.removeProtocol=c.bj,u.AttributionControl=Al,u.BoxZoomHandler=Yn,u.CanvasSource=wt,u.CooperativeGesturesHandler=Sl,u.DoubleClickZoomHandler=La,u.DragPanHandler=Dm,u.DragRotateHandler=Fm,u.EdgeInsets=vl,u.FullscreenControl=class extends c.E{constructor(b={}){super(),this._onFullscreenChange=()=>{var r;let f=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((r=f==null?void 0:f.shadowRoot)===null||r===void 0)&&r.fullscreenElement;)f=f.shadowRoot.fullscreenElement;f===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,b&&b.container&&(b.container instanceof HTMLElement?this._container=b.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(b){return this._map=b,this._container||(this._container=this._map.getContainer()),this._controlContainer=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){P.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const b=this._fullscreenButton=P.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);P.create("span","maplibregl-ctrl-icon",b).setAttribute("aria-hidden","true"),b.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const b=this._getTitle();this._fullscreenButton.setAttribute("aria-label",b),this._fullscreenButton.title=b}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},u.GeoJSONSource=it,u.GeolocateControl=class extends c.E{constructor(b){super(),this._onSuccess=r=>{if(this._map){if(this._isOutOfMapMaxBounds(r))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",r)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(r),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(r),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",r)),this._finish()}},this._updateCamera=r=>{const f=new c.N(r.coords.longitude,r.coords.latitude),p=r.coords.accuracy,g=this._map.getBearing(),y=c.e({bearing:g},this.options.fitBoundsOptions),E=ce.fromLngLat(f,p);this._map.fitBounds(E,y,{geolocateSource:!0})},this._updateMarker=r=>{if(r){const f=new c.N(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(f).addTo(this._map),this._userLocationDotMarker.setLngLat(f).addTo(this._map),this._accuracy=r.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=r=>{if(this._map){if(this.options.trackUserLocation)if(r.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(r.code===3&&Zc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",r)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",r=>r.preventDefault()),this._geolocateButton=P.create("button","maplibregl-ctrl-geolocate",this._container),P.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=r=>{if(this._map){if(r===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}else{const f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=P.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ah({element:this._dotElement}),this._circleElement=P.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ah({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",f=>{f.geolocateSource||this._watchState!=="ACTIVE_LOCK"||f.originalEvent&&f.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")),this.fire(new c.k("userlocationlostfocus")))})}},this.options=c.e({},zm,b)}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return c._(this,arguments,void 0,function*(r=!1){if(Kn!==void 0&&!r)return Kn;if(window.navigator.permissions===void 0)return Kn=!!window.navigator.geolocation,Kn;try{Kn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Kn=!!window.navigator.geolocation}return Kn})}().then(r=>this._finishSetupUI(r)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),P.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xc=0,Zc=!1}_isOutOfMapMaxBounds(b){const r=this._map.getMaxBounds(),f=b.coords;return r&&(f.longituder.getEast()||f.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const b=this._map.getBounds(),r=b.getSouthEast(),f=b.getNorthEast(),p=r.distanceTo(f),g=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}px`}trigger(){if(!this._setup)return c.w("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 c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xc--,Zc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart")),this.fire(new c.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let b;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Xc++,Xc>1?(b={maximumAge:6e5,timeout:0},Zc=!0):(b=this.options.positionOptions,Zc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,b)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},u.Hash=mh,u.ImageSource=Mt,u.KeyboardHandler=mr,u.LngLatBounds=ce,u.LogoControl=Jd,u.Map=class extends Nm{constructor(b){c.bf.mark(c.bg.create);const r=Object.assign(Object.assign({},Yb),b);if(r.minZoom!=null&&r.maxZoom!=null&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(r.minPitch!=null&&r.maxPitch!=null&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(r.minPitch!=null&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(r.maxPitch!=null&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new xl(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ri,this._controls=[],this._mapId=c.a4(),this._contextLost=f=>{f.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new c.k("webglcontextlost",{originalEvent:f}))},this._contextRestored=f=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:f}))},this._onMapScroll=f=>{if(f.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=r.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=r.preserveDrawingBuffer===!0,this._antialias=r.antialias===!0,this._trackResize=r.trackResize===!0,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=r.refreshExpiredTiles===!0,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=r.crossSourceCollisions===!0,this._collectResourceTiming=r.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ep),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=r.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=se.addThrottleControl(()=>this.isMoving()),this._requestManager=new fe(r.transformRequest),typeof r.container=="string"){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let f=!1;const p=jc(g=>{this._trackResize&&!this._removed&&(this.resize(g),this.redraw())},50);this._resizeObserver=new ResizeObserver(g=>{f?p(g):f=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Kd(this,r),this._hash=r.hash&&new mh(typeof r.hash=="string"&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,c.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Al(typeof r.attributionControl=="boolean"?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Jd,r.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",f=>{this._update(f.dataType==="style"),this.fire(new c.k(`${f.dataType}data`,f))}),this.on("dataloading",f=>{this.fire(new c.k(`${f.dataType}dataloading`,f))}),this.on("dataabort",f=>{this.fire(new c.k("sourcedataabort",f))})}_getMapId(){return this._mapId}addControl(b,r){if(r===void 0&&(r=b.getDefaultPosition?b.getDefaultPosition():"top-right"),!b||!b.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const f=b.onAdd(this);this._controls.push(b);const p=this._controlPositions[r];return r.indexOf("bottom")!==-1?p.insertBefore(f,p.firstChild):p.appendChild(f),this}removeControl(b){if(!b||!b.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(b);return r>-1&&this._controls.splice(r,1),b.onRemove(this),this}hasControl(b){return this._controls.indexOf(b)>-1}calculateCameraOptionsFromTo(b,r,f,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(f,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(b,r,f,p)}resize(b){var r;const f=this._containerDimensions(),p=f[0],g=f[1],y=this._getClampedPixelRatio(p,g);if(this._resizeCanvas(p,g,y),this.painter.resize(p,g,y),this.painter.overLimit()){const C=this.painter.context.gl;this._maxCanvasSize=[C.drawingBufferWidth,C.drawingBufferHeight];const M=this._getClampedPixelRatio(p,g);this._resizeCanvas(p,g,M),this.painter.resize(p,g,M)}this.transform.resize(p,g),(r=this._requestedCameraState)===null||r===void 0||r.resize(p,g);const E=!this._moving;return E&&(this.stop(),this.fire(new c.k("movestart",b)).fire(new c.k("move",b))),this.fire(new c.k("resize",b)),E&&this.fire(new c.k("moveend",b)),this}_getClampedPixelRatio(b,r){const{0:f,1:p}=this._maxCanvasSize,g=this.getPixelRatio(),y=b*g,E=r*g;return Math.min(y>f?f/y:1,E>p?p/E:1)*g}getPixelRatio(){var b;return(b=this._overridePixelRatio)!==null&&b!==void 0?b:devicePixelRatio}setPixelRatio(b){this._overridePixelRatio=b,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(b){return this.transform.setMaxBounds(ce.convert(b)),this._update()}setMinZoom(b){if((b=b??-2)>=-2&&b<=this.transform.maxZoom)return this.transform.minZoom=b,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=b,this._update(),this.getZoom()>b&&this.setZoom(b),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(b){if((b=b??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(b>=0&&b<=this.transform.maxPitch)return this.transform.minPitch=b,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(b>=this.transform.minPitch)return this.transform.maxPitch=b,this._update(),this.getPitch()>b&&this.setPitch(b),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(b){return this.transform.renderWorldCopies=b,this._update()}project(b){return this.transform.locationPoint(c.N.convert(b),this.style&&this.terrain)}unproject(b){return this.transform.pointLocation(c.P.convert(b),this.terrain)}isMoving(){var b;return this._moving||((b=this.handlers)===null||b===void 0?void 0:b.isMoving())}isZooming(){var b;return this._zooming||((b=this.handlers)===null||b===void 0?void 0:b.isZooming())}isRotating(){var b;return this._rotating||((b=this.handlers)===null||b===void 0?void 0:b.isRotating())}_createDelegatedListener(b,r,f){if(b==="mouseenter"||b==="mouseover"){let p=!1;return{layers:r,listener:f,delegates:{mousemove:y=>{const E=r.filter(M=>this.getLayer(M)),C=E.length!==0?this.queryRenderedFeatures(y.point,{layers:E}):[];C.length?p||(p=!0,f.call(this,new en(b,this,y.originalEvent,{features:C}))):p=!1},mouseout:()=>{p=!1}}}}if(b==="mouseleave"||b==="mouseout"){let p=!1;return{layers:r,listener:f,delegates:{mousemove:E=>{const C=r.filter(M=>this.getLayer(M));(C.length!==0?this.queryRenderedFeatures(E.point,{layers:C}):[]).length?p=!0:p&&(p=!1,f.call(this,new en(b,this,E.originalEvent)))},mouseout:E=>{p&&(p=!1,f.call(this,new en(b,this,E.originalEvent)))}}}}{const p=g=>{const y=r.filter(C=>this.getLayer(C)),E=y.length!==0?this.queryRenderedFeatures(g.point,{layers:y}):[];E.length&&(g.features=E,f.call(this,g),delete g.features)};return{layers:r,listener:f,delegates:{[b]:p}}}}_saveDelegatedListener(b,r){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[b]=this._delegatedListeners[b]||[],this._delegatedListeners[b].push(r)}_removeDelegatedListener(b,r,f){if(!this._delegatedListeners||!this._delegatedListeners[b])return;const p=this._delegatedListeners[b];for(let g=0;gr.includes(E))){for(const E in y.delegates)this.off(E,y.delegates[E]);return void p.splice(g,1)}}}on(b,r,f){if(f===void 0)return super.on(b,r);const p=this._createDelegatedListener(b,typeof r=="string"?[r]:r,f);this._saveDelegatedListener(b,p);for(const g in p.delegates)this.on(g,p.delegates[g]);return this}once(b,r,f){if(f===void 0)return super.once(b,r);const p=typeof r=="string"?[r]:r,g=this._createDelegatedListener(b,p,f);for(const y in g.delegates){const E=g.delegates[y];g.delegates[y]=(...C)=>{this._removeDelegatedListener(b,p,f),E(...C)}}this._saveDelegatedListener(b,g);for(const y in g.delegates)this.once(y,g.delegates[y]);return this}off(b,r,f){return f===void 0?super.off(b,r):(this._removeDelegatedListener(b,typeof r=="string"?[r]:r,f),this)}queryRenderedFeatures(b,r){if(!this.style)return[];let f;const p=b instanceof c.P||Array.isArray(b),g=p?b:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(p?{}:b)||{},g instanceof c.P||typeof g[0]=="number")f=[c.P.convert(g)];else{const y=c.P.convert(g[0]),E=c.P.convert(g[1]);f=[y,new c.P(E.x,y.y),E,new c.P(y.x,E.y),y]}return this.style.queryRenderedFeatures(f,r,this.transform)}querySourceFeatures(b,r){return this.style.querySourceFeatures(b,r)}setStyle(b,r){return(r=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&b?(this._diffStyle(b,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(b,r))}setTransformRequest(b){return this._requestManager.setTransformRequest(b),this}_getUIString(b){const r=this._locale[b];if(r==null)throw new Error(`Missing UI string '${b}'`);return r}_updateStyle(b,r){if(r.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(b,r));const f=this.style&&r.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!b)),b?(this.style=new ul(this,r||{}),this.style.setEventedParent(this,{style:this.style}),typeof b=="string"?this.style.loadURL(b,r,f):this.style.loadJSON(b,r,f),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ul(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(b,r){if(typeof b=="string"){const f=this._requestManager.transformRequest(b,"Style");c.h(f,new AbortController).then(p=>{this._updateDiff(p.data,r)}).catch(p=>{p&&this.fire(new c.j(p))})}else typeof b=="object"&&this._updateDiff(b,r)}_updateDiff(b,r){try{this.style.setState(b,r)&&this._update(!0)}catch(f){c.w(`Unable to perform style diff: ${f.message||f.error||f}. Rebuilding the style from scratch.`),this._updateStyle(b,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(b,r){return this._lazyInitEmptyStyle(),this.style.addSource(b,r),this._update(!0)}isSourceLoaded(b){const r=this.style&&this.style.sourceCaches[b];if(r!==void 0)return r.loaded();this.fire(new c.j(new Error(`There is no source with ID '${b}'`)))}setTerrain(b){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),b){const r=this.style.sourceCaches[b.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${b.source}`);this.terrain===null&&r.reload();for(const f in this.style._layers){const p=this.style._layers[f];p.type==="hillshade"&&p.source===b.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Qd(this.painter,r,b),this.painter.renderToTexture=new Bm(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=f=>{f.dataType==="style"?this.terrain.sourceCache.freeRtt():f.dataType==="source"&&f.tile&&(f.sourceId!==b.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(f.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:b})),this}getTerrain(){var b,r;return(r=(b=this.terrain)===null||b===void 0?void 0:b.options)!==null&&r!==void 0?r:null}areTilesLoaded(){const b=this.style&&this.style.sourceCaches;for(const r in b){const f=b[r]._tiles;for(const p in f){const g=f[p];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(b){return this.style.removeSource(b),this._update(!0)}getSource(b){return this.style.getSource(b)}addImage(b,r,f={}){const{pixelRatio:p=1,sdf:g=!1,stretchX:y,stretchY:E,content:C,textFitWidth:M,textFitHeight:O}=f;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||c.b(r))){if(r.width===void 0||r.height===void 0)return this.fire(new c.j(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`")));{const{width:N,height:B,data:H}=r,J=r;return this.style.addImage(b,{data:new c.R({width:N,height:B},new Uint8Array(H)),pixelRatio:p,stretchX:y,stretchY:E,content:C,textFitWidth:M,textFitHeight:O,sdf:g,version:0,userImage:J}),J.onAdd&&J.onAdd(this,b),this}}{const{width:N,height:B,data:H}=A.getImageData(r);this.style.addImage(b,{data:new c.R({width:N,height:B},H),pixelRatio:p,stretchX:y,stretchY:E,content:C,textFitWidth:M,textFitHeight:O,sdf:g,version:0})}}updateImage(b,r){const f=this.style.getImage(b);if(!f)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=r instanceof HTMLImageElement||c.b(r)?A.getImageData(r):r,{width:g,height:y,data:E}=p;if(g===void 0||y===void 0)return this.fire(new c.j(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`")));if(g!==f.data.width||y!==f.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const C=!(r instanceof HTMLImageElement||c.b(r));return f.data.replace(E,C),this.style.updateImage(b,f),this}getImage(b){return this.style.getImage(b)}hasImage(b){return b?!!this.style.getImage(b):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(b){this.style.removeImage(b)}loadImage(b){return se.getImage(this._requestManager.transformRequest(b,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(b,r){return this._lazyInitEmptyStyle(),this.style.addLayer(b,r),this._update(!0)}moveLayer(b,r){return this.style.moveLayer(b,r),this._update(!0)}removeLayer(b){return this.style.removeLayer(b),this._update(!0)}getLayer(b){return this.style.getLayer(b)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(b,r,f){return this.style.setLayerZoomRange(b,r,f),this._update(!0)}setFilter(b,r,f={}){return this.style.setFilter(b,r,f),this._update(!0)}getFilter(b){return this.style.getFilter(b)}setPaintProperty(b,r,f,p={}){return this.style.setPaintProperty(b,r,f,p),this._update(!0)}getPaintProperty(b,r){return this.style.getPaintProperty(b,r)}setLayoutProperty(b,r,f,p={}){return this.style.setLayoutProperty(b,r,f,p),this._update(!0)}getLayoutProperty(b,r){return this.style.getLayoutProperty(b,r)}setGlyphs(b,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(b,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(b,r,f={}){return this._lazyInitEmptyStyle(),this.style.addSprite(b,r,f,p=>{p||this._update(!0)}),this}removeSprite(b){return this._lazyInitEmptyStyle(),this.style.removeSprite(b),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(b,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(b,r,f=>{f||this._update(!0)}),this}setLight(b,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(b,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(b){return this._lazyInitEmptyStyle(),this.style.setSky(b),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(b,r){return this.style.setFeatureState(b,r),this._update()}removeFeatureState(b,r){return this.style.removeFeatureState(b,r),this._update()}getFeatureState(b){return this.style.getFeatureState(b)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let b=0,r=0;return this._container&&(b=this._container.clientWidth||400,r=this._container.clientHeight||300),[b,r]}_setupContainer(){const b=this._container;b.classList.add("maplibregl-map");const r=this._canvasContainer=P.create("div","maplibregl-canvas-container",b);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=P.create("canvas","maplibregl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const f=this._containerDimensions(),p=this._getClampedPixelRatio(f[0],f[1]);this._resizeCanvas(f[0],f[1],p);const g=this._controlContainer=P.create("div","maplibregl-control-container",b),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{y[E]=P.create("div",`maplibregl-ctrl-${E} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(b,r,f){this._canvas.width=Math.floor(f*b),this._canvas.height=Math.floor(f*r),this._canvas.style.width=`${b}px`,this._canvas.style.height=`${r}px`}_setupPainter(){const b={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let r=null;this._canvas.addEventListener("webglcontextcreationerror",p=>{r={requestedAttributes:b},p&&(r.statusMessage=p.statusMessage,r.type=p.type)},{once:!0});const f=this._canvas.getContext("webgl2",b)||this._canvas.getContext("webgl",b);if(!f){const p="Failed to initialize WebGL";throw r?(r.message=p,new Error(JSON.stringify(r))):new Error(p)}this.painter=new gh(f,this.transform),D.testSupport(f)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(b){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||b,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(b){return this._update(),this._renderTaskQueue.add(b)}_cancelRenderFrame(b){this._renderTaskQueue.remove(b)}_render(b){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(b),this._removed)return;let f=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,y=A.now();this.style.zoomHistory.update(g,y);const E=new c.z(g,{now:y,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),C=E.crossFadingFactor();C===1&&C===this._crossFadingFactor||(f=!0,this._crossFadingFactor=C),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bf.mark(c.bg.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||f)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0,c.bf.mark(c.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var b;this._hash&&this._hash.remove();for(const f of this._controls)f.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),se.removeThrottleControl(this._imageQueueHandle),(b=this._resizeObserver)===null||b===void 0||b.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");r!=null&&r.loseContext&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),P.remove(this._canvasContainer),P.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),c.bf.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,A.frameAsync(this._frameRequest).then(b=>{c.bf.frame(b),this._frameRequest=null,this._render(b)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(b){this._showTileBoundaries!==b&&(this._showTileBoundaries=b,this._update())}get showPadding(){return!!this._showPadding}set showPadding(b){this._showPadding!==b&&(this._showPadding=b,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(b){this._showCollisionBoxes!==b&&(this._showCollisionBoxes=b,b?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(b){this._showOverdrawInspector!==b&&(this._showOverdrawInspector=b,this._update())}get repaint(){return!!this._repaint}set repaint(b){this._repaint!==b&&(this._repaint=b,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(b){this._vertices=b,this._update()}get version(){return Lm}getCameraTargetElevation(){return this.transform.elevation}},u.MapMouseEvent=en,u.MapTouchEvent=Na,u.MapWheelEvent=Rm,u.Marker=Ah,u.NavigationControl=class{constructor(b){this._updateZoomButtons=()=>{const r=this._map.getZoom(),f=r===this._map.getMaxZoom(),p=r===this._map.getMinZoom();this._zoomInButton.disabled=f,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",f.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{const r=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=r},this._setButtonTitle=(r,f)=>{const p=this._map._getUIString(`NavigationControl.${f}`);r.title=p,r.setAttribute("aria-label",p)},this.options=c.e({},Kb,b),this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",r=>this._map.zoomIn({},{originalEvent:r})),P.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",r=>this._map.zoomOut({},{originalEvent:r})),P.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",r=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:r}):this._map.resetNorth({},{originalEvent:r})}),this._compassIcon=P.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(b){return this._map=b,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 Jb(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){P.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}_createButton(b,r){const f=P.create("button",b,this._container);return f.type="button",f.addEventListener("click",r),f}},u.Popup=class extends c.E{constructor(b){super(),this.remove=()=>(this._content&&P.remove(this._content),this._container&&(P.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.k("close"))),this),this._onMouseUp=r=>{this._update(r.point)},this._onMouseMove=r=>{this._update(r.point)},this._onDrag=r=>{this._update(r.point)},this._update=r=>{var f;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=P.create("div","maplibregl-popup",this._map.getContainer()),this._tip=P.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const C of this.options.className.split(" "))this._container.classList.add(C);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?zi(this._lngLat,this._flatPos,this._map.transform):(f=this._lngLat)===null||f===void 0?void 0:f.wrap(),this._trackPointer&&!r)return;const p=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map.transform.locationPoint(this._lngLat));let g=this.options.anchor;const y=Ch(this.options.offset);if(!g){const C=this._container.offsetWidth,M=this._container.offsetHeight;let O;O=p.y+y.bottom.ythis._map.transform.height-M?["bottom"]:[],p.xthis._map.transform.width-C/2&&O.push("right"),g=O.length===0?"bottom":O.join("-")}let E=p.add(y[g]);this.options.subpixelPositioning||(E=E.round()),P.setTransform(this._container,`${Cl[g]} translate(${E.x}px,${E.y}px)`),Eh(this._container,g,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(Ft),b)}addTo(b){return this._map&&this.remove(),this._map=b,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(b){return this._lngLat=c.N.convert(b),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(b){return this.setDOMContent(document.createTextNode(b))}setHTML(b){const r=document.createDocumentFragment(),f=document.createElement("body");let p;for(f.innerHTML=b;p=f.firstChild,p;)r.appendChild(p);return this.setDOMContent(r)}getMaxWidth(){var b;return(b=this._container)===null||b===void 0?void 0:b.style.maxWidth}setMaxWidth(b){return this.options.maxWidth=b,this._update(),this}setDOMContent(b){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=P.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(b),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(b){return this._container&&this._container.classList.add(b),this}removeClassName(b){return this._container&&this._container.classList.remove(b),this}setOffset(b){return this.options.offset=b,this._update(),this}toggleClassName(b){if(this._container)return this._container.classList.toggle(b)}setSubpixelPositioning(b){this.options.subpixelPositioning=b}_createCloseButton(){this.options.closeButton&&(this._closeButton=P.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const b=this._container.querySelector(Ih);b&&b.focus()}},u.RasterDEMTileSource=Ye,u.RasterTileSource=Ze,u.ScaleControl=class{constructor(b){this._onMove=()=>{Yc(this._map,this._container,this.options)},this.setUnit=r=>{this.options.unit=r,Yc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},lo),b)}getDefaultPosition(){return"bottom-left"}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-scale",b.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){P.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},u.ScrollZoomHandler=Br,u.Style=ul,u.TerrainControl=class{constructor(b){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=b}onAdd(b){return this._map=b,this._container=P.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=P.create("button","maplibregl-ctrl-terrain",this._container),P.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){P.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},u.TwoFingersTouchPitchHandler=Tl,u.TwoFingersTouchRotateHandler=Xd,u.TwoFingersTouchZoomHandler=Wd,u.TwoFingersTouchZoomRotateHandler=Yd,u.VectorTileSource=Ge,u.VideoSource=gt,u.addSourceType=(b,r)=>c._(void 0,void 0,void 0,function*(){if(Kt(b))throw new Error(`A source type called "${b}" already exists.`);((f,p)=>{Lt[f]=p})(b,r)}),u.clearPrewarmedResources=function(){const b=hi;b&&(b.isPreloaded()&&b.numActive()===1?(b.release(An),hi=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()"))},u.getMaxParallelImageRequests=function(){return c.a.MAX_PARALLEL_IMAGE_REQUESTS},u.getRTLTextPluginStatus=function(){return _i().getRTLTextPluginStatus()},u.getVersion=function(){return ip},u.getWorkerCount=function(){return In.workerCount},u.getWorkerUrl=function(){return c.a.WORKER_URL},u.importScriptInWorkers=function(b){return Xn().broadcast("IS",b)},u.prewarm=function(){bi().acquire(An)},u.setMaxParallelImageRequests=function(b){c.a.MAX_PARALLEL_IMAGE_REQUESTS=b},u.setRTLTextPlugin=function(b,r){return _i().setRTLTextPlugin(b,r)},u.setWorkerCount=function(b){In.workerCount=b},u.setWorkerUrl=function(b){c.a.WORKER_URL=b}});var a=i;return a})})(O3);var dX=O3.exports;const SC=gk(dX);function Xr(t,e,i,s,n){return ko(e,F3(t,e),i,s,n)}function ko(t,e,i,s,n,a){const u=e1(e,i,s);if(n&&e!==u)throw new RangeError(iD(t,e,i,s,a));return u}function F3(t,e){const i=t[e];if(i===void 0)throw new TypeError(fS(e));return i}function hr(t){return t!==null&&/object|function/.test(typeof t)}function vo(t,e=Map){const i=new e;return(s,...n)=>{if(i.has(s))return i.get(s);const a=t(s,...n);return i.set(s,a),a}}function EC(t){return qf({name:t},1)}function qf(t,e){return ba(i=>({value:i,configurable:1,writable:!e}),t)}function pX(t){return ba(e=>({get:e,configurable:1}),t)}function wT(t){return{[Symbol.toStringTag]:{value:t,configurable:1}}}function rd(t,e){const i={};let s=t.length;for(const n of e)i[t[--s]]=n;return i}function ba(t,e,i){const s={};for(const n in e)s[n]=t(e[n],n,i);return s}function $0(t,e,i){const s={};for(let n=0;nt(...e,...i)}function IC(t){return t[0].toUpperCase()+t.substring(1)}function Zg(t){return t.slice().sort()}function Fy(t,e){return String(e).padStart(t,"0")}function lc(t,e){return Math.sign(t-e)}function e1(t,e,i){return Math.min(Math.max(t,e),i)}function tl(t,e){return[Math.floor(t/e),eg(t,e)]}function eg(t,e){return(t%e+e)%e}function _c(t,e){return[H0(t,e),TT(t,e)]}function H0(t,e){return Math.trunc(t/e)||0}function TT(t,e){return t%e||0}function D_(t){return Math.abs(t%1)===.5}function z3(t,e,i){let s=0,n=0;for(let c=0;c<=e;c++){const _=t[i[c]],w=va[c],S=Is/w,[A,P]=_c(_,S);s+=P*w,n+=A}const[a,u]=_c(s,Is);return[n+a,u]}function W0(t,e,i){const s={};for(let n=e;n>=0;n--){const a=va[n];s[i[n]]=H0(t,a),t=TT(t,a)}return s}function _X(t){return t===Di?xb:[]}function yX(t){return t===Di?Qg:[]}function bX(t){return t===Di?["year","day"]:[]}function vX(t){if(t!==void 0)return En(t)}function xX(t){if(t!==void 0)return ha(t)}function U3(t){if(t!==void 0)return q0(t)}function ha(t){return $3(q0(t))}function q0(t){return j3(jY(t))}function CC(t){if(t==null)throw new TypeError("Cannot be null or undefined");return t}function V3(t,e){if(e==null)throw new RangeError(fS(t));return e}function Sc(t){if(!hr(t))throw new TypeError(tD);return t}function X0(t,e,i=t){if(typeof e!==t)throw new TypeError(Jg(i,e));return e}function j3(t,e="number"){if(!Number.isInteger(t))throw new RangeError(aY(e,t));return t||0}function $3(t,e="number"){if(t<=0)throw new RangeError(lY(e,t));return t}function ST(t){if(typeof t=="symbol")throw new TypeError(fY);return String(t)}function Ny(t,e){return hr(t)?String(t):En(t,e)}function Z0(t){if(typeof t=="string")return BigInt(t);if(typeof t!="bigint")throw new TypeError(hY(t));return t}function H3(t,e="number"){if(typeof t=="bigint")throw new TypeError(uY(e));if(t=Number(t),!Number.isFinite(t))throw new RangeError(cY(e,t));return t}function Cr(t,e){return Math.trunc(H3(t,e))||0}function W3(t,e){return j3(H3(t,e),e)}function PC(t,e){return $3(Cr(t,e),e)}function ET(t,e){let[i,s]=_c(e,Is),n=t+i;const a=Math.sign(n);return a&&a===-Math.sign(s)&&(n-=a,s+=a*Is),[n,s]}function Xf(t,e,i=1){return ET(t[0]+e[0]*i,t[1]+e[1]*i)}function Zf(t,e){return ET(t[0],t[1]+e)}function Lo(t,e){return Xf(e,t,-1)}function eo(t,e){return lc(t[0],e[0])||lc(t[1],e[1])}function q3(t,e,i){return eo(t,e)===-1||eo(t,i)===1}function Y0(t,e=1){const i=BigInt(Is/e);return[Number(t/i),Number(t%i)*e]}function Eg(t,e=1){const i=Is/e,[s,n]=_c(t,i);return[s,n*e]}function X3(t,e=1){const[i,s]=t,n=Math.floor(s/e),a=Is/e;return BigInt(i)*BigInt(a)+BigInt(n)}function zo(t,e=1,i){const[s,n]=t,[a,u]=_c(n,e);return s*(Is/e)+(a+(i?u/e:0))}function AT(t,e,i=tl){const[s,n]=t,[a,u]=i(n,e);return[s*(Is/e)+a,u]}function IT(t,e){const i=t.formatToParts(e),s={};for(const n of i)s[n.type]=n.value;return s}function CT(t){return Xr(t,"isoYear",Mg,Pg,1),t.isoYear===Mg?Xr(t,"isoMonth",4,12,1):t.isoYear===Pg&&Xr(t,"isoMonth",1,9,1),t}function cc(t){return ll({...t,...xa,isoHour:12}),t}function ll(t){const e=Xr(t,"isoYear",Mg,Pg,1),i=e===Mg?1:e===Pg?-1:0;return i&&To(Pr({...t,isoDay:t.isoDay+i,isoNanosecond:t.isoNanosecond-i})),t}function To(t){if(!t||q3(t,KY,YY))throw new RangeError(mb);return t}function yc(t){return z3(t,5,Ea)[1]}function K0(t){const[e,i]=tl(t,Is);return[W0(i,5,Ea),e]}function Z3(t){return Y3(t)[0]}function Y3(t){return AT(t,Fo)}function Mr(t){return od(t.isoYear,t.isoMonth,t.isoDay,t.isoHour,t.isoMinute,t.isoSecond,t.isoMillisecond)}function Pr(t){const e=Mr(t);if(e!==void 0){const[i,s]=_c(e,Gr);return[i,s*cl+(t.isoMicrosecond||0)*eh+(t.isoNanosecond||0)]}}function PT(t,e){const[i,s]=K0(yc(t)-e);return To(Pr({...t,isoDay:t.isoDay+s,...i}))}function By(...t){return od(...t)/cD}function od(...t){const[e,i]=K3(...t),s=e.valueOf();if(!isNaN(s))return s-i*Gr}function K3(t,e=1,i=1,s=0,n=0,a=0,u=0){const c=t===Mg?1:t===Pg?-1:0,_=new Date;return _.setUTCHours(s,n,a,u),_.setUTCFullYear(t,e-1,i+c),[_,c]}function Xu(t,e){let[i,s]=Zf(t,e);s<0&&(s+=Is,i-=1);const[n,a]=tl(s,cl),[u,c]=tl(a,eh);return J0(i*Gr+n,u,c)}function J0(t,e=0,i=0){const s=Math.ceil(Math.max(0,Math.abs(t)-ZY)/Gr)*Math.sign(t),n=new Date(t-s*Gr);return rd(Tb,[n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()+s,n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds(),e,i])}function J3(t){return[t.isoYear,t.isoMonth,t.isoDay]}function G3(){return Xa}function MT(t,e){switch(e){case 2:return RT(t)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Q3(t){return RT(t)?366:365}function RT(t){return t%4==0&&(t%100!=0||t%400==0)}function eO(t){const[e,i]=K3(t.isoYear,t.isoMonth,t.isoDay);return eg(e.getUTCDay()-i,7)||7}function tO({isoYear:t}){return t<1?["bce",1-t]:["ce",t]}function wX(t){const e=Mr(t);if(eS<4?(S+2)%4:S)(_)),[u,w,c,_]}function tb(t,e=6,i){let s=DT(t=NT(t,$y));const n=tm(t,7);let a=em(t,e);return a=V3($y,a),s=FT(s,a,void 0,i),[a,s,n]}function kT(t){return SS(Vo(t))}function nO(t,e){return OT(Vo(t),e)}function OT(t,e=4){const i=oO(t);return[tm(t,4),...rO(em(t,e),i)]}function rO(t,e){return t!=null?[va[t],t<4?9-3*t:-1]:[e===void 0?1:10**(9-e),e]}function DT(t){const e=t[tg];return e===void 0?1:Cr(e,tg)}function FT(t,e,i,s){const n=s?Is:va[e+1];if(n){const a=va[e];if(n%((t=ko(tg,t,1,n/a-(s?0:1),1))*a))throw new RangeError(Jg(tg,t))}else t=ko(tg,t,1,i?10**9:1,1);return t}function oO(t){let e=t[$x];if(e!==void 0){if(typeof e!="number"){if(ST(e)==="auto")return;throw new RangeError(Jg($x,e))}e=ko($x,Math.floor(e),0,9,1)}return e}function Vo(t){return t===void 0?{}:Sc(t)}function NT(t,e){return typeof t=="string"?{[e]:t}:Sc(t)}function qn(t){if(t!==void 0){if(hr(t))return Object.assign(Object.create(null),t);throw new TypeError(tD)}}function ib(t,e){return t&&Object.assign(Object.create(null),t,{overflow:eK[e]})}function BT(t,e,i=9,s=0,n){let a=e[t];if(a===void 0)return n?s:void 0;if(a=ST(a),a==="auto")return n?s:null;let u=n1[a];if(u===void 0&&(u=qY[a]),u===void 0)throw new RangeError(rD(t,a,n1));return ko(t,u,s,i,1,yb),u}function Yu(t,e,i,s=0){const n=i[t];if(n===void 0)return s;const a=ST(n),u=e[a];if(u===void 0)throw new RangeError(rD(t,a,e));return u}function aO(t,e){if(e>t)throw new RangeError(DY)}function cr(t){return{branding:AS,epochNanoseconds:t}}function Rr(t,e,i){return{branding:Mc,calendar:i,timeZone:e,epochNanoseconds:t}}function $n(t,e=t.calendar){return{branding:_d,calendar:e,...wo(vD,t)}}function Hn(t,e=t.calendar){return{branding:md,calendar:e,...wo(xS,t)}}function Lu(t,e=t.calendar){return{branding:Rg,calendar:e,...wo(xS,t)}}function Ly(t,e=t.calendar){return{branding:kg,calendar:e,...wo(xS,t)}}function Ta(t){return{branding:ES,...wo(bD,t)}}function pn(t){return{branding:IS,sign:Ec(t),...wo(_S,t)}}function SX(t){return Z3(t.epochNanoseconds)}function LT(t){return AT(t.epochNanoseconds,cl)[0]}function EX(t){return X3(t.epochNanoseconds,eh)}function AX(t){return X3(t.epochNanoseconds)}function lO(t){return t.epochNanoseconds}function kr(t){return typeof t=="string"?t:En(t.id)}function ld(t,e){return t===e||kr(t)===kr(e)}function IX(t,e,i,s,n){const a=zu(s),[u,c]=((W,ee)=>{const G=ee((W=NT(W,a1))[wD]);let se=aK(W);return se=V3(a1,se),[se,G]})(n,t);if(Ig(Math.max(u,a),c))return RC(s,u);if(!c)throw new RangeError(_b);const[_,w,S]=ab(e,i,c),A=XT(S),P=lb(S),D=ZT(S),U=P(w,_,s),L=D(w,_,U,u);return Ig(u,c)?RC(L,u):((W,ee,G,se,fe,Se,Te)=>{const Fe=Ec(W),[Ne,Oe]=zT(se,bS(G,W),G,Fe,fe,Se,Te),Je=UT(ee,Ne,Oe);return W[hs[G]]+Je*Fe})(L,A(U),u,w,_,A,P)}function RC(t,e){return zo(Wn(t),va[e],1)}function zT(t,e,i,s,n,a,u){const c=hs[i],_={...e,[c]:e[c]+s},w=u(t,n,e),S=u(t,n,_);return[a(w),a(S)]}function UT(t,e,i){const s=zo(Lo(e,i));if(!s)throw new RangeError(Gg);return zo(Lo(e,t))/s}function CX(t,e){const[i,s,n]=tb(e,5,1);return cr(nb(t.epochNanoseconds,i,s,n,1))}function PX(t,e,i){let{epochNanoseconds:s,timeZone:n,calendar:a}=e;const[u,c,_]=tb(i);if(u===0&&c===1)return e;const w=t(n);if(u===6)s=((S,A,P,D)=>{const U=to(P,A),[L,W]=S(U),ee=P.epochNanoseconds,G=xo(A,L),se=xo(A,W);if(q3(ee,G,se))throw new RangeError(Gg);return dO(UT(ee,G,se),D)?se:G})(hO,w,e,_);else{const S=w.getOffsetNanosecondsFor(s);s=Ku(w,cO(Xu(s,S),u,c,_),S,2,0,1)}return Rr(s,n,a)}function MX(t,e){return $n(cO(t,...tb(e)),t.calendar)}function RX(t,e){const[i,s,n]=tb(e,5);var a;return Ta((a=n,VT(t,Yg(i,s),a)[0]))}function kX(t,e){const i=t(e.timeZone),s=to(e,i),[n,a]=hO(s),u=zo(Lo(xo(i,n),xo(i,a)),vb,1);if(u<=0)throw new RangeError(Gg);return u}function OX(t,e){const{timeZone:i,calendar:s}=e,n=((a,u,c)=>xo(u,a(to(c,u))))(fO,t(i),e);return Rr(n,i,s)}function cO(t,e,i,s){return uO(t,Yg(e,i),s)}function uO(t,e,i){const[s,n]=VT(t,e,i);return ll({...Ju(t,n),...s})}function VT(t,e,i){return K0(bc(yc(t),e,i))}function zy(t){return bc(t,bb,7)}function Yg(t,e){return va[t]*e}function hO(t){const e=fO(t);return[e,Ju(e,1)]}function fO(t){return XY(6,t)}function DX(t,e,i){const s=Math.min(zu(t),6);return hd(rb(Wn(t,s),e,i),s)}function sb(t,e,i,s,n,a,u,c,_,w){if(s===0&&n===1)return t;const S=Ig(s,c)?cb(c)&&s<6&&i>=6?NX:FX:BX;let[A,P,D]=S(t,e,i,s,n,a,u,c,_,w);return D&&s!==7&&(A=((U,L,W,ee,G,se,fe,Se)=>{const Te=Ec(U);for(let Fe=ee+1;Fe<=W;Fe++){if(Fe===7&&W!==7)continue;const Ne=bS(Fe,U);Ne[hs[Fe]]+=Te;const Oe=zo(Lo(fe(Se(G,se,Ne)),L));if(Oe&&Math.sign(Oe)!==Te)break;U=Ne}return U})(A,P,i,Math.max(6,s),u,c,_,w)),A}function nb(t,e,i,s,n){if(e===6){const a=(u=>u[0]+u[1]/Is)(t);return[bc(a,i,s),0]}return rb(t,Yg(e,i),s,n)}function rb(t,e,i,s){let[n,a]=t;s&&a<0&&(a+=Is,n-=1);const[u,c]=tl(bc(a,e,i),Is);return ET(n+u,c)}function bc(t,e,i){return dO(t/e,i)*e}function dO(t,e){return hK[e](t)}function FX(t,e,i,s,n,a){const u=Ec(t),c=Wn(t),_=nb(c,s,n,a),w=Lo(c,_),S=Math.sign(_[0]-c[0])===u,A=hd(_,Math.min(i,6));return[{...t,...A},Xf(e,w),S]}function NX(t,e,i,s,n,a,u,c,_,w){const S=Ec(t),A=zo(Wn(t,5)),P=Yg(s,n);let D=bc(A,P,a);const[U,L]=zT(u,{...t,...yS},6,S,c,_,w),W=D-zo(Lo(U,L));let ee=0;W&&Math.sign(W)!==S?e=Zf(U,D):(ee+=S,D=bc(W,P,a),e=Zf(L,D));const G=ub(D);return[{...t,...G,days:t.days+ee},e,!!ee]}function BX(t,e,i,s,n,a,u,c,_,w){const S=Ec(t),A=hs[s],P=bS(s,t);s===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const D=H0(t[A],n)*n;P[A]=D;const[U,L]=zT(u,P,s,n*S,c,_,w),W=D+UT(e,U,L)*S*n,ee=bc(W,n,a),G=Math.sign(ee-W)===S;return P[A]=ee,[P,G?L:U,G]}function kC(t,e,i,s){const[n,a,u,c]=(w=>{const S=OT(w=Vo(w));return[w.timeZone,...S]})(s),_=n!==void 0;return((w,S,A,P,D,U)=>{A=rb(A,D,P,1);const L=S.getOffsetNanosecondsFor(A);return jT(Xu(A,L),U)+(w?cd(zy(L)):"Z")})(_,e(_?t(n):th),i.epochNanoseconds,a,u,c)}function OC(t,e,i){const[s,n,a,u,c,_]=(w=>{w=Vo(w);const S=SS(w),A=oO(w),P=uK(w),D=tm(w,4),U=em(w,4);return[S,cK(w),P,D,...rO(U,A)]})(i);return((w,S,A,P,D,U,L,W,ee,G)=>{P=rb(P,ee,W,1);const se=w(A).getOffsetNanosecondsFor(P);return jT(Xu(P,se),G)+cd(zy(se),L)+((fe,Se)=>Se!==1?"["+(Se===2?"!":"")+kr(fe)+"]":"")(A,U)+$T(S,D)})(t,e.calendar,e.timeZone,e.epochNanoseconds,s,n,a,u,c,_)}function DC(t,e){const[i,s,n,a]=(w=>(w=Vo(w),[SS(w),...OT(w)]))(e);return u=t.calendar,c=i,_=a,jT(uO(t,n,s),_)+$T(u,c);var u,c,_}function FC(t,e){return i=t.calendar,s=t,n=kT(e),Uy(s)+$T(i,n);var i,s,n}function NC(t,e){return pO(t.calendar,gO,t,kT(e))}function BC(t,e){return pO(t.calendar,LX,t,kT(e))}function LC(t,e){const[i,s,n]=nO(e);return a=n,mO(VT(t,s,i)[0],a);var a}function zx(t,e){const[i,s,n]=nO(e,3);return s>1&&(t={...t,...DX(t,s,i)}),((a,u)=>{const{sign:c}=a,_=c===-1?Or(a):a,{hours:w,minutes:S}=_,[A,P]=AT(Wn(_,3),Fo,_c);wO(A);const D=HT(P,u),U=u>=0||!c||D;return(c<0?"-":"")+"P"+zC({Y:cu(_.years),M:cu(_.months),W:cu(_.weeks),D:cu(_.days)})+(w||S||A||U?"T"+zC({H:cu(w),M:cu(S),S:cu(A,U)+D}):"")})(t,n)}function pO(t,e,i,s){const n=kr(t),a=s>1||s===0&&n!==Di;return s===1?n===Di?e(i):Uy(i):a?Uy(i)+_O(n,s===2):e(i)}function zC(t){const e=[];for(const i in t){const s=t[i];s&&e.push(s,i)}return e.join("")}function jT(t,e){return Uy(t)+"T"+mO(t,e)}function Uy(t){return gO(t)+"-"+Do(t.isoDay)}function gO(t){const{isoYear:e}=t;return(e<0||e>9999?yO(e)+Fy(6,Math.abs(e)):Fy(4,e))+"-"+Do(t.isoMonth)}function LX(t){return Do(t.isoMonth)+"-"+Do(t.isoDay)}function mO(t,e){const i=[Do(t.isoHour),Do(t.isoMinute)];return e!==-1&&i.push(Do(t.isoSecond)+((s,n,a,u)=>HT(s*cl+n*eh+a,u))(t.isoMillisecond,t.isoMicrosecond,t.isoNanosecond,e)),i.join(":")}function cd(t,e=0){if(e===1)return"";const[i,s]=tl(Math.abs(t),vb),[n,a]=tl(s,bb),[u,c]=tl(a,Fo);return yO(t)+Do(i)+":"+Do(n)+(u||c?":"+Do(u)+HT(c):"")}function $T(t,e){if(e!==1){const i=kr(t);if(e>1||e===0&&i!==Di)return _O(i,e===2)}return""}function _O(t,e){return"["+(e?"!":"")+"u-ca="+t+"]"}function HT(t,e){let i=Fy(9,t);return i=e===void 0?i.replace(pK,""):i.slice(0,e),i?"."+i:""}function yO(t){return t<0?"-":"+"}function cu(t,e){return t||e?t.toLocaleString("fullwide",{useGrouping:0}):""}function zX(t,e){const{epochNanoseconds:i}=t,s=(e.getOffsetNanosecondsFor?e:e(t.timeZone)).getOffsetNanosecondsFor(i),n=Xu(i,s);return{calendar:t.calendar,...n,offsetNanoseconds:s}}function UX(t,e){const i=to(e,t);return{calendar:e.calendar,...wo(vD,i),offset:cd(i.offsetNanoseconds),timeZone:e.timeZone}}function Ku(t,e,i,s=0,n=0,a,u){if(i!==void 0&&s===1&&(s===1||u))return PT(e,i);const c=t.getPossibleInstantsFor(e);if(i!==void 0&&s!==3){const _=((w,S,A,P)=>{const D=Pr(S);P&&(A=zy(A));for(const U of w){let L=zo(Lo(U,D));if(P&&(L=zy(L)),L===A)return U}})(c,e,i,a);if(_!==void 0)return _;if(s===0)throw new RangeError(CY)}return u?Pr(e):xo(t,e,n,c)}function xo(t,e,i=0,s=t.getPossibleInstantsFor(e)){if(s.length===1)return s[0];if(i===1)throw new RangeError(PY);if(s.length)return s[i===3?1:0];const n=Pr(e),a=((c,_)=>{const w=c.getOffsetNanosecondsFor(Zf(_,-Is));return vO(c.getOffsetNanosecondsFor(Zf(_,Is))-w)})(t,n),u=a*(i===2?-1:1);return(s=t.getPossibleInstantsFor(Xu(n,u)))[i===2?0:s.length-1]}function bO(t){if(Math.abs(t)>=Is)throw new RangeError(AY);return t}function vO(t){if(t>Is)throw new RangeError(IY);return t}function UC(t,e,i){return cr(To(Xf(e.epochNanoseconds,(s=>{if(TO(s))throw new RangeError(kY);return Wn(s,5)})(t?Or(i):i))))}function VC(t,e,i,s,n,a=Object.create(null)){const u=e(s.timeZone),c=t(s.calendar);return{...s,...WT(u,c,s,i?Or(n):n,a)}}function jC(t,e,i,s,n=Object.create(null)){const{calendar:a}=i;return $n(qT(t(a),i,e?Or(s):s,n),a)}function $C(t,e,i,s,n){const{calendar:a}=i;return Hn(ob(t(a),i,e?Or(s):s,n),a)}function HC(t,e,i,s,n=Object.create(null)){const a=i.calendar,u=t(a);let c=Ag(u,i);e&&(s=YT(s)),s.sign<0&&(c=u.dateAdd(c,{...ur,months:1}),c=Ju(c,-1));const _=u.dateAdd(c,s,n);return Lu(Ag(u,_),a)}function WC(t,e,i){return Ta(xO(e,t?Or(i):i)[0])}function WT(t,e,i,s,n){const a=Wn(s,5);let u=i.epochNanoseconds;if(TO(s)){const c=to(i,t);u=Xf(xo(t,{...ob(e,c,{...s,...yS},n),...wo(Ea,c)}),a)}else u=Xf(u,a),ss(n);return{epochNanoseconds:To(u)}}function qT(t,e,i,s){const[n,a]=xO(e,i);return ll({...ob(t,e,{...i,...yS,days:i.days+a},s),...n})}function ob(t,e,i,s){if(i.years||i.months||i.weeks)return t.dateAdd(e,i,s);ss(s);const n=i.days+Wn(i,5)[0];return n?cc(Ju(e,n)):e}function Ag(t,e,i=1){return Ju(e,i-t.day(e))}function xO(t,e){const[i,s]=Wn(e,5),[n,a]=K0(yc(t)+s);return[n,i+a]}function Ju(t,e){return e?{...t,...J0(Mr(t)+e*Gr)}:t}function ab(t,e,i){const s=t(i.calendar);return cb(i)?[i,s,e(i.timeZone)]:[{...i,...xa},s]}function XT(t){return t?lO:Pr}function lb(t){return t?Pi(WT,t):qT}function ZT(t){return t?Pi(uZ,t):hZ}function cb(t){return t&&t.epochNanoseconds}function Ig(t,e){return t<=6-(cb(e)?1:0)}function qC(t,e,i,s,n,a,u){const c=t(Vo(u).relativeTo),_=Math.max(zu(n),zu(a));if(Ig(_,c))return pn(ud(((L,W,ee,G)=>{const se=Xf(Wn(L),Wn(W),G?-1:1);if(!Number.isFinite(se[0]))throw new RangeError(mb);return{...ur,...hd(se,ee)}})(n,a,_,s)));if(!c)throw new RangeError(_b);s&&(a=Or(a));const[w,S,A]=ab(e,i,c),P=lb(A),D=ZT(A),U=P(S,w,n);return pn(D(S,w,P(S,U,a),_))}function VX(t,e,i,s,n){const a=zu(s),[u,c,_,w,S]=((Te,Fe,Ne)=>{Te=NT(Te,$y);let Oe=TS(Te);const Je=Ne(Te[wD]);let Xe=DT(Te);const qe=tm(Te,7);let ht=em(Te);if(Oe===void 0&&ht===void 0)throw new RangeError(OY);return ht==null&&(ht=0),Oe==null&&(Oe=Math.max(ht,Fe)),aO(Oe,ht),Xe=FT(Xe,ht,1),[Oe,ht,Xe,qe,Je]})(n,a,t),A=Math.max(a,u);if(!cb(S)&&A<=6)return pn(ud(((Te,Fe,Ne,Oe,Je)=>{const Xe=nb(Wn(Te),Ne,Oe,Je);return{...ur,...hd(Xe,Fe)}})(s,u,c,_,w)));if(!S)throw new RangeError(_b);const[P,D,U]=ab(e,i,S),L=XT(U),W=lb(U),ee=ZT(U),G=W(D,P,s);let se=ee(D,P,G,u);const fe=s.sign,Se=Ec(se);if(fe&&Se&&fe!==Se)throw new RangeError(Gg);return Se&&(se=sb(se,L(G),u,c,_,w,D,P,L,W)),pn(se)}function jX(t){return t.sign===-1?YT(t):t}function YT(t){return pn(Or(t))}function Or(t){const e={};for(const i of hs)e[i]=-1*t[i]||0;return e}function $X(t){return!t.sign}function Ec(t,e=hs){let i=0;for(const s of e){const n=Math.sign(t[s]);if(n){if(i&&i!==n)throw new RangeError(RY);i=n}}return i}function ud(t){for(const e of WY)ko(e,t[e],-aP,aP,1);return wO(zo(Wn(t),Fo)),t}function wO(t){if(!Number.isSafeInteger(t))throw new RangeError(MY)}function Wn(t,e=6){return z3(t,e,hs)}function hd(t,e=6){const[i,s]=t,n=W0(s,e,hs);if(n[hs[e]]+=i*(Is/va[e]),!Number.isFinite(n[hs[e]]))throw new RangeError(mb);return n}function ub(t,e=5){return W0(t,e,hs)}function TO(t){return!!Ec(t,yD)}function zu(t){let e=9;for(;e>0&&!t[hs[e]];e--);return e}function HX(t,e){return[t,e]}function XC(t){const e=Math.floor(t/G_)*G_;return[e,e+G_]}function WX(t){const e=Ac(t=Ny(t));if(!e)throw new RangeError(Jr(t));let i;if(e.m)i=0;else{if(!e.offset)throw new RangeError(Jr(t));i=fd(e.offset)}return e.timeZone&&eS(e.timeZone,1),cr(PT(G0(e),i))}function qX(t){const e=Ac(En(t));if(!e)throw new RangeError(Jr(t));if(e.timeZone)return SO(e,e.offset?fd(e.offset):void 0);if(e.m)throw new RangeError(Jr(t));return AO(e)}function XX(t,e){const i=Ac(En(t));if(!i||!i.timeZone)throw new RangeError(Jr(t));const{offset:s}=i,n=s?fd(s):void 0,[,a,u]=eb(e);return SO(i,n,a,u)}function fd(t){const e=eS(t);if(e===void 0)throw new RangeError(Jr(t));return e}function ZX(t){const e=Ac(En(t));if(!e||e.m)throw new RangeError(Jr(t));return $n(EO(e))}function KT(t){const e=Ac(En(t));if(!e||e.m)throw new RangeError(Jr(t));return Hn(e.p?EO(e):AO(e))}function YX(t,e){const i=GT(En(e));if(i)return JT(i),Lu(CT(Zu(i)));const s=KT(e);return Lu(Ag(t(s.calendar),s))}function JT(t){if(t.calendar!==Di)throw new RangeError(il(t.calendar))}function KX(t,e){const i=QT(En(e));if(i)return JT(i),Ly(Zu(i));const s=KT(e),{calendar:n}=s,a=t(n),[u,c,_]=a.h(s),[w,S]=a.I(u,c),[A,P]=a.N(w,S,_);return Ly(cc(a.P(A,P,_)),n)}function JX(t){let e,i=(s=>{const n=xK.exec(s);return n?(hb(n[10]),PO(n)):void 0})(En(t));if(!i){if(i=Ac(t),!i)throw new RangeError(Jr(t));if(!i.p)throw new RangeError(Jr(t));if(i.m)throw new RangeError(il("Z"));JT(i)}if((e=GT(t))&&MC(e))throw new RangeError(Jr(t));if((e=QT(t))&&MC(e))throw new RangeError(Jr(t));return Ta(Q0(i,1))}function GX(t){const e=(i=>{const s=SK.exec(i);return s?(n=>{function a(S,A,P){let D=0,U=0;if(P&&([D,_]=tl(_,va[P])),S!==void 0){if(c)throw new RangeError(il(S));U=(L=>{const W=parseInt(L);if(!Number.isFinite(W))throw new RangeError(il(L));return W})(S),u=1,A&&(_=tS(A)*(va[P]/Fo),c=1)}return D+U}let u=0,c=0,_=0,w={...rd(hs,[a(n[2]),a(n[3]),a(n[4]),a(n[5]),a(n[6],n[7],5),a(n[8],n[9],4),a(n[10],n[11],3)]),...W0(_,2,hs)};if(!u)throw new RangeError(nD(hs));return iS(n[1])<0&&(w=Or(w)),w})(s):void 0})(En(t));if(!e)throw new RangeError(Jr(t));return pn(ud(e))}function QX(t){const e=Ac(t)||GT(t)||QT(t);return e?e.calendar:t}function eZ(t){const e=Ac(t);return e&&(e.timeZone||e.m&&th||e.offset)||t}function SO(t,e,i=0,s=0){const n=sS(t.timeZone),a=CS(n);return Rr(Ku(a,G0(t),e,i,s,!a.v,t.m),n,gb(t.calendar))}function EO(t){return IO(ll(G0(t)))}function AO(t){return IO(cc(Zu(t)))}function IO(t){return{...t,calendar:gb(t.calendar)}}function Ac(t){const e=vK.exec(t);return e?(i=>{const s=i[10],n=(s||"").toUpperCase()==="Z";return{isoYear:CO(i),isoMonth:parseInt(i[4]),isoDay:parseInt(i[5]),...PO(i.slice(5)),...hb(i[16]),p:!!i[6],m:n,offset:n?void 0:s}})(e):void 0}function GT(t){const e=yK.exec(t);return e?(i=>({isoYear:CO(i),isoMonth:parseInt(i[4]),isoDay:1,...hb(i[5])}))(e):void 0}function QT(t){const e=bK.exec(t);return e?(i=>({isoYear:Kf,isoMonth:parseInt(i[1]),isoDay:parseInt(i[2]),...hb(i[3])}))(e):void 0}function eS(t,e){const i=wK.exec(t);return i?((s,n)=>{const a=s[4]||s[5];if(n&&a)throw new RangeError(il(a));return bO((Df(s[2])*vb+Df(s[3])*bb+Df(s[4])*Fo+tS(s[5]||""))*iS(s[1]))})(i,e):void 0}function CO(t){const e=iS(t[1]),i=parseInt(t[2]||t[3]);if(e<0&&!i)throw new RangeError(il(-0));return e*i}function PO(t){const e=Df(t[3]);return{...K0(tS(t[4]||""))[0],isoHour:Df(t[1]),isoMinute:Df(t[2]),isoSecond:e===60?59:e}}function hb(t){let e,i;const s=[];if(t.replace(TK,(n,a,u)=>{const c=!!a,[_,w]=u.split("=").reverse();if(w){if(w==="u-ca")s.push(_),e||(e=c);else if(c||/[A-Z]/.test(w))throw new RangeError(il(n))}else{if(i)throw new RangeError(il(n));i=_}return""}),s.length>1&&e)throw new RangeError(il(t));return{timeZone:i,calendar:s[0]||Di}}function tS(t){return parseInt(t.padEnd(9,"0"))}function dd(t){return new RegExp(`^${t}$`,"i")}function iS(t){return t&&t!=="+"?-1:1}function Df(t){return t===void 0?0:parseInt(t)}function tZ(t){return sS(En(t))}function sS(t){const e=nS(t);return typeof e=="number"?cd(e):e?(i=>{if(AK.test(i))throw new RangeError(EY);return i.toLowerCase().split("/").map((s,n)=>(s.length<=3||/\d/.test(s))&&!/etc|yap/.test(s)?s.toUpperCase():s.replace(/baja|dumont|[a-z]+/g,(a,u)=>a.length<=2&&!n||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!u?IC(a).replace(/island|noronha|murdo|rivadavia|urville/,IC):a)).join("/")})(t):th}function ZC(t){const e=nS(t);return typeof e=="number"?e:e?e.resolvedOptions().timeZone:th}function nS(t){const e=eS(t=t.toUpperCase(),1);return e!==void 0?e:t!==th?EK(t):void 0}function MO(t,e){return eo(t.epochNanoseconds,e.epochNanoseconds)}function RO(t,e){return eo(t.epochNanoseconds,e.epochNanoseconds)}function iZ(t,e,i,s,n,a){const u=t(Vo(a).relativeTo),c=Math.max(zu(s),zu(n));if(B3(hs,s,n))return 0;if(Ig(c,u))return eo(Wn(s),Wn(n));if(!u)throw new RangeError(_b);const[_,w,S]=ab(e,i,u),A=XT(S),P=lb(S);return eo(A(P(w,_,s)),A(P(w,_,n)))}function kO(t,e){return pd(t,e)||rS(t,e)}function pd(t,e){return lc(Mr(t),Mr(e))}function rS(t,e){return lc(yc(t),yc(e))}function sZ(t,e){return!MO(t,e)}function nZ(t,e){return!RO(t,e)&&!!oS(t.timeZone,e.timeZone)&&ld(t.calendar,e.calendar)}function rZ(t,e){return!kO(t,e)&&ld(t.calendar,e.calendar)}function oZ(t,e){return!pd(t,e)&&ld(t.calendar,e.calendar)}function aZ(t,e){return!pd(t,e)&&ld(t.calendar,e.calendar)}function lZ(t,e){return!pd(t,e)&&ld(t.calendar,e.calendar)}function cZ(t,e){return!rS(t,e)}function oS(t,e){if(t===e)return 1;const i=kr(t),s=kr(e);if(i===s)return 1;try{return ZC(i)===ZC(s)}catch{}}function YC(t,e,i,s){const n=ad(t,qn(s),3,5),a=fb(e.epochNanoseconds,i.epochNanoseconds,...n);return pn(t?Or(a):a)}function KC(t,e,i,s,n,a){const u=pb(s.calendar,n.calendar),c=qn(a),[_,w,S,A]=ad(i,c,5),P=s.epochNanoseconds,D=n.epochNanoseconds,U=eo(D,P);let L;if(U)if(_<6)L=fb(P,D,_,w,S,A);else{const W=e(((G,se)=>{if(!oS(G,se))throw new RangeError(aD);return G})(s.timeZone,n.timeZone)),ee=t(u);L=DO(ee,W,s,n,U,_,c),L=sb(L,D,_,w,S,A,ee,s,lO,Pi(WT,W))}else L=ur;return pn(i?Or(L):L)}function JC(t,e,i,s,n){const a=pb(i.calendar,s.calendar),u=qn(n),[c,_,w,S]=ad(e,u,6),A=Pr(i),P=Pr(s),D=eo(P,A);let U;if(D)if(c<=6)U=fb(A,P,c,_,w,S);else{const L=t(a);U=FO(L,i,s,D,c,u),U=sb(U,P,c,_,w,S,L,i,Pr,qT)}else U=ur;return pn(e?Or(U):U)}function GC(t,e,i,s,n){const a=pb(i.calendar,s.calendar),u=qn(n);return OO(e,()=>t(a),i,s,...ad(e,u,6,9,6),u)}function QC(t,e,i,s,n){const a=pb(i.calendar,s.calendar),u=qn(n),c=ad(e,u,9,9,8),_=t(a);return OO(e,()=>_,Ag(_,i),Ag(_,s),...c,u)}function OO(t,e,i,s,n,a,u,c,_){const w=Pr(i),S=Pr(s);let A;if(eo(S,w))if(n===6)A=fb(w,S,n,a,u,c);else{const P=e();A=P.dateUntil(i,s,n,_),a===6&&u===1||(A=sb(A,S,n,a,u,c,P,i,Pr,ob))}else A=ur;return pn(t?Or(A):A)}function eP(t,e,i,s){const n=qn(s),[a,u,c,_]=ad(t,n,5,5),w=bc(aS(e,i),Yg(u,c),_),S={...ur,...ub(w,a)};return pn(t?Or(S):S)}function uZ(t,e,i,s,n,a){const u=eo(s.epochNanoseconds,i.epochNanoseconds);return u?n<6?NO(i.epochNanoseconds,s.epochNanoseconds,n):DO(e,t,i,s,u,n,a):ur}function hZ(t,e,i,s,n){const a=Pr(e),u=Pr(i),c=eo(u,a);return c?s<=6?NO(a,u,s):FO(t,e,i,c,s,n):ur}function DO(t,e,i,s,n,a,u){const[c,_,w]=((P,D,U,L)=>{function W(){return Fe={...Ju(se,Se++*-L),...G},Ne=xo(P,Fe),eo(fe,Ne)===-L}const ee=to(D,P),G=wo(Ea,ee),se=to(U,P),fe=U.epochNanoseconds;let Se=0;const Te=aS(ee,se);let Fe,Ne;if(Math.sign(Te)===-L&&Se++,W()&&(L===-1||W()))throw new RangeError(Gg);const Oe=zo(Lo(Ne,fe));return[ee,Fe,Oe]})(e,i,s,n);var S,A;return{...a===6?(S=c,A=_,{...ur,days:BO(S,A)}):t.dateUntil(c,_,a,u),...ub(w)}}function FO(t,e,i,s,n,a){const[u,c,_]=((w,S,A)=>{let P=S,D=aS(w,S);return Math.sign(D)===-A&&(P=Ju(S,-A),D+=Is*A),[w,P,D]})(e,i,s);return{...t.dateUntil(u,c,n,a),...ub(_)}}function fb(t,e,i,s,n,a){return{...ur,...hd(nb(Lo(t,e),s,n,a),i)}}function NO(t,e,i){return{...ur,...hd(Lo(t,e),i)}}function BO(t,e){return db(Mr(t),Mr(e))}function db(t,e){return Math.trunc((e-t)/Gr)}function aS(t,e){return yc(e)-yc(t)}function pb(t,e){if(!ld(t,e))throw new RangeError(dS);return t}function fZ(t){function e(n){return((a,u)=>({...LO(a,u),F:a.month,day:parseInt(a.day)}))(IT(i,n),s)}const i=kS(t),s=Vy(t);return{id:t,O:dZ(e),B:pZ(e)}}function dZ(t){return vo(e=>{const i=Mr(e);return t(i)},WeakMap)}function pZ(t){const e=t(0).year-JY;return vo(i=>{let s,n=od(i-e);const a=[],u=[];do n+=400*Gr;while((s=t(n)).year<=i);do n+=(1-s.day)*Gr,s.year===i&&(a.push(n),u.push(s.F)),n-=Gr;while((s=t(n)).year>=i);return{k:a.reverse(),C:lD(u.reverse())}})}function LO(t,e){let i,s,n=zO(t);if(t.era){const a=_D[e];a!==void 0&&(i=e==="islamic"?"ah":t.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),i==="bc"||i==="b"?i="bce":i!=="ad"&&i!=="a"||(i="ce"),s=n,n=$O(s,a[i]||0))}return{era:i,eraYear:s,year:n}}function zO(t){return parseInt(t.relatedYear||t.year)}function t1(t){const{year:e,F:i,day:s}=this.O(t),{C:n}=this.B(e);return[e,n[i]+1,s]}function Cg(t,e=1,i=1){return this.B(t).k[e-1]+(i-1)*Gr}function F_(t){const e=iP(this,t),i=iP(this,t-1),s=e.length;if(s>i.length){const n=HO(this);if(n<0)return-n;for(let a=0;ai.length&&(s=1,n=this.B(t+1).k),db(i[e-1],n[s-1])}function B_(t){return this.B(t).k.length}function iP(t,e){return Object.keys(t.B(e).C)}function gZ(t){return gb(En(t))}function gb(t){if((t=t.toLowerCase())!==Di&&t!==wb&&Vy(t)!==Vy(kS(t).resolvedOptions().calendar))throw new RangeError(SY(t));return t}function Vy(t){return t==="islamicc"&&(t="islamic"),t.split("-")[0]}function UO(t){return this.R(t)[0]}function VO(t){return this.R(t)[1]}function lS(t){const[e]=this.h(t);return db(this.q(e),Mr(t))+1}function jO(t){const e=CK.exec(t);if(!e)throw new RangeError(xY(t));return[parseInt(e[1]),!!e[2]]}function jy(t,e,i){return t+(e||i&&t>=i?1:0)}function i1(t,e){return t-(e&&t>=e?1:0)}function $O(t,e){return(e+t)*(Math.sign(e)||1)||0}function s1(t){return _D[WO(t)]}function HO(t){return UY[WO(t)]}function WO(t){return Vy(t.id||Di)}function mZ(t,e,i,s){const n=Ic(i,s,Sa,[],dD);if(n.timeZone!==void 0){const a=i.dateFromFields(n),u=Gu(n),c=t(n.timeZone);return{epochNanoseconds:Ku(e(c),{...a,...u},n.offset!==void 0?fd(n.offset):void 0),timeZone:c}}return{...i.dateFromFields(n),...xa}}function _Z(t,e,i,s,n,a){const u=Ic(i,n,Sa,hD,dD),c=t(u.timeZone),[_,w,S]=eb(a),A=i.dateFromFields(u,ib(a,_)),P=Gu(u,_);return Rr(Ku(e(c),{...A,...P},u.offset!==void 0?fd(u.offset):void 0,w,S),c,s)}function yZ(t,e,i){const s=Ic(t,e,Sa,[],Pc),n=ss(i);return $n(ll({...t.dateFromFields(s,ib(i,n)),...Gu(s,n)}))}function qO(t,e,i,s=[]){const n=Ic(t,e,Sa,s);return t.dateFromFields(n,i)}function XO(t,e,i,s){const n=Ic(t,e,mS,s);return t.yearMonthFromFields(n,i)}function ZO(t,e,i,s,n=[]){const a=Ic(t,i,Sa,n);return e&&a.month!==void 0&&a.monthCode===void 0&&a.year===void 0&&(a.year=Kf),t.monthDayFromFields(a,s)}function bZ(t,e){const i=ss(e);return Ta(Gu(ga(t,r1,[],1),i))}function vZ(t){const e=ga(t,_S);return pn(ud({...ur,...e}))}function Ic(t,e,i,s=[],n=[]){return ga(e,[...t.fields(i),...n].sort(),s)}function ga(t,e,i,s=!i){const n={};let a,u=0;for(const c of e){if(c===a)throw new RangeError(dY(c));if(c==="constructor"||c==="__proto__")throw new RangeError(sD(c));let _=t[c];if(_!==void 0)u=1,lP[c]&&(_=lP[c](_,c)),n[c]=_;else if(i){if(i.includes(c))throw new TypeError(fS(c));n[c]=mD[c]}a=c}if(s&&!u)throw new TypeError(nD(e));return n}function Gu(t,e){return Q0(kK({...mD,...t}),e)}function xZ(t,e,i,s,n,a){const u=qn(a),{calendar:c,timeZone:_}=i;return Rr(((w,S,A,P,D)=>{const U=Kg(w,A,P,Sa,fD,uD),[L,W,ee]=eb(D,2);return Ku(S,{...w.dateFromFields(U,ib(D,L)),...Gu(U,L)},fd(U.offset),W,ee)})(t(c),e(_),s,n,u),_,c)}function wZ(t,e,i,s,n){const a=qn(n);return $n(((u,c,_,w)=>{const S=Kg(u,c,_,Sa,Pc),A=ss(w);return ll({...u.dateFromFields(S,ib(w,A)),...Gu(S,A)})})(t(e.calendar),i,s,a))}function TZ(t,e,i,s,n){const a=qn(n);return((u,c,_,w)=>{const S=Kg(u,c,_,Sa);return u.dateFromFields(S,w)})(t(e.calendar),i,s,a)}function SZ(t,e,i,s,n){const a=qn(n);return Lu(((u,c,_,w)=>{const S=Kg(u,c,_,mS);return u.yearMonthFromFields(S,w)})(t(e.calendar),i,s,a))}function EZ(t,e,i,s,n){const a=qn(n);return((u,c,_,w)=>{const S=Kg(u,c,_,Sa);return u.monthDayFromFields(S,w)})(t(e.calendar),i,s,a)}function AZ(t,e,i){return Ta(((s,n,a)=>{const u=ss(a);return Gu({...wo(r1,s),...ga(n,r1)},u)})(t,e,i))}function IZ(t,e){return pn((i=t,s=e,ud({...i,...ga(s,_S)})));var i,s}function Kg(t,e,i,s,n=[],a=[]){const u=[...t.fields(s),...n].sort();let c=ga(e,u,a);const _=ga(i,u);return c=t.mergeFields(c,_),ga(c,u,[])}function cS(t,e){const i=Ic(t,e,gD);return t.monthDayFromFields(i)}function uS(t,e,i){const s=Ic(t,e,pD);return t.yearMonthFromFields(s,i)}function YO(t,e,i,s,n){e=wo(i=t.fields(i),e),s=ga(s,n=t.fields(n),[]);let a=t.mergeFields(e,s);return a=ga(a,[...i,...n].sort(),[]),t.dateFromFields(a)}function Ux(t,e){let{era:i,eraYear:s,year:n}=e;const a=s1(t);if(i!==void 0||s!==void 0){if(i===void 0||s===void 0)throw new TypeError(_Y);if(!a)throw new RangeError(mY);const u=a[i];if(u===void 0)throw new RangeError(bY(i));const c=$O(s,u);if(n!==void 0&&n!==c)throw new RangeError(yY);n=c}else if(n===void 0)throw new TypeError(vY(a));return n}function Vx(t,e,i,s){let{month:n,monthCode:a}=e;if(a!==void 0){const u=((c,_,w,S)=>{const A=c.U(w),[P,D]=jO(_);let U=jy(P,D,A);if(D){const L=HO(c);if(L===void 0)throw new RangeError(Dp);if(L>0){if(U>L)throw new RangeError(Dp);if(A===void 0){if(S===1)throw new RangeError(Dp);U--}}else{if(U!==-L)throw new RangeError(Dp);if(A===void 0&&S===1)throw new RangeError(Dp)}}return U})(t,a,i,s);if(n!==void 0&&n!==u)throw new RangeError(oD);n=u,s=1}else if(n===void 0)throw new TypeError(wY);return ko("month",n,1,t.L(i),s)}function sP(t,e,i,s,n){return Xr(e,"day",1,t.j(s,i),n)}function jx(t,e,i,s){let n=0;const a=[];for(const u of i)e[u]!==void 0?n=1:a.push(u);if(Object.assign(t,e),n)for(const u of s||a)delete t[u]}function CZ(t){return cr(To(Y0(Z0(t))))}function PZ(t,e,i,s,n=Di){return Rr(To(Y0(Z0(i))),e(s),t(n))}function MZ(t,e,i,s,n=0,a=0,u=0,c=0,_=0,w=0,S=Di){return $n(ll(G0(ba(Cr,rd(Tb,[e,i,s,n,a,u,c,_,w])))),t(S))}function RZ(t,e,i,s,n=Di){return Hn(cc(Zu(ba(Cr,{isoYear:e,isoMonth:i,isoDay:s}))),t(n))}function kZ(t,e,i,s=Di,n=1){const a=Cr(e),u=Cr(i),c=t(s);return Lu(CT(Zu({isoYear:a,isoMonth:u,isoDay:Cr(n)})),c)}function OZ(t,e,i,s=Di,n=Kf){const a=Cr(e),u=Cr(i),c=t(s);return Ly(cc(Zu({isoYear:Cr(n),isoMonth:a,isoDay:u})),c)}function DZ(t=0,e=0,i=0,s=0,n=0,a=0){return Ta(Q0(ba(Cr,rd(Ea,[t,e,i,s,n,a])),1))}function FZ(t=0,e=0,i=0,s=0,n=0,a=0,u=0,c=0,_=0,w=0){return pn(ud(ba(W3,rd(hs,[t,e,i,s,n,a,u,c,_,w]))))}function nP(t,e,i=Di){return Rr(t.epochNanoseconds,e,i)}function NZ(t){return cr(t.epochNanoseconds)}function KO(t,e){return $n(to(e,t))}function JO(t,e){return Hn(to(e,t))}function BZ(t,e,i){return uS(t(e.calendar),i)}function LZ(t,e,i){return cS(t(e.calendar),i)}function GO(t,e){return Ta(to(e,t))}function zZ(t,e,i,s){const n=((a,u,c,_)=>{const w=sO(_);return xo(a(u),c,w)})(t,i,e,s);return Rr(To(n),i,e.calendar)}function UZ(t,e,i){const s=t(e.calendar);return Lu({...e,...uS(s,i)})}function VZ(t,e,i){return cS(t(e.calendar),i)}function jZ(t,e,i,s,n){const a=t(n.timeZone),u=n.plainTime,c=u!==void 0?e(u):xa;return Rr(xo(i(a),{...s,...c}),a,s.calendar)}function $Z(t,e=xa){return $n(ll({...t,...e}))}function HZ(t,e,i){return uS(t(e.calendar),i)}function WZ(t,e,i){return cS(t(e.calendar),i)}function qZ(t,e,i,s){return((n,a,u)=>YO(n,a,pD,Sc(u),Qg))(t(e.calendar),i,s)}function XZ(t,e,i,s){return((n,a,u)=>YO(n,a,gD,Sc(u),xb))(t(e.calendar),i,s)}function ZZ(t,e,i,s,n){const a=Sc(n),u=e(a.plainDate),c=t(a.timeZone);return Rr(xo(i(c),{...u,...s}),c,u.calendar)}function YZ(t,e){return $n(ll({...t,...e}))}function KZ(t){return cr(To(Eg(t,Fo)))}function JZ(t){return cr(To(Eg(t,cl)))}function GZ(t){return cr(To(Y0(Z0(t),eh)))}function QZ(t){return cr(To(Y0(Z0(t))))}function eY(t,e,i=xa){const s=e.timeZone,n=t(s),a={...to(e,n),...i};return Rr(Ku(n,a,a.offsetNanoseconds,2),s,e.calendar)}function tY(t,e,i){const s=e.timeZone,n=t(s),a={...to(e,n),...i},u=QO(e.calendar,i.calendar);return Rr(Ku(n,a,a.offsetNanoseconds,2),s,u)}function iY(t,e=xa){return $n({...t,...e})}function sY(t,e){return $n({...t,...e},QO(t.calendar,e.calendar))}function hS(t,e){return{...t,calendar:e}}function nY(t,e){return{...t,timeZone:e}}function QO(t,e){if(t===e)return t;const i=kr(t),s=kr(e);if(i===s||i===Di)return e;if(s===Di)return t;throw new RangeError(dS)}function rY(t,e){return i=>i===Di?t:i===wb||i===Yf?Object.assign(Object.create(t),{id:i}):Object.assign(Object.create(e),IK(i))}function Qu(t,e,i){const s=new Set(i);return n=>(((a,u)=>{for(const c of u)if(c in a)return 1;return 0})(n=N3(s,n),t)||Object.assign(n,e),i&&(n.timeZone=th,["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium")),n)}function Cc(t,e=eD){const[i,,,s]=t;return(n,a=ZK,...u)=>{const c=e(s&&s(...u),n,a,i),_=c.resolvedOptions();return[c,...oY(t,_,u)]}}function eD(t,e,i,s){if(i=s(i),t){if(i.timeZone!==void 0)throw new TypeError(BY);i.timeZone=t}return new Mu(e,i)}function oY(t,e,i){const[,s,n]=t;return i.map(a=>(a.calendar&&((u,c,_)=>{if((_||u!==Di)&&u!==c)throw new RangeError(dS)})(kr(a.calendar),e.calendar,n),s(a,e)))}function Op(t){const e=J_();return Xu(e,t.getOffsetNanosecondsFor(e))}function J_(){return Eg(Date.now(),cl)}function Xl(){return uP||(uP=new Mu().resolvedOptions().timeZone)}const aY=(t,e)=>`Non-integer ${t}: ${e}`,lY=(t,e)=>`Non-positive ${t}: ${e}`,cY=(t,e)=>`Non-finite ${t}: ${e}`,uY=t=>`Cannot convert bigint to ${t}`,hY=t=>`Invalid bigint: ${t}`,fY="Cannot convert Symbol to string",tD="Invalid object",iD=(t,e,i,s,n)=>n?iD(t,n[e],n[i],n[s]):Jg(t,e)+`; must be between ${i}-${s}`,Jg=(t,e)=>`Invalid ${t}: ${e}`,fS=t=>`Missing ${t}`,sD=t=>`Invalid field ${t}`,dY=t=>`Duplicate field ${t}`,nD=t=>"No valid fields: "+t.join(),pY="Invalid bag",rD=(t,e,i)=>Jg(t,e)+"; must be "+Object.keys(i).join(),gY="Cannot use valueOf",rP="Invalid calling context",mY="Forbidden era/eraYear",_Y="Mismatching era/eraYear",yY="Mismatching year/eraYear",bY=t=>`Invalid era: ${t}`,vY=t=>"Missing year"+(t?"/era/eraYear":""),xY=t=>`Invalid monthCode: ${t}`,oD="Mismatching month/monthCode",wY="Missing month/monthCode",oP="Cannot guess year",Dp="Invalid leap month",TY="Invalid protocol",Gg="Invalid protocol results",dS="Mismatching Calendars",SY=t=>`Invalid Calendar: ${t}`,aD="Mismatching TimeZones",EY="Forbidden ICU TimeZone",AY="Out-of-bounds offset",IY="Out-of-bounds TimeZone gap",CY="Invalid TimeZone offset",PY="Ambiguous offset",mb="Out-of-bounds date",MY="Out-of-bounds duration",RY="Cannot mix duration signs",_b="Missing relativeTo",kY="Cannot use large units",OY="Required smallestUnit or largestUnit",DY="smallestUnit > largestUnit",Jr=t=>`Cannot parse: ${t}`,il=t=>`Invalid substring: ${t}`,FY=t=>`Cannot format ${t}`,NY="Mismatching types for formatting",BY="Cannot specify TimeZone",lD=Pi($0,(t,e)=>e),gd=Pi($0,(t,e,i)=>i),Do=Pi(Fy,2),n1={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},yb=Object.keys(n1),Gr=864e5,cD=1e3,eh=1e3,cl=1e6,Fo=1e9,bb=6e10,vb=36e11,Is=864e11,va=[1,eh,cl,Fo,bb,vb,Is],Pc=yb.slice(0,6),r1=Zg(Pc),uD=["offset"],hD=["timeZone"],fD=Pc.concat(uD),dD=fD.concat(hD),o1=["era","eraYear"],LY=o1.concat(["year"]),xb=["year"],pS=["monthCode"],gS=["month"].concat(pS),Qg=["day"],mS=gS.concat(xb),pD=pS.concat(xb),Sa=Qg.concat(mS),zY=Qg.concat(gS),gD=Qg.concat(pS),mD=gd(Pc,0),Di="iso8601",wb="gregory",Yf="japanese",_D={[wb]:{bce:-1,ce:0},[Yf]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},UY={chinese:13,dangi:13,hebrew:-6},En=Pi(X0,"string"),VY=Pi(X0,"boolean"),jY=Pi(X0,"number"),$Y=Pi(X0,"function"),hs=yb.map(t=>t+"s"),_S=Zg(hs),HY=hs.slice(0,6),yD=hs.slice(6),WY=yD.slice(1),qY=lD(hs),ur=gd(hs,0),yS=gd(HY,0),bS=Pi(L3,hs),Ea=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],vS=["isoDay","isoMonth","isoYear"],Tb=Ea.concat(vS),xS=Zg(vS),bD=Zg(Ea),vD=Zg(Tb),xa=gd(bD,0),XY=Pi(L3,Tb),Mu=Intl.DateTimeFormat,xD="en-GB",wS=1e8,ZY=wS*Gr,YY=[wS,0],KY=[-wS,0],Pg=275760,Mg=-271821,JY=1970,Kf=1972,Xa=12,GY=od(1868,9,8),QY=vo(wX,WeakMap),$y="smallestUnit",a1="unit",tg="roundingIncrement",$x="fractionalSecondDigits",wD="relativeTo",TD={constrain:0,reject:1},eK=Object.keys(TD),tK={compatible:0,reject:1,earlier:2,later:3},iK={reject:0,use:1,prefer:2,ignore:3},sK={auto:0,never:1,critical:2,always:3},nK={auto:0,never:1,critical:2},rK={auto:0,never:1},oK={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},em=Pi(BT,$y),TS=Pi(BT,"largestUnit"),aK=Pi(BT,a1),SD=Pi(Yu,"overflow",TD),ED=Pi(Yu,"disambiguation",tK),lK=Pi(Yu,"offset",iK),SS=Pi(Yu,"calendarName",sK),cK=Pi(Yu,"timeZoneName",nK),uK=Pi(Yu,"offset",rK),tm=Pi(Yu,"roundingMode",oK),Rg="PlainYearMonth",kg="PlainMonthDay",md="PlainDate",_d="PlainDateTime",ES="PlainTime",Mc="ZonedDateTime",AS="Instant",IS="Duration",hK=[Math.floor,t=>D_(t)?Math.floor(t):Math.round(t),Math.ceil,t=>D_(t)?Math.ceil(t):Math.round(t),Math.trunc,t=>D_(t)?Math.trunc(t)||0:Math.round(t),t=>t<0?Math.floor(t):Math.ceil(t),t=>Math.sign(t)*Math.round(Math.abs(t))||0,t=>D_(t)?(t=Math.trunc(t)||0)+t%2:Math.round(t)],th="UTC",G_=5184e3,fK=By(1847),dK=By(new Date().getUTCFullYear()+10),pK=/0+$/,to=vo(zX,WeakMap),aP=2**32-1,CS=vo(t=>{const e=nS(t);return typeof e=="object"?new mK(e):new gK(e||0)});class gK{constructor(e){this.v=e}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor(e){return[PT(e,this.v)]}l(){}}class mK{constructor(e){this.$=(i=>{function s(w){const S=e1(w,c,_),[A,P]=XC(S),D=a(A),U=a(P);return D===U?D:n(u(A,P),D,U,w)}function n(w,S,A,P){let D,U;for(;(P===void 0||(D=P=w[1]?A:void 0)===void 0)&&(U=w[1]-w[0]);){const L=w[0]+Math.floor(U/2);i(L)===A?w[1]=L:w[0]=L+1}return D}const a=vo(i),u=vo(HX);let c=fK,_=dK;return{G(w){const S=s(w-86400),A=s(w+86400),P=w-S,D=w-A;if(S===A)return[P];const U=s(P);return U===s(D)?[w-U]:S>A?[P,D]:[]},V:s,l(w,S){const A=e1(w,c,_);let[P,D]=XC(A);const U=G_*S,L=S<0?()=>D>c||(c=A,0):()=>P<_||(_=A,0);for(;L();){const W=a(P),ee=a(D);if(W!==ee){const G=u(P,D);n(G,W,ee);const se=G[0];if((lc(se,w)||1)===S)return se}P+=U,D+=U}}}})((i=>s=>{const n=IT(i,s*cD);return By(zO(n),parseInt(n.month),parseInt(n.day),parseInt(n.hour),parseInt(n.minute),parseInt(n.second))-s})(e))}getOffsetNanosecondsFor(e){return this.$.V(Z3(e))*Fo}getPossibleInstantsFor(e){const[i,s]=[By((n=e).isoYear,n.isoMonth,n.isoDay,n.isoHour,n.isoMinute,n.isoSecond),n.isoMillisecond*cl+n.isoMicrosecond*eh+n.isoNanosecond];var n;return this.$.G(i).map(a=>To(Zf(Eg(a,Fo),s)))}l(e,i){const[s,n]=Y3(e),a=this.$.l(s+(i>0||n?1:0),i);if(a!==void 0)return Eg(a,Fo)}}const PS="([+−-])",Q_="(?:[.,](\\d{1,9}))?",AD=`(?:(?:${PS}(\\d{6}))|(\\d{4}))-?(\\d{2})`,MS="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+Q_+")?)?",RS=PS+MS,_K=AD+"-?(\\d{2})(?:[T ]"+MS+"(Z|"+RS+")?)?",ID="\\[(!?)([^\\]]*)\\]",Sb=`((?:${ID}){0,9})`,yK=dd(AD+Sb),bK=dd("(?:--)?(\\d{2})-?(\\d{2})"+Sb),vK=dd(_K+Sb),xK=dd("T?"+MS+"(?:"+RS+")?"+Sb),wK=dd(RS),TK=new RegExp(ID,"g"),SK=dd(`${PS}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${Q_}H)?(?:(\\d+)${Q_}M)?(?:(\\d+)${Q_}S)?)?`),EK=vo(t=>new Mu(xD,{timeZone:t,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),AK=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,IK=vo(fZ),kS=vo(t=>new Mu(xD,{calendar:t,timeZone:th,era:"short",year:"numeric",month:"short",day:"numeric"})),CK=/^M(\d{2})(L?)$/,PK={era:Ny,eraYear:Cr,year:Cr,month:PC,monthCode:Ny,day:PC},MK=gd(Pc,Cr),RK=gd(hs,W3),lP=Object.assign({},PK,MK,RK,{offset:Ny}),kK=Pi(gX,Pc,Ea),cP={dateAdd(t,e,i){const s=ss(i);let n,{years:a,months:u,weeks:c,days:_}=e;if(_+=Wn(e,5)[0],a||u)n=((w,S,A,P,D)=>{let[U,L,W]=w.h(S);if(A){const[ee,G]=w.I(U,L);U+=A,L=jy(ee,G,w.U(U)),L=ko("month",L,1,w.L(U),D)}return P&&([U,L]=w._(U,L,P)),W=ko("day",W,1,w.j(U,L),D),w.q(U,L,W)})(this,t,a,u,s);else{if(!c&&!_)return t;n=Mr(t)}return n+=(7*c+_)*Gr,cc(J0(n))},dateUntil(t,e,i){if(i<=7){let _=0,w=BO({...t,...xa},{...e,...xa});return i===7&&([_,w]=_c(w,7)),{...ur,weeks:_,days:w}}const s=this.h(t),n=this.h(e);let[a,u,c]=((_,w,S,A,P,D,U)=>{let L=P-w,W=D-S,ee=U-A;if(L||W){const G=Math.sign(L||W);let se=_.j(P,D),fe=0;if(Math.sign(ee)===-G){const Se=se;[P,D]=_._(P,D,-G),L=P-w,W=D-S,se=_.j(P,D),fe=G<0?-Se:se}if(ee=U-Math.min(A,se)+fe,L){const[Se,Te]=_.I(w,S),[Fe,Ne]=_.I(P,D);if(W=Fe-Se||Number(Ne)-Number(Te),Math.sign(W)===-G){const Oe=G<0&&-_.L(P);L=(P-=G)-w,W=D-jy(Se,Te,_.U(P))+(Oe||_.L(P))}}}return[L,W,ee]})(this,...s,...n);return i===8&&(u+=this.J(a,s[0]),a=0),{...ur,years:a,months:u,days:c}},dateFromFields(t,e){const i=ss(e),s=Ux(this,t),n=Vx(this,t,s,i),a=sP(this,t,n,s,i);return Hn(cc(this.P(s,n,a)),this.id||Di)},yearMonthFromFields(t,e){const i=ss(e),s=Ux(this,t),n=Vx(this,t,s,i);return Lu(CT(this.P(s,n,1)),this.id||Di)},monthDayFromFields(t,e){const i=ss(e),s=!this.id,{monthCode:n,year:a,month:u}=t;let c,_,w,S,A;if(n!==void 0){[c,_]=jO(n),A=F3(t,"day");const P=this.N(c,_,A);if(!P)throw new RangeError(oP);if([w,S]=P,u!==void 0&&u!==S)throw new RangeError(oD);s&&(S=ko("month",S,1,Xa,1),A=ko("day",A,1,MT(a!==void 0?a:w,S),i))}else{w=a===void 0&&s?Kf:Ux(this,t),S=Vx(this,t,w,i),A=sP(this,t,S,w,i);const P=this.U(w);_=S===P,c=i1(S,P);const D=this.N(c,_,A);if(!D)throw new RangeError(oP);[w,S]=D}return Ly(cc(this.P(w,S,A)),this.id||Di)},fields(t){return s1(this)&&t.includes("year")?[...t,...o1]:t},mergeFields(t,e){const i=Object.assign(Object.create(null),t);return jx(i,e,gS),s1(this)&&(jx(i,e,LY),this.id===Yf&&jx(i,e,zY,o1)),i},inLeapYear(t){const[e]=this.h(t);return this.K(e)},monthsInYear(t){const[e]=this.h(t);return this.L(e)},daysInMonth(t){const[e,i]=this.h(t);return this.j(e,i)},daysInYear(t){const[e]=this.h(t);return this.X(e)},dayOfYear:lS,era(t){return this.ee(t)[0]},eraYear(t){return this.ee(t)[1]},monthCode(t){const[e,i]=this.h(t),[s,n]=this.I(e,i);return((a,u)=>"M"+Do(a)+(u?"L":""))(s,n)},dayOfWeek:eO,daysInWeek(){return 7}},OK={dayOfYear:lS,h:J3,q:od},DK=Object.assign({},OK,{weekOfYear:UO,yearOfWeek:VO,R(t){function e(D){return(7-Di(0)&&(A=1,P++):(A=i(-1),P--),[A,P,S]}}),FK={dayOfYear:lS,h:t1,q:Cg,weekOfYear:UO,yearOfWeek:VO,R(){return[]}},im=rY(Object.assign({},cP,DK,{h:J3,ee(t){return this.id===wb?tO(t):this.id===Yf?QY(t):[]},I:(t,e)=>[e,0],N(t,e){if(!e)return[Kf,t]},K:RT,U(){},L:G3,J:t=>t*Xa,j:MT,X:Q3,P:(t,e,i)=>({isoYear:t,isoMonth:e,isoDay:i}),q:od,_:(t,e,i)=>(t+=H0(i,Xa),(e+=TT(i,Xa))<1?(t--,e+=Xa):e>Xa&&(t++,e-=Xa),[t,e]),year(t){return t.isoYear},month(t){return t.isoMonth},day:t=>t.isoDay}),Object.assign({},cP,FK,{h:t1,ee(t){const e=this.O(t);return[e.era,e.eraYear]},I(t,e){const i=F_.call(this,t);return[i1(e,i),i===e]},N(t,e,i){let[s,n,a]=t1.call(this,{isoYear:Kf,isoMonth:Xa,isoDay:31});const u=F_.call(this,s),c=n===u;(lc(t,i1(n,u))||lc(Number(e),Number(c))||lc(i,a))===1&&s--;for(let _=0;_<100;_++){const w=s-_,S=F_.call(this,w),A=jy(t,e,S);if(e===(A===S)&&i<=tP.call(this,w,A))return[w,A]}},K(t){const e=N_.call(this,t);return e>N_.call(this,t-1)&&e>N_.call(this,t+1)},U:F_,L:B_,J(t,e){const i=e+t,s=Math.sign(t),n=s<0?-1:0;let a=0;for(let u=e;u!==i;u+=s)a+=B_.call(this,u+n);return a},j:tP,X:N_,P(t,e,i){return J0(Cg.call(this,t,e,i))},q:Cg,_(t,e,i){if(i){if(e+=i,!Number.isSafeInteger(e))throw new RangeError(mb);if(i<0)for(;e<1;)e+=B_.call(this,--t);else{let s;for(;e>(s=B_.call(this,t));)e-=s,t++}}return[t,e]},year(t){return this.O(t).year},month(t){const{year:e,F:i}=this.O(t),{C:s}=this.B(e);return s[i]+1},day(t){return this.O(t).day}})),uc="numeric",yd=["timeZoneName"],CD={month:uc,day:uc},OS={year:uc,month:uc},DS=Object.assign({},OS,{day:uc}),FS={hour:uc,minute:uc,second:uc},NS=Object.assign({},DS,FS),NK=Object.assign({},NS,{timeZoneName:"short"}),BK=Object.keys(OS),LK=Object.keys(CD),zK=Object.keys(DS),UK=Object.keys(FS),BS=["dateStyle"],VK=BK.concat(BS),jK=LK.concat(BS),LS=zK.concat(BS,["weekday"]),sm=UK.concat(["dayPeriod","timeStyle"]),zS=LS.concat(sm),$K=zS.concat(yd),HK=yd.concat(sm),WK=yd.concat(LS),qK=yd.concat(["day","weekday"],sm),XK=yd.concat(["year","weekday"],sm),ZK={},PD=[Qu(zS,NS),LT],YK=[Qu($K,NK),LT,0,(t,e)=>{const i=kr(t.timeZone);if(e&&kr(e.timeZone)!==i)throw new RangeError(aD);return i}],MD=[Qu(zS,NS,yd),Mr],RD=[Qu(LS,DS,HK),Mr],kD=[Qu(sm,FS,WK),t=>yc(t)/cl],OD=[Qu(VK,OS,qK),Mr,1],DD=[Qu(jK,CD,XK),Mr,1];let uP;function Aa(t,e,i,s,n){function a(..._){if(!(this instanceof a))throw new TypeError(rP);pP(this,e(..._))}function u(_,w){return Object.defineProperties(function(...S){return _.call(this,c(this),...S)},EC(w))}function c(_){const w=fr(_);if(!w||w.branding!==t)throw new TypeError(rP);return w}return Object.defineProperties(a.prototype,{...pX(ba(u,i)),...qf(ba(u,s)),...wT("Temporal."+t)}),Object.defineProperties(a,{...qf(n),...EC(t)}),[a,_=>{const w=Object.create(a.prototype);return pP(w,_),w},c]}function FD(t){return t=t.concat("id").sort(),e=>{if(!mX(e,t))throw new TypeError(TY);return e}}function bd(t){if(fr(t)||t.calendar!==void 0||t.timeZone!==void 0)throw new TypeError(pY);return t}function L_(t,e){const i={};for(const s in t)i[s]=({o:n},a)=>{const u=fr(a)||{},{branding:c}=u,_=c===md||e.includes(c)?u:Ar(a);return n[s](_)};return i}function US(t){const e={};for(const i in t)e[i]=s=>{const{calendar:n}=s;return(a=n,typeof a=="string"?im(a):(u=a,Object.assign(Object.create(hJ),{i:u})))[i](s);var a,u};return e}function Rc(){throw new TypeError(gY)}function nm({calendar:t}){return typeof t=="string"?new YS(t):t}function hP(t,e){if(e=qn(e),hr(t)){const s=fr(t);if(s&&s.branding===kg)return ss(e),s;const n=LD(t);return ZO(Pb(n||Di),!n,t,e)}const i=KX(im,t);return ss(e),i}function ND(t,e,i){return s=e.call(t,Tr(cr(i))),bO(q0(s));var s}function ey(t,e=jD){const i=Object.keys(e).sort(),s={};for(const n of i)s[n]=Pi(e[n],t,$Y(t[n]));return s}function Ps(t,e){return typeof t=="string"?CS(t):ey(t,e)}function Tn(t){return Ps(t,c1)}function ra(t){if(hr(t)){const e=fr(t);if(e)switch(e.branding){case AS:return e;case Mc:return cr(e.epochNanoseconds)}}return WX(t)}function fP(t,e,i){const s=e.l(ra(i).epochNanoseconds,t);return s?Tr(cr(s)):null}function js(t){return hr(t)?(fr(t)||{}).timeZone||_J(t):(e=>sS(eZ(En(e))))(t)}function Gl(t,e){if(hr(t)){const i=fr(t)||{};switch(i.branding){case ES:return ss(e),i;case _d:return ss(e),Ta(i);case Mc:return ss(e),GO(Tn,i)}return bZ(t,e)}return ss(e),JX(t)}function VS(t){return t===void 0?void 0:Gl(t)}function sf(t,e){if(e=qn(e),hr(t)){const s=fr(t);return s&&s.branding===Rg?(ss(e),s):XO(Ib(rm(t)),t,e)}const i=YX(im,t);return ss(e),i}function Ql(t,e){if(e=qn(e),hr(t)){const s=fr(t)||{};switch(s.branding){case _d:return ss(e),s;case md:return ss(e),$n({...s,...xa});case Mc:return ss(e),KO(Tn,s)}return yZ(Cb(rm(t)),t,e)}const i=ZX(t);return ss(e),i}function Ar(t,e){if(e=qn(e),hr(t)){const s=fr(t)||{};switch(s.branding){case md:return ss(e),s;case _d:return ss(e),Hn(s);case Mc:return ss(e),JO(Tn,s)}return qO(Cb(rm(t)),t,e)}const i=KT(t);return ss(e),i}function BD(t,e,i){return ha(e.call(t,hn(Hn(i,t))))}function Ia(t){return e=>typeof e=="string"?im(e):((i,s)=>{const n=Object.keys(s).sort(),a={};for(const u of n)a[u]=Pi(s[u],i,i[u]);return a})(e,t)}function un(t){if(hr(t)){const e=fr(t);return e&&e.branding===IS?e:vZ(t)}return GX(t)}function Fp(t){if(t!==void 0){if(hr(t)){const e=fr(t)||{};switch(e.branding){case Mc:case md:return e;case _d:return Hn(e)}const i=rm(t);return{...mZ(js,Ps,Cb(i),t),calendar:i}}return qX(t)}}function rm(t){return LD(t)||Di}function LD(t){const{calendar:e}=t;if(e!==void 0)return lr(e)}function lr(t){return hr(t)?(fr(t)||{}).calendar||kJ(t):(e=>gb(QX(En(e))))(t)}function nf(t,e){if(e=qn(e),hr(t)){const i=fr(t);if(i&&i.branding===Mc)return eb(e),i;const s=rm(t);return _Z(js,Ps,Cb(s),s,t,e)}return XX(t,e)}function dP(t){return ba(e=>i=>e(l1(i)),t)}function l1(t){return to(t,Tn)}function KK(){const t=Mu.prototype,e=Object.getOwnPropertyDescriptors(t),i=Object.getOwnPropertyDescriptors(Mu),s=function(n,a={}){if(!(this instanceof s))return new s(n,a);KS.set(this,((u,c={})=>{const _=new Mu(u,c),w=_.resolvedOptions(),S=w.locale,A=wo(Object.keys(c),w),P=vo(QK),D=(...U)=>{let L;const W=U.map((ee,G)=>{const se=fr(ee),fe=(se||{}).branding;if(G&&L&&L!==fe)throw new TypeError(NY);return L=fe,se});return L?P(L)(S,A,...W):[_,...U]};return D.u=_,D})(n,a))};for(const n in e){const a=e[n],u=n.startsWith("format")&&JK(n);typeof a.value=="function"?a.value=n==="constructor"?s:u||GK(n):u&&(a.get=function(){return u.bind(this)})}return i.prototype.value=Object.create(t,e),Object.defineProperties(s,i),s}function JK(t){return function(...e){const i=KS.get(this),[s,...n]=i(...e);return s[t](...n)}}function GK(t){return function(...e){return KS.get(this).u[t](...e)}}function QK(t){const e=eJ[t];if(!e)throw new TypeError(FY(t));return Cc(e,vo(eD))}const eJ={Instant:PD,PlainDateTime:MD,PlainDate:RD,PlainTime:kD,PlainYearMonth:OD,PlainMonthDay:DD},tJ=Cc(PD),iJ=Cc(YK),sJ=Cc(MD),nJ=Cc(RD),rJ=Cc(kD),oJ=Cc(OD),aJ=Cc(DD),jS={era:vX,eraYear:U3,year:q0,month:ha,daysInMonth:ha,daysInYear:ha,inLeapYear:VY,monthsInYear:ha},Eb={monthCode:En},$S={day:ha},zD={dayOfWeek:ha,dayOfYear:ha,weekOfYear:xX,yearOfWeek:U3,daysInWeek:ha},UD=Object.assign({},jS,Eb,$S,zD),Hy=new WeakMap,fr=Hy.get.bind(Hy),pP=Hy.set.bind(Hy),lJ={...L_(jS,[Rg]),...L_(zD,[]),...L_(Eb,[Rg,kg]),...L_($S,[kg])},HS=US(UD),cJ=US({...jS,...Eb}),uJ=US({...Eb,...$S}),om={calendarId:t=>kr(t.calendar)},hJ=ba((t,e)=>function(i){const{i:s}=this;return t(s[e](hn(Hn(i,s))))},UD),fJ=$0(t=>e=>e[t],hs.concat("sign")),WS=$0((t,e)=>i=>i[Ea[e]],Pc),VD={epochSeconds:SX,epochMilliseconds:LT,epochMicroseconds:EX,epochNanoseconds:AX},am=Pi(N3,new Set(["branding"])),[dJ,Jf,pJ]=Aa(kg,Pi(OZ,lr),{...om,...uJ},{getISOFields:am,getCalendar:nm,with(t,e,i){return Jf(EZ(PJ,t,this,bd(e),i))},equals:(t,e)=>lZ(t,hP(e)),toPlainDate(t,e){return hn(XZ(lm,t,this,e))},toLocaleString(t,e,i){const[s,n]=aJ(e,i,t);return s.format(n)},toString:BC,toJSON:t=>BC(t),valueOf:Rc},{from:(t,e)=>Jf(hP(t,e))}),jD={getOffsetNanosecondsFor:ND,getPossibleInstantsFor(t,e,i){const s=[...e.call(t,sr($n(i,Di)))].map(a=>mJ(a).epochNanoseconds),n=s.length;return n>1&&(s.sort(eo),vO(zo(Lo(s[0],s[n-1])))),s}},c1={getOffsetNanosecondsFor:ND},[gJ,Tr,mJ]=Aa(AS,CZ,VD,{add:(t,e)=>Tr(UC(0,t,un(e))),subtract:(t,e)=>Tr(UC(1,t,un(e))),until:(t,e,i)=>ks(YC(0,t,ra(e),i)),since:(t,e,i)=>ks(YC(1,t,ra(e),i)),round:(t,e)=>Tr(CX(t,e)),equals:(t,e)=>sZ(t,ra(e)),toZonedDateTime(t,e){const i=Sc(e);return vn(nP(t,js(i.timeZone),lr(i.calendar)))},toZonedDateTimeISO:(t,e)=>vn(nP(t,js(e))),toLocaleString(t,e,i){const[s,n]=tJ(e,i,t);return s.format(n)},toString:(t,e)=>kC(js,Tn,t,e),toJSON:t=>kC(js,Tn,t),valueOf:Rc},{from:t=>Tr(ra(t)),fromEpochSeconds:t=>Tr(KZ(t)),fromEpochMilliseconds:t=>Tr(JZ(t)),fromEpochMicroseconds:t=>Tr(GZ(t)),fromEpochNanoseconds:t=>Tr(QZ(t)),compare:(t,e)=>MO(ra(t),ra(e))}),[Ab,AG]=Aa("TimeZone",t=>{const e=tZ(t);return{branding:"TimeZone",id:e,o:CS(e)}},{id:t=>t.id},{getPossibleInstantsFor:({o:t},e)=>t.getPossibleInstantsFor(Ql(e)).map(i=>Tr(cr(i))),getOffsetNanosecondsFor:({o:t},e)=>t.getOffsetNanosecondsFor(ra(e).epochNanoseconds),getOffsetStringFor(t,e){const i=ra(e).epochNanoseconds,s=ey(this,c1).getOffsetNanosecondsFor(i);return cd(s)},getPlainDateTimeFor(t,e,i=Di){const s=ra(e).epochNanoseconds,n=ey(this,c1).getOffsetNanosecondsFor(s);return sr($n(Xu(s,n),lr(i)))},getInstantFor(t,e,i){const s=Ql(e),n=sO(i),a=ey(this);return Tr(cr(xo(a,s,n)))},getNextTransition:({o:t},e)=>fP(1,t,e),getPreviousTransition:({o:t},e)=>fP(-1,t,e),equals(t,e){return!!oS(this,js(e))},toString:t=>t.id,toJSON:t=>t.id},{from(t){const e=js(t);return typeof e=="string"?new Ab(e):e}}),_J=FD(Object.keys(jD)),[yJ,tc]=Aa(ES,DZ,WS,{getISOFields:am,with(t,e,i){return tc(AZ(this,bd(e),i))},add:(t,e)=>tc(WC(0,t,un(e))),subtract:(t,e)=>tc(WC(1,t,un(e))),until:(t,e,i)=>ks(eP(0,t,Gl(e),i)),since:(t,e,i)=>ks(eP(1,t,Gl(e),i)),round:(t,e)=>tc(RX(t,e)),equals:(t,e)=>cZ(t,Gl(e)),toZonedDateTime:(t,e)=>vn(ZZ(js,Ar,Ps,t,e)),toPlainDateTime:(t,e)=>sr(YZ(t,Ar(e))),toLocaleString(t,e,i){const[s,n]=rJ(e,i,t);return s.format(n)},toString:LC,toJSON:t=>LC(t),valueOf:Rc},{from:(t,e)=>tc(Gl(t,e)),compare:(t,e)=>rS(Gl(t),Gl(e))}),[bJ,rc,vJ]=Aa(Rg,Pi(kZ,lr),{...om,...cJ},{getISOFields:am,getCalendar:nm,with(t,e,i){return rc(SZ(CJ,t,this,bd(e),i))},add:(t,e,i)=>rc(HC(gP,0,t,un(e),i)),subtract:(t,e,i)=>rc(HC(gP,1,t,un(e),i)),until:(t,e,i)=>ks(QC(mP,0,t,sf(e),i)),since:(t,e,i)=>ks(QC(mP,1,t,sf(e),i)),equals:(t,e)=>aZ(t,sf(e)),toPlainDate(t,e){return hn(qZ(lm,t,this,e))},toLocaleString(t,e,i){const[s,n]=oJ(e,i,t);return s.format(n)},toString:NC,toJSON:t=>NC(t),valueOf:Rc},{from:(t,e)=>rc(sf(t,e)),compare:(t,e)=>pd(sf(t),sf(e))}),[xJ,sr]=Aa(_d,Pi(MZ,lr),{...om,...HS,...WS},{getISOFields:am,getCalendar:nm,with(t,e,i){return sr(wZ(lm,t,this,bd(e),i))},withCalendar:(t,e)=>sr(hS(t,lr(e))),withPlainDate:(t,e)=>sr(sY(t,Ar(e))),withPlainTime:(t,e)=>sr(iY(t,VS(e))),add:(t,e,i)=>sr(jC(Uu,0,t,un(e),i)),subtract:(t,e,i)=>sr(jC(Uu,1,t,un(e),i)),until:(t,e,i)=>ks(JC(fa,0,t,Ql(e),i)),since:(t,e,i)=>ks(JC(fa,1,t,Ql(e),i)),round:(t,e)=>sr(MX(t,e)),equals:(t,e)=>rZ(t,Ql(e)),toZonedDateTime:(t,e,i)=>vn(zZ(Ps,t,js(e),i)),toPlainDate:t=>hn(Hn(t)),toPlainTime:t=>tc(Ta(t)),toPlainYearMonth(t){return rc(UZ(Ib,t,this))},toPlainMonthDay(t){return Jf(VZ(Pb,t,this))},toLocaleString(t,e,i){const[s,n]=sJ(e,i,t);return s.format(n)},toString:DC,toJSON:t=>DC(t),valueOf:Rc},{from:(t,e)=>sr(Ql(t,e)),compare:(t,e)=>kO(Ql(t),Ql(e))}),[wJ,hn,$D]=Aa(md,Pi(RZ,lr),{...om,...HS},{getISOFields:am,getCalendar:nm,with(t,e,i){return hn(TZ(lm,t,this,bd(e),i))},withCalendar:(t,e)=>hn(hS(t,lr(e))),add:(t,e,i)=>hn($C(Uu,0,t,un(e),i)),subtract:(t,e,i)=>hn($C(Uu,1,t,un(e),i)),until:(t,e,i)=>ks(GC(fa,0,t,Ar(e),i)),since:(t,e,i)=>ks(GC(fa,1,t,Ar(e),i)),equals:(t,e)=>oZ(t,Ar(e)),toZonedDateTime(t,e){const i=!hr(e)||e instanceof Ab?{timeZone:e}:e;return vn(jZ(js,Gl,Ps,t,i))},toPlainDateTime:(t,e)=>sr($Z(t,VS(e))),toPlainYearMonth(t){return rc(HZ(Ib,t,this))},toPlainMonthDay(t){return Jf(WZ(Pb,t,this))},toLocaleString(t,e,i){const[s,n]=nJ(e,i,t);return s.format(n)},toString:FC,toJSON:t=>FC(t),valueOf:Rc},{from:(t,e)=>hn(Ar(t,e)),compare:(t,e)=>pd(Ar(t),Ar(e))}),qS={fields(t,e,i){return[...e.call(t,i)]}},HD=Object.assign({dateFromFields(t,e,i,s){return $D(e.call(t,Object.assign(Object.create(null),i),s))}},qS),WD=Object.assign({yearMonthFromFields(t,e,i,s){return vJ(e.call(t,Object.assign(Object.create(null),i),s))}},qS),qD=Object.assign({monthDayFromFields(t,e,i,s){return pJ(e.call(t,Object.assign(Object.create(null),i),s))}},qS),XS={mergeFields(t,e,i,s){return Sc(e.call(t,Object.assign(Object.create(null),i),Object.assign(Object.create(null),s)))}},TJ=Object.assign({},HD,XS),SJ=Object.assign({},WD,XS),EJ=Object.assign({},qD,XS),ZS={dateAdd(t,e,i,s,n){return $D(e.call(t,hn(Hn(i,t)),ks(pn(s)),n))}},XD=Object.assign({},ZS,{dateUntil(t,e,i,s,n,a){return RJ(e.call(t,hn(Hn(i,t)),hn(Hn(s,t)),Object.assign(Object.create(null),a,{largestUnit:yb[n]})))}}),AJ=Object.assign({},ZS,{day:BD}),IJ=Object.assign({},XD,{day:BD}),Ib=Ia(WD),Cb=Ia(HD),Pb=Ia(qD),CJ=Ia(SJ),lm=Ia(TJ),PJ=Ia(EJ),Uu=Ia(ZS),fa=Ia(XD),gP=Ia(AJ),mP=Ia(IJ),[MJ,ks,RJ]=Aa(IS,FZ,{...fJ,blank:$X},{with:(t,e)=>ks(IZ(t,e)),negated:t=>ks(YT(t)),abs:t=>ks(jX(t)),add:(t,e,i)=>ks(qC(Fp,fa,Ps,0,t,un(e),i)),subtract:(t,e,i)=>ks(qC(Fp,fa,Ps,1,t,un(e),i)),round:(t,e)=>ks(VX(Fp,fa,Ps,t,e)),total:(t,e)=>IX(Fp,fa,Ps,t,e),toLocaleString(t,e,i){return Intl.DurationFormat?new Intl.DurationFormat(e,i).format(this):zx(t)},toString:zx,toJSON:t=>zx(t),valueOf:Rc},{from:t=>ks(un(t)),compare:(t,e,i)=>iZ(Fp,Uu,Ps,un(t),un(e),i)}),ZD={toString:t=>t.id,toJSON:t=>t.id,...lJ,dateAdd:({id:t,o:e},i,s,n)=>hn(Hn(e.dateAdd(Ar(i),un(s),n),t)),dateUntil:({o:t},e,i,s)=>ks(pn(t.dateUntil(Ar(e),Ar(i),TX(s)))),dateFromFields:({id:t,o:e},i,s)=>hn(qO(e,i,s,bX(t))),yearMonthFromFields:({id:t,o:e},i,s)=>rc(XO(e,i,s,_X(t))),monthDayFromFields:({id:t,o:e},i,s)=>Jf(ZO(e,0,i,s,yX(t))),fields({o:t},e){const i=new Set(Sa),s=[];for(const n of e){if(En(n),!i.has(n))throw new RangeError(sD(n));i.delete(n),s.push(n)}return t.fields(s)},mergeFields:({o:t},e,i)=>t.mergeFields(AC(CC(e)),AC(CC(i)))},[YS]=Aa("Calendar",t=>{const e=gZ(t);return{branding:"Calendar",id:e,o:im(e)}},{id:t=>t.id},ZD,{from(t){const e=lr(t);return typeof e=="string"?new YS(e):e}}),kJ=FD(Object.keys(ZD).slice(4)),[OJ,vn]=Aa(Mc,Pi(PZ,lr,js),{...VD,...om,...dP(HS),...dP(WS),offset:t=>cd(l1(t).offsetNanoseconds),offsetNanoseconds:t=>l1(t).offsetNanoseconds,timeZoneId:t=>kr(t.timeZone),hoursInDay:t=>kX(Ps,t)},{getISOFields:t=>UX(Tn,t),getCalendar:nm,getTimeZone:({timeZone:t})=>typeof t=="string"?new Ab(t):t,with(t,e,i){return vn(xZ(lm,Ps,t,this,bd(e),i))},withCalendar:(t,e)=>vn(hS(t,lr(e))),withTimeZone:(t,e)=>vn(nY(t,js(e))),withPlainDate:(t,e)=>vn(tY(Ps,t,Ar(e))),withPlainTime:(t,e)=>vn(eY(Ps,t,VS(e))),add:(t,e,i)=>vn(VC(Uu,Ps,0,t,un(e),i)),subtract:(t,e,i)=>vn(VC(Uu,Ps,1,t,un(e),i)),until:(t,e,i)=>ks(pn(KC(fa,Ps,0,t,nf(e),i))),since:(t,e,i)=>ks(pn(KC(fa,Ps,1,t,nf(e),i))),round:(t,e)=>vn(PX(Ps,t,e)),startOfDay:t=>vn(OX(Ps,t)),equals:(t,e)=>nZ(t,nf(e)),toInstant:t=>Tr(NZ(t)),toPlainDateTime:t=>sr(KO(Tn,t)),toPlainDate:t=>hn(JO(Tn,t)),toPlainTime:t=>tc(GO(Tn,t)),toPlainYearMonth(t){return rc(BZ(Ib,t,this))},toPlainMonthDay(t){return Jf(LZ(Pb,t,this))},toLocaleString(t,e,i={}){const[s,n]=iJ(e,i,t);return s.format(n)},toString:(t,e)=>OC(Tn,t,e),toJSON:t=>OC(Tn,t),valueOf:Rc},{from:(t,e)=>vn(nf(t,e)),compare:(t,e)=>RO(nf(t),nf(e))}),DJ=Object.defineProperties({},{...wT("Temporal.Now"),...qf({timeZoneId:()=>Xl(),instant:()=>Tr(cr(J_())),zonedDateTime:(t,e=Xl())=>vn(Rr(J_(),js(e),lr(t))),zonedDateTimeISO:(t=Xl())=>vn(Rr(J_(),js(t),Di)),plainDateTime:(t,e=Xl())=>sr($n(Op(Tn(js(e))),lr(t))),plainDateTimeISO:(t=Xl())=>sr($n(Op(Tn(js(t))),Di)),plainDate:(t,e=Xl())=>hn(Hn(Op(Tn(js(e))),lr(t))),plainDateISO:(t=Xl())=>hn(Hn(Op(Tn(js(t))),Di)),plainTimeISO:(t=Xl())=>tc(Ta(Op(Tn(js(t)))))})}),_P=Object.defineProperties({},{...wT("Temporal"),...qf({PlainYearMonth:bJ,PlainMonthDay:dJ,PlainDate:wJ,PlainTime:yJ,PlainDateTime:xJ,ZonedDateTime:OJ,Instant:gJ,Calendar:YS,TimeZone:Ab,Duration:MJ,Now:DJ})}),FJ=KK(),KS=new WeakMap;Object.create(Intl),qf({DateTimeFormat:FJ});const NJ=wc({name:"TimeSlider",components:{},props:{numDays:Number,dailyTotals:{type:Object,required:!0},weeks:{type:Object,required:!0},initial:{type:Object,required:!0},labels:{type:Object,required:!1}},data:()=>({leftside:0,rightside:0,isDraggingDivider:0,isDragHappening:!1,dragStartWidth:100,thumbLeft:100,thumbWidth:0,pctStart:0,pctEnd:1,maxInfections:1,side:"",useInitial:!0}),computed:{},watch:{},mounted(){this.rightside=this.numDays||0,this.updateWeeks();const e=document.getElementById("dailybar").clientWidth;this.thumbLeft=Math.floor(this.initial[0]*e),this.thumbWidth=Math.ceil((this.initial[1]-this.initial[0])*e);const i=new ResizeObserver(n=>{const u=document.getElementById("dailybar").clientWidth;let c=this.useInitial?this.initial[0]:this.pctStart,_=this.useInitial?this.initial[1]:this.pctEnd;this.useInitial=!1,this.thumbLeft=Math.floor(c*u),this.thumbWidth=Math.ceil((_-c)*u)}),s=document.getElementById("dailybar");s&&i.observe(s)},methods:{updateWeeks(){this.maxInfections=Math.max(...this.weeks)},getWeekHeight(t){return Math.floor(100*t/this.maxInfections)},dividerDragStart(t,e){this.isDraggingDivider=t.clientX,this.dragStartWidth=this.thumbLeft,this.side=e},dividerDragEnd(t){this.isDraggingDivider=0,this.side=""},dividerDragging(t){if(!this.isDraggingDivider)return;if(this.side=="left")return this.adjustLeftSide(t);if(this.side=="right")return this.adjustRightSide(t);const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider;this.thumbLeft=Math.max(0,this.dragStartWidth+s),this.thumbLeft=Math.min(this.thumbLeft,i-this.thumbWidth),this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,this.$emit("range",{start:this.pctStart,end:this.pctEnd})},adjustLeftSide(t){const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider,n=this.thumbLeft+s;n<0||n>=this.thumbLeft+this.thumbWidth-16||(this.isDraggingDivider+=s,this.thumbLeft+=s,this.thumbWidth-=s,this.thumbLeft=Math.max(0,this.thumbLeft),this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,console.log(this.pctStart,this.pctEnd),this.$emit("range",{start:this.pctStart,end:this.pctEnd}))},adjustRightSide(t){const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider,n=this.thumbWidth+s;n<16||this.thumbLeft+n>i||(this.thumbWidth+=s,this.isDraggingDivider=t.clientX,this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,console.log(this.pctStart,this.pctEnd),this.$emit("range",{start:this.pctStart,end:this.pctEnd}))},sizerDragStart(t){console.log("dragStart",t),this.isDraggingDivider=t.clientX,this.dragStartWidth=this.thumbLeft},sizerDragEnd(t){this.isDraggingDivider=0},sizerDragging(t){if(!this.isDraggingDivider)return;console.log("sizer",this.isDraggingDivider,t.clientX,this.thumbLeft,this.thumbWidth);const i=document.getElementById("dailybar").clientWidth,s=t.clientX-this.isDraggingDivider;console.log({deltaX:s});let n=s;console.log(n),console.log("oldwidth",this.thumbWidth,"newwidth",this.thumbWidth-n),console.log("oldleft",this.thumbLeft,"newleft",this.thumbLeft+n),this.thumbWidth-=n,this.thumbLeft+=n,this.pctStart=this.thumbLeft/i,this.pctEnd=(this.thumbLeft+this.thumbWidth)/i,this.$emit("range",{start:this.pctStart,end:this.pctEnd})},filterByDate(){}}}),BJ={id:"dailybar"},LJ={class:"bars"},zJ={key:0,class:"labels"};function UJ(t,e,i,s,n,a){return ts(),wn("div",{class:"time-slider",onMousemove:e[9]||(e[9]=xn((...u)=>t.dividerDragging&&t.dividerDragging(...u),["stop"])),onMouseup:e[10]||(e[10]=(...u)=>t.dividerDragEnd&&t.dividerDragEnd(...u))},[Ms("div",BJ,[Ms("div",LJ,[(ts(!0),wn(Un,null,tw(t.weeks,u=>(ts(),wn("div",{class:"week",style:Qa({height:`${t.getWeekHeight(u)}%`})},null,4))),256))]),t.labels?(ts(),wn("div",zJ,[(ts(!0),wn(Un,null,tw(t.labels,u=>(ts(),wn("div",{class:"date-label",style:Qa({left:`${u.leftPct}%`})},la(u.text),5))),256))])):fc("",!0)]),Ms("div",{id:"dragthumb",style:Qa({left:`${t.thumbLeft}px`,width:`${t.thumbWidth}px`}),onMousedown:e[6]||(e[6]=(...u)=>t.dividerDragStart&&t.dividerDragStart(...u)),onMouseup:e[7]||(e[7]=(...u)=>t.dividerDragEnd&&t.dividerDragEnd(...u)),onMousemove:e[8]||(e[8]=xn((...u)=>t.dividerDragging&&t.dividerDragging(...u),["stop"]))},[Ms("div",{id:"dragleftie",onMousedown:e[0]||(e[0]=xn(u=>t.dividerDragStart(u,"left"),["stop"])),onMouseup:e[1]||(e[1]=xn(u=>t.dividerDragEnd(u,"left"),["stop"])),onMousemove:e[2]||(e[2]=xn(u=>t.dividerDragging(u,"left"),["stop"]))},null,32),Ms("div",{id:"dragrightie",onMousedown:e[3]||(e[3]=xn(u=>t.dividerDragStart(u,"right"),["stop"])),onMouseup:e[4]||(e[4]=xn(u=>t.dividerDragEnd(u,"right"),["stop"])),onMousemove:e[5]||(e[5]=xn(u=>t.dividerDragging(u,"right"),["stop"]))},null,32)],36)],32)}const YD=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},VJ=YD(NJ,[["render",UJ],["__scopeId","data-v-04bdd2c0"]]);function jJ(t){return new Worker("/assets/CSVStreamer.worker-DUKFFnIK.js",{name:t==null?void 0:t.name})}const $J="https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/episim/battery",HJ=wc({name:"InfectionMap",components:{TimeSlider:VJ},data:()=>({map:{},allInfections:[],isLoaded:!1,population:[],numInfections:0,statusText:"Loading...",coordinates:new Float64Array(1),view:0,deckOverlay:{},startDate:"",numDays:0,dailyTotals:new Float32Array(0),filterStartDate:0,filterEndDate:0,weeks:[],labels:[],csvStreamer:null,useMeters:!0,radiusSlider:250,range:[20,1e3],path:"",updating:!0}),computed:{},watch:{view(){this.updateLayers()},radiusSlider(){this.updateLayers()},async useMeters(){await this.setupUnits(),this.updateLayers()}},beforeDestroy(){this.csvStreamer&&this.csvStreamer.terminate(),this.allInfections=[],this.coordinates=new Float64Array(1),this.population=[]},mounted(){this.map=null,this.map=new SC.Map({container:"mymap",style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",center:[8,49.9],zoom:7,bearing:0,pitch:50}),this.loadInfections()},methods:{async setupUnits(){this.updating=!0,this.range=this.useMeters?[10,1e3]:[1,30],await this.$nextTick(),this.updating=!1,!this.useMeters&&this.radiusSlider>30&&(this.radiusSlider=30),await this.$nextTick()},filterByDate(t){const e=Math.floor(this.numDays*t.start),i=Math.ceil(this.numDays*t.end);this.filterStartDate=e,this.filterEndDate=i,this.updateLayers()},async loadInfections(){let t=new URLSearchParams(document.location.search);if(this.path=t.get("path")||"",!this.path){this.statusText="Need file path in URL";return}t.get("units")=="pixels"&&(this.useMeters=!1),this.range=this.useMeters?[20,1e3]:[1,30];const i=parseInt(t.get("radius")||"250");this.radiusSlider=i,this.updating=!1,await this.$nextTick();const s=`${$J}/${this.path}`;console.log({batteryUrl:s});const n=s.lastIndexOf("summaries/"),a=s.substring(0,n)+"metadata.yaml",u=await(await fetch(a)).text(),c=fX.parse(u);this.startDate=c.startDates?c.startDates[0]:"2020-02-25",console.log(this.startDate),this.csvStreamer=new jJ;let _=0,w=0,S=0;this.csvStreamer.onmessage=async A=>{if(A.data.status&&(this.statusText=A.data.status),A.data.error&&(this.statusText=A.data.error),A.data.finished){const P=_/S,D=w/S;this.finishedLoadingInfections(P,D)}if(A.data.data){const P=A.data.data;this.numInfections+=P.length,this.statusText="Reading infections: "+this.numInfections,P.length&&(_+=P[0].home_lon,w+=P[0].home_lat,S+=1);for(const D of P)this.allInfections.push({home_lon:D.home_lon,home_lat:D.home_lat,daysSinceStart:D.daysSinceStart,infection_type:D.infection_type})}},this.csvStreamer.postMessage({url:s,options:{header:!0,dynamicTyping:!0,skipEmptyLines:!0}})},finishedLoadingInfections(t,e){if(this.csvStreamer.terminate(),!this.allInfections.length){this.statusText="ERROR: No infections file found";return}this.setupDailyTotals(),this.isLoaded=!0,this.buildDeckLayer(t,e)},setupDailyTotals(){this.numDays=this.allInfections[this.allInfections.length-1].daysSinceStart||0,this.filterEndDate=this.numDays,this.dailyTotals=new Float32Array(this.numDays+1),this.allInfections.forEach(a=>{this.dailyTotals[a.daysSinceStart]+=1});let t=0;for(let a=0;a96.5&&(this.labels[this.labels.length-1].leftPct=96.5)},buildDeckLayer(t,e){this.statusText="Generating map...",this.deckOverlay=new V7({interleaved:!0,layers:[]}),this.map.addControl(this.deckOverlay),this.map.addControl(new SC.NavigationControl),t&&e&&this.map.jumpTo({center:[t,e],zoom:9}),this.statusText="Home locations of infected people",this.updateLayers()},getColor(t){return t==="import"?[50,0,180]:t==="normal"?[0,204,0]:[255,0,0]},updateLayers(){var i;if(!((i=this.deckOverlay)!=null&&i._deck))return;const t=new URLSearchParams(window.location.search);t.set("radius",""+this.radiusSlider),t.set("units",this.useMeters?"meters":"pixels"),history.replaceState({},"","?"+t.toString());const e=[];e.push(new rT({visible:this.view==0,id:"pointlayer-1",data:this.allInfections,getFillColor:s=>this.getColor(s.infection_type),getRadius:1,getPosition:s=>[s.home_lon,s.home_lat],radiusScale:this.radiusSlider,radiusUnits:this.useMeters?"meters":"pixels",stroked:!1,filled:!0,autoHighlight:!0,highlightColor:[255,255,255],opacity:.05,pickable:!1,useDevicePixels:!1,transitions:{},parameters:{depthTest:!1},glOptions:{fp64:!1},extensions:[new oT({filterSize:1})],filterRange:[this.filterStartDate,this.filterEndDate],getFilterValue:s=>s.daysSinceStart})),this.deckOverlay._deck.setProps({layers:e})}}}),WJ={class:"app"},qJ={class:"button-row"},XJ={class:"flex1",style:{margin:"auto 0","line-height":"1.4rem"}},ZJ={style:{"font-size":"0.85rem"}},YJ={class:"flex-row",style:{"font-size":"0.8rem",margin:"0.75rem 0 0 auto",gap:"1rem",color:"white"}};function KJ(t,e,i,s,n,a){const u=Xv("time-slider"),c=Xv("o-slider"),_=Xv("o-checkbox");return ts(),wn("div",WJ,[Ms("div",qJ,[Ms("p",XJ,[Ms("b",null,la(t.statusText)+la(t.filterStartDate+t.filterEndDate?`: Day ${t.filterStartDate} - ${t.filterEndDate}`:""),1),Ms("p",ZJ,la(t.path),1)])]),e[3]||(e[3]=Ms("div",{class:"mymap flex1",id:"mymap"},null,-1)),t.isLoaded?(ts(),sl(u,{key:0,class:"time-slider",numDays:t.numDays,dailyTotals:t.dailyTotals,weeks:t.weeks,initial:[0,30/t.numDays],labels:t.labels,onRange:t.filterByDate},null,8,["numDays","dailyTotals","weeks","initial","labels","onRange"])):fc("",!0),Ms("div",YJ,[Ms("p",null,[Ms("b",null,"Radius: "+la(t.radiusSlider),1)]),t.updating?fc("",!0):(ts(),sl(c,{key:0,modelValue:t.radiusSlider,"onUpdate:modelValue":e[0]||(e[0]=w=>t.radiusSlider=w),variant:"warning",tooltip:!1,min:t.range[0],max:t.range[1],style:{width:"10rem",margin:"0.5rem 0",padding:"0 0.5rem"}},null,8,["modelValue","min","max"])),Ks(_,{class:"max-content",modelValue:t.useMeters,"onUpdate:modelValue":e[1]||(e[1]=w=>t.useMeters=w),variant:"warning"},{default:Sf(()=>e[2]||(e[2]=[Fg("meters")])),_:1},8,["modelValue"])])])}const JJ=YD(HJ,[["render",KJ],["__scopeId","data-v-b57c8331"]]);/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const GJ=t=>t&&typeof t=="object"&&!Array.isArray(t),Ru=t=>t!=null,rf=t=>Ru(t)&&t!=="false"&&t!==!1,yf=t=>Ru(t)?t:"";function QJ(t){return Object.assign({},t)}function Wa(t,e,i){const s=e.split(".").reduce((n,a)=>typeof n<"u"?n[a]:void 0,t);return typeof s<"u"?s:i}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */Ci({});const u1=(t,e)=>{t.component(e.name,e)};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const KD=Ci({iconPack:"mdi",useHtml5Validation:!0,statusIcon:!0,transformClasses:void 0}),eG=()=>QJ(Ti(KD.value)),Rs=(t,e)=>Wa(KD.value,t,e);/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function Ir(...t){const e=Ng();if(!e)throw new Error("defineClasses must be called within a component setup function.");const i=cB(),s=Ci([]);return s.value=t.map((n,a)=>{const u=n[0],c=n[1],_=n[2],w=n[3];function S(){const A=tG(e,u,c,Jx(_)),P=!Ru(w)||Jx(w);return{[A]:P}}return i.run(()=>{ar(()=>e.proxy.$props[u],()=>{const A=S();s.value[a]=A}),Ru(_)&&dn(_)&&ar(_,(A,P)=>{if(A===P)return;const D=S();s.value[a]=D}),Ru(w)&&dn(w)&&ar(w,(A,P)=>{if(A===P)return;const D=s.value[a];Object.keys(D).forEach(U=>D[U]=A),s.value[a]=D})}),S()}),g1()&&RP(()=>{i&&i.stop()}),s}function tG(t,e,i,s=""){var n;const a=Hx(t),u=(n=t.proxy)==null?void 0:n.$options.configField;if(!u)throw new Error("component must define the 'configField' option.");const c=a.override===!0?{}:eG();let _=Wa(c,`${u}.${e}.class`,"")||Wa(c,`${u}.${e}`,""),w=Wa(a,e,"");if(Array.isArray(w)&&(w=w.join(" ")),typeof w=="function"){const W=Hx(t);w=w(s,W)}else w=yP(w,s);if(Array.isArray(_)&&(_=_.join(" ")),typeof _=="function"){const W=Hx(t);_=_(s,W)}else _=yP(_,s);i.includes("{*}")?i=i.replace(/\{\*\}/g,yf(s)):i=i+yf(s);const S=a.override||Wa(c,"override",!1),A=Wa(c,`${u}.override`,S);let D=`${Wa(c,`${u}.${e}.override`,A)?"":i} ${yf(_)} ${yf(w)}`.trim().replace(/\s\s+/g," ");const U=Wa(c,"transformClasses",void 0),L=Wa(c,`${u}.transformClasses`,void 0);return L?D=L(D):U&&(D=U(D)),D}function yP(t,e){return yf(t).split(" ").filter(i=>i.length>0).map(i=>i+yf(e)).join(" ")}const Hx=t=>{let e=t.proxy.$props;return e=Object.keys(e).filter(i=>i.endsWith("Props")).map(i=>e[i]).reduce((i,s)=>({...i,...s}),e),e};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const iG=Symbol("FielData");function sG(){const t=If(iG,void 0),e=Bt(()=>{var n;if((n=t==null?void 0:t.value)!=null&&n.fieldVariant){if(typeof t.value.fieldVariant=="string")return t.value.fieldVariant;if(Array.isArray(t.value.fieldVariant)){for(const a in t.value.fieldVariant)if(t.value.fieldVariant[a])return a}}}),i=Bt(()=>{var n;return(n=t.value)!=null&&n.hasMessage?t.value.fieldMessage:""}),s=Bt(()=>Rs("statusVariantIcon",{success:"check",danger:"alert-circle",info:"information",warning:"alert"})[e.value]||"");return{parentField:t,statusVariant:e,statusVariantIcon:s,statusMessage:i}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function aa(t){const e=Jx(t);return(e==null?void 0:e.$el)??e}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const Ff=typeof window<"u",JD=typeof window>"u";/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const nG=JD?[]:[HTMLButtonElement,HTMLFieldSetElement,HTMLInputElement,HTMLObjectElement,HTMLOutputElement,HTMLSelectElement,HTMLTextAreaElement];function bP(t){return nG.some(e=>t instanceof e)?t:null}const rG=["disabled","required","pattern","maxlength","minlength","max","min","step"];function oG(t,e,i){const{parentField:s}=sG(),n=Bt(()=>{const W=aa(t);if(!W)return;if(W.getAttribute("data-oruga-input"))return W;const ee=W.querySelector("[data-oruga-input]");if(!ee){console.warn("useInputHandler: Underlaying Oruga input component not found");return}return ee}),a=Bt(()=>{const W=n.value;return W||console.warn("useInputHandler: inputRef contains no element"),W}),u=Ci(!1);function c(){Eu(()=>{a.value&&a.value.focus()})}function _(){Eu(()=>{a.value&&a.value.click()})}function w(W){u.value=!1,s!=null&&s.value&&s.value.setFocus(!1),e("blur",W),D()}function S(W){u.value=!0,s!=null&&s.value&&s.value.setFocus(!0),e("focus",W)}const A=Ci(!0);function P(W,ee){Eu(()=>{s!=null&&s.value&&(s.value.props.variant||s.value.setVariant(W),s.value.props.message||s.value.setMessage(ee))})}function D(){i.useHtml5Validation&&a.value&&(a.value.validity.valid?(P(null,null),A.value=!0):(U(),A.value=!1))}function U(){const W="danger",ee=i.validationMessage||a.value.validationMessage;P(W,ee)}function L(W){D();const ee=bP(W.target);if(ee&&(s!=null&&s.value)&&i.useHtml5Validation){W.preventDefault();let G=!1;if(ee.form!=null){const se=ee.form.elements;for(let fe=0;fe{A.value||D()};let ee=null;ar([n,A,()=>i.useHtml5Validation],G=>{const se=G[0],fe=G[1],Se=G[2];if(ee!=null&&(ee.takeRecords().length>0&&W(),ee.disconnect()),!Ru(se)||fe||!Se)return;ee==null&&(ee=new MutationObserver(W)),ee.observe(se,{attributeFilter:rG});let Te=se;for(;Te=Te.parentNode;)Te instanceof HTMLFieldSetElement&&ee.observe(Te,{attributeFilter:["disabled"]})},{immediate:!0})}return{input:a,isFocused:u,isValid:A,setFocus:c,doClick:_,onFocus:S,onBlur:w,checkHtml5Validity:D,onInvalid:L}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function aG(t){if(t.style.position==="fixed"||!t)return document.documentElement;let e=!1,i=t.parentElement;for(;!e&&Ru(i)&&i!==document.documentElement;){const{overflow:s,overflowY:n}=getComputedStyle(i),{scrollHeight:a,clientHeight:u}=i;if(e=/(auto|scroll)/.test(`${s}${n}`)&&a>u,e)break;i=i.parentElement}return i}const lG=wc({inheritAttrs:!1,__name:"PositionWrapper",props:{teleport:{type:[Boolean,String,Object],required:!0},trigger:{type:Object,default:void 0},position:{type:String,validator:t=>["auto","top","bottom","left","right","top-right","top-left","bottom-left","bottom-right"].indexOf(t)>-1,default:void 0},defaultPosition:{type:String,validator:t=>["top","bottom","left","right"].indexOf(t)>-1,default:"top"},disabled:{type:Boolean,default:!1},disablePositioning:{type:Boolean,default:!0}},emits:["update:position"],setup(t,{emit:e}){const i={top:"bottom",bottom:"top",right:"left",left:"right"},s=t,n=e,a=Bt(()=>typeof s.teleport=="boolean"?"body":s.teleport),u=Bt(()=>typeof s.teleport=="boolean"||!s.teleport?!s.teleport:!1),c=Ci();function _(G){return c.value=G,Eu(()=>{U(),P()}),G}const w=s.position,S=Ci(void 0),A=Ci(null);Ff&&window.ResizeObserver&&(A.value=new window.ResizeObserver(U)),ar(()=>s.disabled,()=>{s.disabled?D():P()},{immediate:!0,flush:"post"}),ar([()=>!!s.trigger,()=>s.disablePositioning,()=>s.disabled],()=>U(),{immediate:!0,flush:"post"}),E1(()=>D());function P(){Ff&&!S.value&&c.value&&(S.value=aG(aa(c)),S.value&&S.value!==document.documentElement?(S.value.addEventListener("scroll",U,{passive:!0}),window.ResizeObserver&&A.value.observe(S.value)):(document.addEventListener("scroll",U,{passive:!0}),window.addEventListener("resize",U)))}function D(){var G;Ff&&(window.ResizeObserver&&((G=A.value)==null||G.disconnect()),window.removeEventListener("resize",U),document.removeEventListener("scroll",U),S.value=void 0)}function U(){if(s.disabled)return;let G=s.position;if(w==="auto"&&(G=L(),G!=s.position&&n("update:position",G)),!s.teleport)return;const se=aa(c),fe=aa(s.trigger);if(se&&fe){const Se=fe.getBoundingClientRect();let Te=Se.top+window.scrollY,Fe=Se.left+window.scrollX;G.includes("bottom")?Te+=fe.clientHeight:G.includes("top")&&(Te-=se.clientHeight),G==="left"?Fe-=se.clientWidth:G==="right"?Fe+=fe.clientWidth:G.includes("-right")&&(Fe+=fe.clientWidth-se.clientWidth),(G==="top"||G==="bottom")&&(Fe+=fe.clientWidth/2),(G==="left"||G==="right")&&(Te+=fe.clientHeight/2),s.disablePositioning?(se.style.position="relative",se.style.top=`${Te}px`,se.style.left=`${Fe}px`):(se.style.position="",se.style.top="",se.style.left="")}}function L(){let G=s.defaultPosition;if(!s.trigger||!c.value||!S.value)return G;const se=new DOMRect(S.value.offsetLeft,S.value.offsetTop,S.value.clientWidth,S.value.clientHeight),fe=aa(c).getBoundingClientRect(),Se=aa(s.trigger).getBoundingClientRect(),Te=ee(Se),Fe=ee(fe),Ne=_t=>{const Dt=Te[_t],jt=Fe[i[_t]];return new DOMRect(fe.x+(Dt.x-jt.x),fe.y+(Dt.y-jt.y),fe.width,fe.height)},Oe=i[s.defaultPosition],Je=s.defaultPosition==="top"||s.defaultPosition==="bottom"?"left":"top",Xe=i[Je],qe=[s.defaultPosition,Oe,Je,Xe];let ht=0;for(const _t of qe){const Dt=W(se,Ne(_t));Dt>ht&&(ht=Dt,G=_t)}return G}function W(G,se){const fe=Math.max(G.left,se.left),Se=Math.min(G.right,se.right),Te=Math.max(G.top,se.top),Fe=Math.min(G.bottom,se.bottom);return Math.max(Se-fe,0)*Math.max(Fe-Te,0)}const ee=G=>({top:{x:(G.left+G.right)*.5,y:G.top},bottom:{x:(G.left+G.right)*.5,y:G.bottom},left:{x:G.left,y:(G.top+G.bottom)*.5},right:{x:G.right,y:(G.top+G.bottom)*.5}});return(G,se)=>(ts(),sl(WB,{to:a.value,disabled:u.value},[u.value?Ou(G.$slots,"default",{key:0,setContent:_}):(ts(),wn("div",b0({key:1},G.$attrs,{style:{position:"absolute",left:"0px",top:"0px"}}),[Ou(G.$slots,"default",{setContent:_})],16))],8,["to","disabled"]))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function GD(t,e,i=document,s){let n;const a=()=>{if(!i)return;const _=aa(i),w=GJ(s)?{...s}:s;setTimeout(()=>{_.addEventListener(t,e,w),n=()=>_.removeEventListener(t,e,w)})};let u;typeof(s==null?void 0:s.trigger)<"u"&&(u=ar(s.trigger,_=>{_?a():c()},{flush:"post"})),s!=null&&s.immediate?a():S1(()=>{(typeof(s==null?void 0:s.trigger)>"u"||s.trigger.value)&&a()});const c=()=>{typeof u=="function"&&u(),typeof n=="function"&&n()};return g1()&&RP(c),c}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function cG(t,e){var i;const s=Ng();if(!s)throw new Error("useProviderChild must be called within a component setup function.");const n=(i=s.proxy)==null?void 0:i.$options.configField,a=(e==null?void 0:e.key)||n,u=Ci([]),c=Ci(1),_=Bt(()=>u.value.slice().sort((P,D)=>P.index-D.index));function w(P){const D=u.value.length,U=A(),L={index:D,data:P,identifier:U};return u.value.push(L),t!=null&&t.value&&Eu(()=>{const W=u.value.map(fe=>`[data-id="${a}-${fe.identifier}"]`).join(","),G=aa(t).querySelectorAll(W),se=Array.from(G).map(fe=>fe.getAttribute("data-id").replace(`${a}-`,""));u.value.forEach(fe=>fe.index=se.indexOf(`${fe.identifier}`))}),L}function S(P){u.value=u.value.filter(D=>D!==P)}function A(){return String(c.value++)}return mM("$o-"+a,{registerItem:w,unregisterItem:S,data:e==null?void 0:e.data}),{childItems:u,sortedItems:_}}function uG(t={needParent:!0}){var e;const i=Ng();if(!i)throw new Error("useProviderChild must be called within a component setup function.");const s=(e=i.proxy)==null?void 0:e.$options.configField,n=(t==null?void 0:t.key)||s,a=If("$o-"+n,void 0),u=t.needParent!==!1,c=t.register!==!1;if(u&&!a)throw new Error(`You should wrap ${i.proxy.$options.name} in a ${n} component`);const _=Ci();return a&&c&&(_.value=a.registerItem(t.data)),A1(()=>{a&&_.value&&a.unregisterItem(_.value)}),{parent:a==null?void 0:a.data,item:_}}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */function hG(t,e,i={}){if(!window)return;const s=Object.assign({ignore:[]},i),n=c=>s.ignore.some(_=>{if(typeof _=="string")return Array.from(window.document.querySelectorAll(_)).some(w=>w===c.target||c.composedPath().includes(w));{const w=aa(_);return w&&(c.target===w||c.composedPath().includes(w))}});return GD("click",c=>{const _=aa(t);!_||_===c.target||c.composedPath().includes(_)||n(c)||e(c)},window,s)}/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const fG=["aria-checked"],dG=["disabled","required","name","autocomplete","value",".indeterminate","true-value","false-value"],pG=wc({isOruga:!0,name:"OCheckbox",configField:"checkbox",inheritAttrs:!1,__name:"Checkbox",props:ry({override:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},variant:{type:String,default:()=>Rs("checkbox.variant")},size:{type:String,default:()=>Rs("checkbox.size")},label:{type:String,default:void 0},indeterminate:{type:Boolean,default:!1},nativeValue:{type:[String,Number,Boolean,Object],default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},name:{type:String,default:void 0},trueValue:{type:[String,Number,Boolean,Object],default:!0},falseValue:{type:[String,Number,Boolean,Object],default:!1},autocomplete:{type:String,default:()=>Rs("checkbox.autocomplete","off")},useHtml5Validation:{type:Boolean,default:()=>Rs("useHtml5Validation",!0)},rootClass:{type:[String,Array,Function],default:void 0},disabledClass:{type:[String,Array,Function],default:void 0},checkedClass:{type:[String,Array,Function],default:void 0},inputClass:{type:[String,Array,Function],default:void 0},inputCheckedClass:{type:[String,Array,Function],default:void 0},indeterminateClass:{type:[String,Array,Function],default:void 0},labelClass:{type:[String,Array,Function],default:void 0},sizeClass:{type:[String,Array,Function],default:void 0},variantClass:{type:[String,Array,Function],default:void 0}},{modelValue:{default:void 0},modelModifiers:{},indeterminate:{type:Boolean,default:!1},indeterminateModifiers:{}}),emits:ry(["update:modelValue","input","update:indeterminate","focus","blur","invalid"],["update:modelValue","update:indeterminate"]),setup(t,{expose:e,emit:i}){const s=t,n=i,a=Ci(),{onBlur:u,onFocus:c,onInvalid:_,setFocus:w}=oG(a,n,s),S=ow(t,"modelValue"),A=ow(t,"indeterminate"),P=Bt(()=>S.value===s.trueValue||Array.isArray(S.value)&&S.value.includes(s.nativeValue));function D(ee){n("input",S.value,ee)}const U=Ir(["rootClass","o-chk"],["checkedClass","o-chk--checked",null,P],["sizeClass","o-chk--",Bt(()=>s.size),Bt(()=>!!s.size)],["disabledClass","o-chk--disabled",null,Bt(()=>s.disabled)],["variantClass","o-chk--",Bt(()=>s.variant),Bt(()=>!!s.variant)]),L=Ir(["inputClass","o-chk__input"],["inputCheckedClass","o-chk__input--checked",null,P],["indeterminateClass","o-chk__input--indeterminate",null,A]),W=Ir(["labelClass","o-chk__label"]);return e({focus:w,value:S}),(ee,G)=>(ts(),wn("label",{ref:"label",class:Vn(Oi(U)),"data-oruga":"checkbox",role:"checkbox","aria-checked":P.value,onClick:G[5]||(G[5]=xn((...se)=>Oi(w)&&Oi(w)(...se),["stop"])),onKeydown:G[6]||(G[6]=hu(xn((...se)=>Oi(w)&&Oi(w)(...se),["prevent"]),["enter"]))},[QP(Ms("input",b0(ee.$attrs,{ref_key:"inputRef",ref:a,"onUpdate:modelValue":G[0]||(G[0]=se=>S.value=se),type:"checkbox","data-oruga-input":"checkbox",class:Oi(L),disabled:t.disabled,required:t.required,name:t.name,autocomplete:t.autocomplete,value:t.nativeValue,".indeterminate":t.indeterminate,"true-value":t.trueValue,"false-value":t.falseValue,onClick:G[1]||(G[1]=xn(()=>{},["stop"])),onBlur:G[2]||(G[2]=(...se)=>Oi(u)&&Oi(u)(...se)),onFocus:G[3]||(G[3]=(...se)=>Oi(c)&&Oi(c)(...se)),onInvalid:G[4]||(G[4]=(...se)=>Oi(_)&&Oi(_)(...se)),onInput:D}),null,48,dG),[[vz,S.value]]),t.label||ee.$slots.default?(ts(),wn("span",{key:0,class:Vn(Oi(W))},[Ou(ee.$slots,"default",{},()=>[Fg(la(t.label),1)])],2)):fc("",!0)],42,fG))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const gG={install(t){u1(t,pG)}};/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const mG=wc({isOruga:!0,name:"OTooltip",configField:"tooltip",__name:"Tooltip",props:ry({override:{type:Boolean,default:void 0},active:{type:Boolean,default:!1},label:{type:String,default:void 0},variant:{type:String,default:()=>Rs("tooltip.variant")},position:{type:String,default:()=>Rs("tooltip.position","auto"),validator:t=>["auto","top","bottom","left","right","top-right","top-left","bottom-left","bottom-right"].indexOf(t)>-1},always:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},animation:{type:String,default:()=>Rs("tooltip.animation","fade")},multiline:{type:Boolean,default:!1},triggerTag:{type:[String,Object,Function],default:()=>Rs("tooltip.triggerTag","div")},triggers:{type:Array,default:()=>Rs("tooltip.triggers",["hover"]),validator:t=>t.filter(e=>["click","hover","contextmenu","focus"].indexOf(e)>-1).length===t.length},delay:{type:Number,default:void 0},closeable:{type:[Array,Boolean],default:()=>Rs("tooltip.closeable",["escape","outside","content"])},teleport:{type:[Boolean,String,Object],default:()=>Rs("dropdown.teleport",!1)},rootClass:{type:[String,Array,Function],default:void 0},teleportClass:{type:[String,Array,Function],default:void 0},contentClass:{type:[String,Array,Function],default:void 0},positionClass:{type:[String,Array,Function],default:void 0},triggerClass:{type:[String,Array,Function],default:void 0},multilineClass:{type:[String,Array,Function],default:void 0},alwaysClass:{type:[String,Array,Function],default:void 0},variantClass:{type:[String,Array,Function],default:void 0},arrowClass:{type:[String,Array,Function],default:void 0},arrowPositionClass:{type:[String,Array,Function],default:void 0}},{active:{type:Boolean,default:!1},activeModifiers:{}}),emits:ry(["update:active","close","open"],["update:active"]),setup(t,{emit:e}){const i=t,s=e,n=ow(t,"active");ar(n,Fe=>{s(Fe?"open":"close")});const a=Ci(),u=Ci(i.position);ar(()=>i.position,Fe=>u.value=Fe);const c=Ci(),_=Ci(),w=Ci([]);ar(n,Fe=>{Fe&&Ff?setTimeout(()=>{S.value.indexOf("outside")>=0&&w.value.push(hG(c,A,{ignore:[_],immediate:!0,passive:!0})),S.value.indexOf("escape")>=0&&w.value.push(GD("keyup",P,document,{immediate:!0}))}):Fe||(w.value.forEach(Ne=>Ne()),w.value.length=0)});const S=Bt(()=>typeof i.closeable=="boolean"?i.closeable?["escape","outside","content"]:[]:i.closeable);function A(){!n.value||i.always||S.value.indexOf("outside")<0||(n.value=!1)}function P(Fe){if(n.value&&(Fe.key==="Escape"||Fe.key==="Esc")){if(S.value.indexOf("escape")<0)return;n.value=!1}}function D(){i.triggers.indexOf("click")<0||Eu(()=>setTimeout(()=>ee()))}function U(Fe){i.triggers.indexOf("contextmenu")<0||(Fe.preventDefault(),ee())}function L(){i.triggers.indexOf("focus")<0||ee()}function W(){i.triggers.indexOf("hover")<0||ee()}function ee(){i.disabled||(i.delay?a.value=setTimeout(()=>{n.value=!0,a.value=null},i.delay):n.value=!0)}function G(){S.value.indexOf("content")<0||(n.value=!i.closeable,a.value&&i.closeable&&clearTimeout(a.value))}const se=Ir(["rootClass","o-tip"],["teleportClass","o-tip--teleport",null,Bt(()=>!!i.teleport)]),fe=Ir(["triggerClass","o-tip__trigger"]),Se=Ir(["arrowClass","o-tip__arrow"],["arrowPositionClass","o-tip__arrow--",u,Bt(()=>!!u.value)],["variantArrowClass","o-tip__arrow--",Bt(()=>i.variant),Bt(()=>!!i.variant)]),Te=Ir(["contentClass","o-tip__content"],["positionClass","o-tip__content--",u,Bt(()=>!!u.value)],["variantClass","o-tip__content--",Bt(()=>i.variant),Bt(()=>!!i.variant)],["multilineClass","o-tip__content--multiline",null,Bt(()=>i.multiline)],["alwaysClass","o-tip__content--always",null,Bt(()=>i.always)]);return(Fe,Ne)=>(ts(),wn("div",{class:Vn(Oi(se)),"data-oruga":"tooltip"},[Ks(lG,{position:u.value,"onUpdate:position":Ne[0]||(Ne[0]=Oe=>u.value=Oe),teleport:t.teleport,class:Vn(Oi(se)),trigger:_.value,"default-position":"top",disabled:!n.value},{default:Sf(({setContent:Oe})=>[Ks(QL,{name:t.animation},{default:Sf(()=>[QP(Ms("div",{ref:Je=>c.value=Oe(Je),class:Vn(Oi(Te))},[Ms("span",{class:Vn(Oi(Se))},null,2),Ou(Fe.$slots,"content",{},()=>[Fg(la(t.label),1)])],2),[[oz,n.value||t.always&&!t.disabled]])]),_:2},1032,["name"])]),_:3},8,["position","teleport","class","trigger","disabled"]),(ts(),sl(rL(t.triggerTag),{ref_key:"triggerRef",ref:_,class:Vn(Oi(fe)),"aria-haspopup":"true",onClick:D,onContextmenu:U,onMouseenter:W,onFocusCapture:L,onBlurCapture:G,onMouseleave:G},{default:Sf(()=>[Ou(Fe.$slots,"default",{active:n.value})]),_:3},40,["class"]))],2))}});/*! Oruga v0.9.0-pre.1 | MIT License | github.com/oruga-ui/oruga */const _G=["tabindex","aria-label","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled","onKeydown"],yG={key:0},vP=wc({isOruga:!0,name:"OSliderThumb",configField:"slider",inheritAttrs:!1,__name:"SliderThumb",props:{sliderProps:{type:Object,required:!0},modelValue:{type:Number,required:!0},sliderSize:{type:Function,required:!0},thumbWrapperClasses:{type:Array,required:!0},thumbClasses:{type:Array,required:!0}},emits:["update:modelValue","change","dragstart","dragend"],setup(t,{expose:e,emit:i}){const s=t,n=i,a=Bt(()=>s.sliderProps),u=Ci(!1),c=Ci(!1),_=Ci(0),w=Ci(0),S=Ci(null),A=Ci(s.modelValue),P=Bt(()=>a.value.tooltip),D=Bt(()=>a.value.tooltipAlways),U=Bt(()=>a.value.disabled),L=Bt(()=>a.value.max),W=Bt(()=>a.value.min),ee=Bt(()=>a.value.step),G=Bt(()=>a.value.indicator),se=Bt(()=>a.value.ariaLabel),fe=Bt(()=>{const Zt=[W.value,L.value,ee.value].map(pi=>{const gi=(""+pi).split(".")[1];return gi?gi.length:0});return Math.max(...Zt)}),Se=Bt(()=>a.value.tooltipVariant?a.value.tooltipVariant:a.value.variant),Te=Bt(()=>`${(s.modelValue-W.value)/(L.value-W.value)*100}%`),Fe=Bt(()=>({left:Te.value})),Ne=Bt(()=>typeof a.value.customFormatter<"u"?a.value.customFormatter(s.modelValue):a.value.format==="percent"?new Intl.NumberFormat(a.value.locale,{style:"percent"}).format((s.modelValue-W.value)/(L.value-W.value)):new Intl.NumberFormat(a.value.locale).format(s.modelValue));function Oe(){u.value=!0}function Je(){u.value=!1}function Xe(Zt){U.value||(Zt.preventDefault(),jt(Zt),Ff&&(document.addEventListener("mousemove",Rt),document.addEventListener("touchmove",Rt),document.addEventListener("mouseup",Xt),document.addEventListener("touchend",Xt),document.addEventListener("contextmenu",Xt)))}function qe(){U.value||s.modelValue===W.value||(S.value=parseFloat(Te.value)-ee.value/(L.value-W.value)*100,xi(S.value),n("change"))}function ht(){U.value||s.modelValue===L.value||(S.value=parseFloat(Te.value)+ee.value/(L.value-W.value)*100,xi(S.value),n("change"))}function _t(){U.value||s.modelValue===W.value||(S.value=0,xi(S.value),n("change"))}function Dt(){U.value||s.modelValue===L.value||(S.value=100,xi(S.value),n("change"))}function jt(Zt){c.value=!0,n("dragstart"),Zt.type==="touchstart"&&(Zt.clientX=Zt.touches[0].clientX),_.value=Zt.clientX,w.value=parseFloat(Te.value),S.value=w.value}function Rt(Zt){if(c.value){Zt.type==="touchmove"&&(Zt.clientX=Zt.touches[0].clientX);const pi=(Zt.clientX-_.value)/s.sliderSize()*100;S.value=w.value+pi,xi(S.value)}}function Xt(){c.value=!1,n("dragend"),s.modelValue!==A.value&&n("change"),xi(S.value),Ff&&(document.removeEventListener("mousemove",Rt),document.removeEventListener("touchmove",Rt),document.removeEventListener("mouseup",Xt),document.removeEventListener("touchend",Xt),document.removeEventListener("contextmenu",Xt))}function xi(Zt){if(Zt===null||isNaN(Zt))return;Zt<0?Zt=0:Zt>100&&(Zt=100);const pi=100/((L.value-W.value)/ee.value);let $s=Math.round(Zt/pi)*pi/100*(L.value-W.value)+W.value;$s=parseFloat($s.toFixed(fe.value)),n("update:modelValue",$s),!c.value&&$s!==A.value&&(A.value=$s)}return e({setPosition:xi}),(Zt,pi)=>(ts(),wn("div",{class:Vn(t.thumbWrapperClasses),style:Qa(Fe.value),"data-oruga":"slider-thumb"},[Ks(mG,{label:Ne.value,variant:Se.value,disabled:U.value||!P.value,always:D.value||c.value||u.value},{default:Sf(()=>[Ms("div",b0(Zt.$attrs,{class:t.thumbClasses,tabindex:U.value?null:0,role:"slider","aria-label":se.value,"aria-valuenow":t.modelValue,"aria-valuemin":W.value,"aria-valuemax":L.value,"aria-disabled":U.value,"aria-orientation":"horizontal",onMousedown:Xe,onTouchstartPassive:Xe,onFocus:Oe,onBlur:Je,onKeydown:[hu(xn(qe,["prevent"]),["left"]),hu(xn(ht,["prevent"]),["right"]),hu(xn(qe,["prevent"]),["down"]),hu(xn(ht,["prevent"]),["up"]),hu(xn(_t,["prevent"]),["home"]),hu(xn(Dt,["prevent"]),["end"])]}),[G.value?(ts(),wn("span",yG,la(Ne.value),1)):fc("",!0)],16,_G)]),_:1},8,["label","variant","disabled","always"])],6))}}),QD=wc({isOruga:!0,name:"OSliderTick",configField:"slider",__name:"SliderTick",props:{override:{type:Boolean,default:void 0},value:{type:Number,required:!0},label:{type:String,default:void 0},tickClass:{type:[String,Function,Array],default:void 0},tickHiddenClass:{type:[String,Function,Array],default:void 0},tickLabelClass:{type:[String,Function,Array],default:void 0}},setup(t){const e=t,{parent:i}=uG(),s=Bt(()=>{const _=(e.value-i.value.min)/(i.value.max-i.value.min)*100;return _>=0&&_<=100?_:0}),n=Bt(()=>e.value===i.value.min||e.value===i.value.max),a=Bt(()=>({left:s.value+"%"})),u=Ir(["tickClass","o-slide__tick"],["tickHiddenClass","o-slide__tick--hidden",null,n]),c=Ir(["tickLabelClass","o-slide__tick-label"]);return(_,w)=>(ts(),wn("div",{class:Vn(Oi(u)),style:Qa(a.value),"data-oruga":"slider-tick"},[_.$slots.default?(ts(),wn("span",{key:0,class:Vn(Oi(c))},[Ou(_.$slots,"default",{},()=>[Fg(la(t.label),1)])],2)):fc("",!0)],6))}}),bG=wc({isOruga:!0,name:"OSlider",configField:"slider",__name:"Slider",props:{override:{type:Boolean,default:void 0},modelValue:{default:void 0},range:{},min:{default:0},max:{default:100},step:{default:1},variant:{default:()=>Rs("slider.variant")},size:{default:()=>Rs("slider.size")},ticks:{type:Boolean,default:!1},tooltip:{type:Boolean,default:()=>Rs("slider.tooltip",!0)},tooltipVariant:{default:()=>Rs("slider.tooltipVariant")},tooltipAlways:{type:Boolean,default:!1},rounded:{type:Boolean,default:()=>Rs("slider.rounded",!1)},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},customFormatter:{type:Function,default:void 0},biggerSliderFocus:{type:Boolean,default:!1},indicator:{type:Boolean,default:!1},format:{default:()=>Rs("slider.format","raw")},locale:{default:()=>Rs("locale")},ariaLabel:{default:()=>Rs("slider.ariaLabel")},rootClass:{},sizeClass:{},trackClass:{},fillClass:{},thumbRoundedClass:{},thumbDraggingClass:{},disabledClass:{},thumbWrapperClass:{},thumbClass:{},variantClass:{},tickClass:{},tickHiddenClass:{},tickLabelClass:{},thumbWrapperDraggingClass:{}},emits:["update:modelValue","change","dragging","dragstart","dragend"],setup(t,{expose:e,emit:i}){const s=t,n=i,a=Ci(),u=Ci(),c=Ci(),_=Bt(()=>({max:s.max,min:s.min}));cG(void 0,{data:_});const w=Ci(null),S=Ci(null),A=Ci(!1),P=Ci(),D=Ci(),U=Bt(()=>Math.min(w.value,S.value)),L=Bt(()=>Math.max(w.value,S.value)),W=Bt(()=>rf(s.range)?[U.value,L.value]:w.value||0);ar([w,S],()=>{rf(s.range)&&(P.value=w.value>S.value),(!s.lazy||!A.value)&&n("update:modelValue",W.value),A.value&&n("dragging",W.value)}),ar([()=>s.min,()=>s.max,()=>s.modelValue],()=>ee(s.modelValue),{immediate:!0});function ee(Dt){if(!(s.min>s.max))if(Array.isArray(Dt)){const jt=typeof Dt[0]!="number"||isNaN(Dt[0])?s.min:Math.min(Math.max(s.min,Dt[0]),s.max),Rt=typeof Dt[1]!="number"||isNaN(Dt[1])?s.max:Math.max(Math.min(s.max,Dt[1]),s.min);w.value=P.value?Rt:jt,S.value=P.value?jt:Rt}else w.value=isNaN(Dt)?s.min:Math.min(s.max,Math.max(s.min,Dt)),S.value=null}const G=Bt(()=>{if(!s.ticks||s.min>s.max||s.step===0)return[];const Dt=[];for(let jt=s.min+s.step;jtrf(s.range)?`${100*(L.value-U.value)/(s.max-s.min)}%`:`${100*(w.value-s.min)/(s.max-s.min)}%`),fe=Bt(()=>rf(s.range)?`${100*(U.value-s.min)/(s.max-s.min)}%`:"0%"),Se=Bt(()=>({width:se.value,left:fe.value}));function Te(){return a.value.getBoundingClientRect().width}function Fe(Dt){if(s.disabled||D.value)return;const jt=a.value.getBoundingClientRect().left,Rt=(Dt.clientX-jt)/Te()*100,Xt=s.min+Rt*(s.max-s.min)/100,xi=Math.abs(Xt-w.value);if(rf(s.range)){const Zt=Math.abs(Xt-S.value);if(xi<=Zt){if(xiD.value=!1),A.value=!1,n("dragend"),s.lazy&&n("update:modelValue",W.value)}const Je=Ir(["rootClass","o-slide"],["sizeClass","o-slide--",Bt(()=>s.size),Bt(()=>!!s.size)],["disabledClass","o-slide--disabled",null,Bt(()=>s.disabled)]),Xe=Ir(["trackClass","o-slide__track"]),qe=Ir(["fillClass","o-slide__fill"],["variantClass","o-slide__fill--",Bt(()=>s.variant),Bt(()=>!!s.variant)]),ht=Ir(["thumbClass","o-slide__thumb"],["thumbDraggingClass","o-slide__thumb--dragging",null,A],["thumbRoundedClass","o-slide__thumb--rounded",null,Bt(()=>s.rounded)]),_t=Ir(["thumbWrapperClass","o-slide__thumb-wrapper"],["thumbWrapperDraggingClass","o-slide__thumb-wrapper--dragging",null,A]);return e({value:W}),(Dt,jt)=>(ts(),wn("div",{class:Vn(Oi(Je)),"data-oruga":"slider",onClick:Fe},[Ms("div",{ref_key:"sliderRef",ref:a,class:Vn(Oi(Xe))},[Ms("div",{class:Vn(Oi(qe)),style:Qa(Se.value)},null,6),Dt.ticks?(ts(!0),wn(Un,{key:0},tw(G.value,(Rt,Xt)=>(ts(),sl(QD,{key:Xt,value:Rt,"tick-class":Dt.tickClass,"tick-hidden-class":Dt.tickHiddenClass,"tick-label-class":Dt.tickLabelClass},null,8,["value","tick-class","tick-hidden-class","tick-label-class"]))),128)):fc("",!0),Ou(Dt.$slots,"default"),Ks(vP,{ref_key:"thumbStartRef",ref:u,modelValue:w.value,"onUpdate:modelValue":jt[0]||(jt[0]=Rt=>w.value=Rt),"slider-props":s,"slider-size":Te,"thumb-classes":Oi(ht),"thumb-wrapper-classes":Oi(_t),onChange:jt[1]||(jt[1]=Rt=>n("change",W.value)),onDragstart:Ne,onDragend:Oe},null,8,["modelValue","thumb-classes","thumb-wrapper-classes"]),Oi(rf)(s.range)?(ts(),sl(vP,{key:1,ref_key:"thumbEndRef",ref:c,modelValue:S.value,"onUpdate:modelValue":jt[2]||(jt[2]=Rt=>S.value=Rt),"slider-props":s,"slider-size":Te,"thumb-classes":Oi(ht),"thumb-wrapper-classes":Oi(_t),onChange:jt[3]||(jt[3]=Rt=>n("change",W.value)),onDragstart:Ne,onDragend:Oe},null,8,["modelValue","thumb-classes","thumb-wrapper-classes"])):fc("",!0)],2)],2))}}),vG={install(t){u1(t,bG),u1(t,QD)}};Iz(JJ).use(gG).use(vG).mount("#app");